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

Node fork-0 not definied #61

Closed
phuismann opened this issue Nov 10, 2020 · 3 comments · Fixed by #62
Closed

Node fork-0 not definied #61

phuismann opened this issue Nov 10, 2020 · 3 comments · Fixed by #62

Comments

@phuismann
Copy link

I tried to create my own DHN from GIS data by adding Forks, Pipes and Consumers to ThermalNetwork(), but it seems like the associated lat, lon is not passed to the class. Checking with is_consistent() gives me Node fork-0 not defined even tho it's available in thermal_network.components.forks.

I also tried is_consistent() on the example shown here https://dhnx.readthedocs.io/en/latest/examples.html and it returns Node producer-0 not defined.

Is it a bug or is something missing in the tutorial?

@joroeder
Copy link
Member

Thank you for your issue.

Yes, there is a bug in the example. The from_node, to_node must be named producers, forks and consumers - so with the "s":

from dhnx.network import ThermalNetwork


thermal_network = ThermalNetwork()

thermal_network.add('Producer', id=0, lat=50, lon=10)

thermal_network.add('Consumer', id=0, lat=50, lon=10)

thermal_network.add('Pipe', id=0, from_node='producers-0', to_node='consumers-0')

print("Is consistent: ", thermal_network.is_consistent())

print(thermal_network)

# returns
# dhnx.network.ThermalNetwork object with these components
#  * 1 producers
#  * 1 consumers
#  * 1 pipes

print(thermal_network.components.pipes)

# returns
#        from_node     to_node
#    0  producer-0  consumer-0

Do you want to perform an network optimisation or a simulation? If you check the structure of the input data of the simulation or optimisation examples respectivly, your GIS output should have the same structure as the input of the examples. In future, further functionalities should be added to directly import via osmnx or other libraries eg street data and directly process the strucute for DHNx (see also #54 ) - contributions are very welcome :)

@phuismann
Copy link
Author

Thank you works now!

For starters, I'm interested in network optimisation, but simulation will be on the agenda as well eventually.

I'll be happy to contribute!

@joroeder
Copy link
Member

If you are interested in the development, you can join the next oemof dev meeting, or especially the DHNx session I just put into the wiki as topic https://github.com/oemof/oemof/wiki/Meeting-December-2020-(online) - the exact time of each session will come soon hopefully 😉

@jnnr jnnr mentioned this issue Nov 10, 2020
@jnnr jnnr closed this as completed in #62 Nov 10, 2020
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

Successfully merging a pull request may close this issue.

2 participants