Skip to content
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

Editing input data in PyCharm causes error #26

Open
jakob-wo opened this issue Mar 3, 2020 · 2 comments
Open

Editing input data in PyCharm causes error #26

jakob-wo opened this issue Mar 3, 2020 · 2 comments
Milestone

Comments

@jakob-wo
Copy link

jakob-wo commented Mar 3, 2020

I am trying out the import_export_plot example and noticed the following error (or rather a bug):

To change to position of a consumer I opened data_csv_input/consumers.csv in PyCharm. In the editor I changed from Text mode (plain editor) to Table Editor (PyCharm gadget to visualise csv as table). When I edit the values in Table Editor mode the csv file changes from

id,lat,lon,node_type
0,51.3470,12.3894,consumer
1,51.3390,12.3880,consumer

to

id,lat,lon,node_type
0,51.3470,12.3894,consumer
1,51.3390,12.3880,consumer
,,,
,,,
,,,

For some reason PyCharm adds empty rows. That causes the following error when executing the example:

  File "import_export_plot.py", line 8, in <module>
    thermal_network.from_csv_folder('data_csv_input')
  File "c:\users\jakob-wo\dhnx\dhnx\network.py", line 85, in from_csv_folder
    self = importer.load()
  File "c:\users\jakob-wo\dhnx\dhnx\input_output.py", line 111, in load
    self.thermal_network.is_consistent()
  File "c:\users\jakob-wo\dhnx\dhnx\network.py", line 182, in is_consistent
    raise ValueError(f"Node {data['to_node']} not defined.")
ValueError: Node consumers-0 not defined.

@jakob-wo
Copy link
Author

jakob-wo commented Mar 3, 2020

Well, PyCharm seems to be aware of that problem. They even show a warning in the editor.

Using the table editor might change the format of the CSV file.

@jnnr
Copy link
Member

jnnr commented Mar 4, 2020

I see. The error message does not really point to the problem. We could add another check of the input data: Assert that id does not contain nans.

@jnnr jnnr added this to the v0.0.2 milestone Oct 22, 2020
@joroeder joroeder modified the milestones: v0.0.2, v0.0.3 Jul 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants