We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trying to load a Grid from a matfile with a single zone causes a dimensional mismatch error.
A minimum code snippet required to reproduce the bug. Please make sure to minimize the number of dependencies required.
>>> from powersimdata import Grid >>> grid = Grid(source=PATH_TO_MATFILE, interconnect="ERCOT") Loading bus Loading plant Loading heat_rate_curve Loading gencost_before Loading gencost_after Loading branch Loading sub Loading bus2sub Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Python39\lib\site-packages\powersimdata\input\grid.py", line 57, in __init__ data = FromREISE(source) File "C:\Python39\lib\site-packages\powersimdata\input\scenario_grid.py", line 25, in __init__ super().__init__() File "C:\Python39\lib\site-packages\powersimdata\input\abstract_grid.py", line 34, in __init__ self._build_network() File "C:\Python39\lib\site-packages\powersimdata\input\scenario_grid.py", line 132, in _build_network self._read_network() File "C:\Python39\lib\site-packages\powersimdata\input\scenario_grid.py", line 102, in _read_network zone = pd.DataFrame(mpc.zone, columns=["zone_id", "zone_name"]) File "C:\Python39\lib\site-packages\pandas\core\frame.py", line 672, in __init__ mgr = ndarray_to_mgr( File "C:\Python39\lib\site-packages\pandas\core\internals\construction.py", line 324, in ndarray_to_mgr _check_values_indices_shape_match(values, index, columns) File "C:\Python39\lib\site-packages\pandas\core\internals\construction.py", line 393, in _check_values_indices_shape_match raise ValueError(f"Shape of passed values is {passed}, indices imply {implied}") ValueError: Shape of passed values is (2, 1), indices imply (2, 2)
If we look at the matfile itself:
>>> from scipy.io import loadmat >>> mpc = loadmat(PATH_TO_MATFILE, squeeze_me=True, struct_as_record=False) >>> mpc["mdi"].mpc.zone array([47, 'ERCOT'], dtype=object)
We can reproduce the same error with pandas and dummy data:
>>> import pandas as pd >>> pd.DataFrame([1, 2], columns=[3, 4]) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Python39\lib\site-packages\pandas\core\frame.py", line 711, in __init__ mgr = ndarray_to_mgr( File "C:\Python39\lib\site-packages\pandas\core\internals\construction.py", line 324, in ndarray_to_mgr _check_values_indices_shape_match(values, index, columns) File "C:\Python39\lib\site-packages\pandas\core\internals\construction.py", line 393, in _check_values_indices_shape_match raise ValueError(f"Shape of passed values is {passed}, indices imply {implied}") ValueError: Shape of passed values is (2, 1), indices imply (2, 2)
Passing engine="REISE.jl" to the Grid constructor doesn't solve the problem.
engine="REISE.jl"
Please specify your platform and versions of the relevant libraries you are using:
8357023827885b936fb1aef758a09e82fdc93004
The text was updated successfully, but these errors were encountered:
rouille
BainanXia
jenhagg
No branches or pull requests
馃
Bug summary
Trying to load a Grid from a matfile with a single zone causes a dimensional mismatch error.
Code for reproduction
A minimum code snippet required to reproduce the bug. Please make sure to minimize the
number of dependencies required.
If we look at the matfile itself:
We can reproduce the same error with pandas and dummy data:
Passing
engine="REISE.jl"
to the Grid constructor doesn't solve the problem.Environment
Please specify your platform and versions of the relevant libraries you are using:
8357023827885b936fb1aef758a09e82fdc93004
The text was updated successfully, but these errors were encountered: