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

The error message when adding the two components with identical label is not helpful #1147

Open
fwitte opened this issue Dec 10, 2024 · 4 comments

Comments

@fwitte
Copy link
Member

fwitte commented Dec 10, 2024

It would be nice, if there would be an exact error message instead of this:

grafik

@fwitte
Copy link
Member Author

fwitte commented Dec 10, 2024

es = EnergySystem(timeindex=solph.create_time_index(2024, number=2))
bus_heat = Bus("heat")
bus_electricity = Bus("electricity")

converter1 = Converter(
    label="converter",
    inputs={bus_electricity: Flow()},
    outputs={bus_heat: Flow(nominal_value=1)}
)

converter2 = Converter(
    label="converter",
    inputs={bus_electricity: Flow()},
    outputs={bus_heat: Flow(nominal_value=1)}
)

es.add(bus_heat, bus_electricity, converter1, converter2)

@p-snft
Copy link
Member

p-snft commented Dec 10, 2024

This should/might be fixed by #1139.

@fwitte
Copy link
Member Author

fwitte commented Dec 10, 2024

Thank you!

There is one more: In case you have not added a component to the EnergySystem it is similarly not helpful. It is nice to have that raising an error (to not accidentally forget about a part of the system), but it should point the user towards that.

@p-snft
Copy link
Member

p-snft commented Dec 11, 2024

I have to correct myself: After merging #1139, it will fail earlier, but not directly on the error.

Adding two Nodes with the same label could be caught in oemof.network. However, I don't see how having two Flows between the same Nodes could be addressed as a possible error. (In particular, overwriting is a possibility in both cases.) Also, not adding a Node is hard to detect.

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

2 participants