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

Guard against adding deprecated legacy variables #61

Merged

Conversation

danielhuppmann
Copy link
Member

This PR adds a test and GitHub Actions workflow to guard against mistakenly adding variables that were marked as being superseded by new variables.

The way that legacy variables are marked in the common-definitions repository is by having an attribute with the legacy project name, currently "navigate" and "engage".

- Final Energy|Carbon Removal|{Carbon Removal Option}|Electricity:
    description: Electricity use for carbon removal by {Carbon Removal Option}
    unit: EJ/yr
    notes: See `Secondary Energy|Electricity|...` for the power generation mix
    navigate: Final Energy|Carbon Removal|Electricity|{Carbon Removal Option}

The test workflow checks that all such attributes are not duplicates of variables in the VariableCodeList.

@danielhuppmann danielhuppmann self-assigned this Feb 15, 2024
@danielhuppmann
Copy link
Member Author

The validation can be seen "in action" here

Copy link
Contributor

@phackstock phackstock left a comment

Choose a reason for hiding this comment

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

Looks good to me, just a few small comments but already good to merge.

requirements.txt Outdated Show resolved Hide resolved
.github/workflows/legacy.yml Outdated Show resolved Hide resolved
.github/workflows/legacy.yml Show resolved Hide resolved
Co-authored-by: Philip Hackstock <20710924+phackstock@users.noreply.github.com>
@danielhuppmann
Copy link
Member Author

Thanks @phackstock - I prefer to keep the requirements.txt file for now because this is an easy way for new users to quickly see what is required to run this project. We can add it to the Readme instead in a follow-up PR.

@danielhuppmann danielhuppmann merged commit 4adcd19 into IAMconsortium:main Feb 15, 2024
3 checks passed
@danielhuppmann danielhuppmann deleted the tests/legacy-variables branch February 15, 2024 17:41
macflo8 pushed a commit to macflo8/common-definitions that referenced this pull request Mar 27, 2024
Co-authored-by: Philip Hackstock <20710924+phackstock@users.noreply.github.com>
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