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

chore: enforce unique fuel type names, and unique emission names within one fuel type #84

Merged
merged 8 commits into from
Jun 26, 2023

Conversation

frodehk
Copy link
Contributor

@frodehk frodehk commented Jun 20, 2023

Why is this pull request needed?

  • Names for FUEL_TYPE must be unique across installations in an eCalc model file
  • Names for EMISSIONS must be unique within one FUEL_TYPE

Duplicate names may lead to debug problems e.g. for vector lengths etc. It may also override previous value without the user noticing (e.g. when Ctrl-C Ctrl-V syntax)

What does this pull request change?

  • Add extra verification for duplicate fuel type names in Asset-class in components.py (library)
  • Add extra verifications in create_references.py for duplicate fuel type names in Yaml-file
  • Add extra verifications in create_references.py for duplicate emission names in Yaml-file
  • Add test for duplicate fuel type names using dto and library (no yaml)
  • Add test for duplicate fuel type names using yaml-file
  • Add test for duplicate emission names within one fuel, using yaml-file

Issues related to this change:

https://github.com/equinor/ecalc-engine/issues/3401

@frodehk frodehk requested a review from a team as a code owner June 20, 2023 12:28
@frodehk frodehk self-assigned this Jun 20, 2023
@frodehk frodehk changed the title chore: enforce unique fuel type names chore: enforce unique fuel type names, and emission names within one fuel type Jun 22, 2023
@frodehk frodehk changed the title chore: enforce unique fuel type names, and emission names within one fuel type chore: enforce unique fuel type names, and unique emission names within one fuel type Jun 22, 2023
Copy link
Collaborator

@TeeeJay TeeeJay left a comment

Choose a reason for hiding this comment

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

nice, just add the missing test :)

@frodehk frodehk merged commit 4ea9c63 into main Jun 26, 2023
@frodehk frodehk deleted the unique-fueltype-names branch June 26, 2023 11:15
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