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

add check for valid dimension name before creating new variable #360

Merged
merged 5 commits into from
Dec 12, 2024

Conversation

tom-welfonder
Copy link
Contributor

Add function to ensure that added variables do not use unvalid dimension names.
Add test for variable assignment with invalid dimension name.
This code adds a more meaning full error message if users try to create new variables with invalid dimension names.
Old behavior is described in #359.

Add function to ensure that added variables do not use unvalid dimension names.
Copy link
Member

@lkstrp lkstrp left a comment

Choose a reason for hiding this comment

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

Hey @tom-welfonder, thanks for the contribution! And sorry for taking a while. That looks like a useful check. Just some minor things.

linopy/model.py Outdated Show resolved Hide resolved
linopy/model.py Outdated Show resolved Hide resolved
linopy/model.py Outdated Show resolved Hide resolved
linopy/model.py Outdated Show resolved Hide resolved
tom-welfonder and others added 4 commits December 8, 2024 14:17
More condensed check of dim_names

Co-authored-by: Lukas Trippe <[email protected]>
remove unnecessary else block

Co-authored-by: Lukas Trippe <[email protected]>
make check_valid_dim_names private

Co-authored-by: Lukas Trippe <[email protected]>
make check_valid_dim_names private

Co-authored-by: Lukas Trippe <[email protected]>
Copy link
Member

@lkstrp lkstrp left a comment

Choose a reason for hiding this comment

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

Thank you @tom-welfonder !

@lkstrp lkstrp merged commit ede48e3 into PyPSA:master Dec 12, 2024
18 of 19 checks passed
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 this pull request may close these issues.

2 participants