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

Container version #60

Merged
merged 5 commits into from
Nov 27, 2024
Merged

Container version #60

merged 5 commits into from
Nov 27, 2024

Conversation

aethr
Copy link
Contributor

@aethr aethr commented Nov 22, 2024

Description

Make the openmethane-prior package version available inside the container so that data files can be annotated with the version that was used to process them.

Checklist

Please confirm that this pull request has done the following:

  • Tests added
  • Documentation added (where applicable)
  • Changelog item added to changelog/

Notes

aethr added a commit that referenced this pull request Nov 22, 2024
aethr added a commit that referenced this pull request Nov 22, 2024
@aethr aethr force-pushed the container-version branch from db7c2c7 to 08a9e3f Compare November 22, 2024 04:03
aethr added a commit that referenced this pull request Nov 25, 2024
@aethr aethr force-pushed the container-version branch 2 times, most recently from bd19ee8 to bb1ed2c Compare November 25, 2024 05:25
@aethr
Copy link
Contributor Author

aethr commented Nov 25, 2024

After a full run of the prior, the output file has these global attributes (from ncdump):

// global attributes:
		:DX = 10000.f ;
		:DY = 10000.f ;
		:TRUELAT1 = -15.f ;
		:TRUELAT2 = -40.f ;
		:MOAD_CEN_LAT = -27.644f ;
		:STAND_LON = 133.302f ;
		:XCELL = 10000. ;
		:YCELL = 10000. ;
		:XCENT = 133.302001953125 ;
		:YCENT = -27.5 ;
		:XORIG = -2270000. ;
		:YORIG = -2165629.25 ;
                // attributes below are added in this PR
		:title = "Open Methane Prior Estimate" ;
		:comment = "Gridded prior emissions estimate for methane across Australia" ;
		:history = "2024-11-25 22:09:22.573050+00:00: scripts/omPrior.py --start-date 2022-07-22 --end-date 2022-07-22" ;
		:openmethane_prior_version = "v0.2.0" ;

The version in openmethane_prior_version comes from the OPENMETHANE_PRIOR_VERSION env var in docker, or from pyproject.toml if run locally. The OPENMETHANE_PRIOR_VERSION value is baked into the container at build time using --build-arg VERSION, and if run locally it will be set to development.

@aethr aethr requested a review from prayner November 25, 2024 22:17
This includes a history attribute that records the time the file was generated, the command and package version at the time of creation.
This make task became unusable when the docker-based "run" target was added. It also wasn't updated when the method for passing in start and end time arguments was updated.
It's unlikely that users would think to look in the history attribute to find software version information. By putting the version in its own explicitly labelled attribute, it's easier to find and also more readily available for parsing.

Fix inputs
@aethr aethr force-pushed the container-version branch from bb1ed2c to d000758 Compare November 25, 2024 22:31
@aethr aethr merged commit f06cfc2 into main Nov 27, 2024
9 checks passed
@aethr aethr deleted the container-version branch November 27, 2024 23:57
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