Summary
Running the contingency tutorial notebook fails during imports because gridfm_graphkit.utils.visualization imports symbols that are not available in the current codebase.
Reproduction
- Open
examples/notebooks/Tutorial_contingency_analisys.ipynb
- Run the imports cell containing:
from gridfm_graphkit.utils.visualization import (...)
- Observe the error.
Actual behavior
Import fails with:
ImportError: cannot import name 'PBELoss' from gridfm_graphkit.training.loss
- (after fixing that)
ImportError: cannot import name 'PQ' from gridfm_graphkit.datasets.globals
Expected behavior
The tutorial import cell should run without errors in a clean install of the repository.
Root cause (likely)
visualization.py appears to use outdated imports:
PBELoss no longer exists (or was renamed/removed) in training.loss
- bus type constants are now
PQ_H, PV_H, REF_H in datasets.globals
Suggested fix
- Make
PBELoss import optional (or remove hard dependency from module import path)
- Update constant imports in
visualization.py to PQ_H, PV_H, REF_H (or provide backward-compatible aliases)
Environment
- OS: Linux
- Python: 3.12
- Installed from current
main checkout