-
Notifications
You must be signed in to change notification settings - Fork 9
[BUG] No module named 'power_grid_model._utils' #297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @Bjorn346 , you are completely right. We missed this. @nitbharambe @Jerry-Jinfeng-Guo for compatibility, this also requires bumping The best solution is probably to do 2 PRs on the PGM-IO side to
@Bjorn346 you can maybe also do the fix. EDIT: a more verbose but more robust way could be to do this on the power-grid-model side:
|
@Bjorn346 Good find on the problem and the solution! Cause relates to PowerGridModel/power-grid-model#787 and PowerGridModel/power-grid-model#784 where we made imports private and the issue originated from PowerGridModel/power-grid-model#953 |
Step 1: PowerGridModel/power-grid-model#988 |
@nitbharambe please also consider the option to copy-paste the is_nan functionality. It's basic and i don't think it's big enough to directly import it from PGM |
@mgovers Since this has come up in discussion with @petersalemink95 / @Jerry-Jinfeng-Guo too, lets indeed do that instead.
|
I am personally not experienced with professional version-controlled developing, so @nitbharambe and @mgovers please go ahead with fixing the bug, as I genuinely don't know how to propose, pull-request and push fixes ;-). |
Step 4: is_nan functionality copied: #299 |
Describe the bug
When importing PgmJsonConverter, the error message 'ModuleNotFoundError: No module named 'power_grid_model._utils'' is appearing. The power_grid_model._utils does not exist anymore on that location, since version v1.10.107 of the Power-grid-model, but was moved to power_grid_model._core.utils.
To Reproduce
from power_grid_model_io.converters import PgmJsonConverter
Expected behavior
No error message in Pyhton
Output from commandline
Traceback (most recent call last):
File "c:*\Calc_MV_voltages.py", line 1, in
from power_grid_model_io.converters import VisionExcelConverter, PgmJsonConverter
File "C:*.venv\Lib\site-packages\power_grid_model_io\converters_init_.py", line 9, in
from power_grid_model_io.converters.pgm_json_converter import PgmJsonConverter
File "C:*.venv\Lib\site-packages\power_grid_model_io\converters\pgm_json_converter.py", line 16, in
from power_grid_model._utils import is_nan
ModuleNotFoundError: No module named 'power_grid_model._utils'
Suggested solution
Within file "src/power_grid_model_io/converters/pgm_json_converter.py" replace line 16 from
from power_grid_model._utils import is_nan
tofrom power_grid_model._core.utils import is_nan
The text was updated successfully, but these errors were encountered: