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

Make energy_system.nodes a dict #35

Merged
merged 6 commits into from
Dec 14, 2023
Merged

Make energy_system.nodes a dict #35

merged 6 commits into from
Dec 14, 2023

Conversation

p-snft
Copy link
Member

@p-snft p-snft commented Oct 27, 2023

Todo:

  • Check if all nodes are still needed to be in the groupings. Probably just custom groupings should be there.
  • Check compatibility with solph
  • Compatibility with solph seems to have issues as default values for slots are not foreseen in Python,
    but we do have them. Another issue might be fixed with Move Node functionality from Entity to Node #30.
  • This PR will not change the way Nodes are organised in groupings. This can be done as a separate action.

@p-snft p-snft added the enhancement New feature or request label Oct 27, 2023
@p-snft p-snft self-assigned this Oct 27, 2023
@pep8speaks
Copy link

pep8speaks commented Oct 27, 2023

Hello @p-snft! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2023-12-14 12:55:18 UTC

@p-snft p-snft added this to the v1.0.0 milestone Nov 8, 2023
The property energy_system.nodes now still contains dict_values.
This should be compatible to the old list. Access by label is
poosible using energy_system.node[key].
@p-snft p-snft marked this pull request as ready for review December 14, 2023 09:37
@p-snft
Copy link
Member Author

p-snft commented Dec 14, 2023

I discussed this with @gnn already at the dev meeting. If there are no objections within one week, I will merge.

@p-snft p-snft requested review from oemof-developer and a team and removed request for oemof-developer December 14, 2023 10:14
Copy link

@henhuy henhuy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most review items are only suggestions, except review item on property setter, which could cause errors!

src/oemof/network/energy_system.py Outdated Show resolved Hide resolved
src/oemof/network/energy_system.py Show resolved Hide resolved
The setter is problably unused, and I do not see a test for it.
As I do not see a use case, I propose to delete it.
@p-snft p-snft requested a review from henhuy December 14, 2023 13:00
@p-snft
Copy link
Member Author

p-snft commented Dec 14, 2023

The test fails because reporting to Coveralls does not work.

@p-snft p-snft merged commit 056b0df into dev Dec 14, 2023
10 of 12 checks passed
@p-snft p-snft deleted the feature/node_dict branch December 14, 2023 13:09
@gnn
Copy link
Member

gnn commented Dec 21, 2023

Erm... I actually had an objection and was trying to find the time to push alternative changes instead of raising an objection. That's why the one week objection period was actually important for me.

@p-snft
Copy link
Member Author

p-snft commented Dec 21, 2023

Sorry, that I implied things that I did not mean to say. As there was an approval, I considered it to be okay. I would have waited for one week if there wasn't an feedback.

Still, the changes are not in a published release, so please bring up your alternative.

Update: As I learned in the chat, the idea is an API like

nodel_labeled_sponk = energy_system.nodes.by_label["sponk"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants