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

Record Python package versions in GDX files #502

Merged
merged 12 commits into from
Jan 10, 2024
Merged

Record Python package versions in GDX files #502

merged 12 commits into from
Jan 10, 2024

Conversation

khaeru
Copy link
Member

@khaeru khaeru commented Dec 11, 2023

This PR provides the basic functionality for addressing iiasa/message_ix#747.

The GAMSModel class gains an attribute/parameter (record_version_packages) and a method (record_versions()); the latter is called from within the run() method. This adds a set to the Scenario that is to be solved, with entries like:

Set ixmp_version(*,*) Versions of Python packages used to generate this model /
'message_ix'.'3-7-1-dev55+g2e0a9c49', 
'ixmp'.'3-7-1-dev67+g6cab755-d20231122'
'notapackage'.'(not installed)' /;

(The list of included packages is according to record_version_packages, so can be extended by downstream packages, like message-ix, that use or subclass GAMSModel.)

How to review

Read the diff and note that the CI checks all pass.

Test together with a message_ix PR to be opened next.

PR checklist

  • Continuous integration checks all ✅
  • Add or expand tests; coverage checks both ✅
  • Add, expand, or update documentation.
  • Update release notes.

@khaeru khaeru added the enh New features & functionality label Dec 11, 2023
@khaeru khaeru added this to the 3.8 milestone Dec 11, 2023
@khaeru khaeru self-assigned this Dec 11, 2023
@khaeru
Copy link
Member Author

khaeru commented Dec 11, 2023

@glatterf42 FYI. I'll request your review once the checklist is complete.

Copy link

codecov bot commented Dec 11, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (41f8a96) 98.9% compared to head (36b6c16) 98.9%.

Additional details and impacted files
@@          Coverage Diff          @@
##            main    #502   +/-   ##
=====================================
  Coverage   98.9%   98.9%           
=====================================
  Files         44      44           
  Lines       4758    4792   +34     
=====================================
+ Hits        4706    4741   +35     
+ Misses        52      51    -1     
Files Coverage Δ
ixmp/backend/jdbc.py 97.4% <100.0%> (+0.1%) ⬆️
ixmp/model/gams.py 100.0% <100.0%> (ø)
ixmp/report/operator.py 99.0% <ø> (ø)
ixmp/tests/backend/test_jdbc.py 100.0% <100.0%> (ø)
ixmp/tests/core/test_scenario.py 100.0% <100.0%> (ø)

khaeru added a commit to iiasa/message_ix that referenced this pull request Dec 11, 2023
@khaeru khaeru requested a review from glatterf42 January 9, 2024 15:54
Copy link
Member

@glatterf42 glatterf42 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, thanks :)

glatterf42 pushed a commit to iiasa/message_ix that referenced this pull request Jan 10, 2024
@khaeru khaeru merged commit e0a48a4 into main Jan 10, 2024
21 checks passed
@khaeru khaeru deleted the enh/gams-version branch January 10, 2024 07:19
khaeru added a commit that referenced this pull request Jan 10, 2024
Fix a regression introduced in #502.
glatterf42 pushed a commit that referenced this pull request Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enh New features & functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants