-
Notifications
You must be signed in to change notification settings - Fork 10
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
[BUG] Handling of Duplicate Columns with different Units #250
Comments
Hi Wim, Thank you for your clear report and repro case. We will investigate. |
Dear Wim @wfjvdham , Thank you for reporting the issue. This is an known issue for us. The issue lies more on the Vision side as we assume the users would provide input up to specs as per Pandas dictation. Since the excel handling within PGM-io was built on top of Pandas, the solution for now is to not include the extra information in an additional P field when exporting from Vision. We will make a more permanent solution in the coming sprints based on priorities. |
I can also make the solution, what would be the right way to do it?
|
it is on our agenda for the next refinement this afternoon. If we get to a design, we will post it here.
After that, whoever wants to pick it up can do that (based on priorities and availability between team AKI and team DGC). It's good to know that that's an option as well! |
@wfjvdham the conclusion of the refinement is that there's some unknowns surrounding the (un)stability of the Vision Excel export. Next sprint, we will first do some more investigation to this before we finalize a design. Implementation will probably come the sprint after that, as agreed with Jaap. |
Ok thanks 👍 |
Hi @Jerry-Jinfeng-Guo @petersalemink95 , do you have any updates about this bug? I read #251 and it does not seem to provide a solution for us. Our team automates netchecks for K&O, and many usefull/critical information is stored in the "specifics" / "Bijzonderheden" tabs in Vision. For example MSR ID's, HLD ID's and "special contract types". Wim has made a suggestion above how to solve this bug. Are there reasons not to implement this solution? If develop-capacity is an issue, we can also create a PR so that you only need to review. We can also create a feature branch to test the changes on all Vision files of all regions before merging to main. I prefer working (on the long term) from the main branch of PGM io for AKI, instead of using a feature branch ... |
Hi @Jaap-van-Wijck , thank you for letting us know that disabling "specifics" is not enough for you. Internally renaming I would like to ask you the following questions:
If above is not up to your expectation, please let us know and we will bring that up during the team meetings. |
Before I suggested 2 options, 1 was renaming one of the columns. If that is not the best way to go what about the other option I suggested:
There nothing changes to the names of the columns |
Hi @wfjvdham @Jaap-van-Wijck , please see: #261 |
Closed by #261 |
Describe the bug
Currently columns are checked for duplicated and renamed if the combination of column name and unit is the same (in
ExcelFileStore._group_columns_by_index()
). When only the column name is the same but the unit is different the columns are read as is. This can cause a problem later when usingTabularData()._apply_unit_conversion()
To Reproduce
If for example an excel sheet contains two columns:
Those are not renamed because they are not identified as being a duplicate column. But here:
power-grid-model-io/src/power_grid_model_io/data_types/tabular_data.py
Line 146 in 3d8eb4c
The value of
field
is just P so the content of both columns is returned giving an error because string values can not be converted to W.Expected behavior
The problem can be solved by changing
table_data[field] *= multiplier
bytable_data[(field, unit)] *= multiplier
but I am not sure if two columns with the same name should exists (even though they have different units). Maybe better would be to do the grouping on only the first value of the index in theExcelFileStore._group_columns_by_index()
function.The text was updated successfully, but these errors were encountered: