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: Update sample data to v0.3.0 #68

Merged
merged 7 commits into from
Jan 23, 2025
Merged

chore: Update sample data to v0.3.0 #68

merged 7 commits into from
Jan 23, 2025

Conversation

lewisjared
Copy link
Contributor

@lewisjared lewisjared commented Jan 22, 2025

Description

Updates the sample data to v0.3.0 and streamlined some of the tests to minimise the number of hand rolled changes that are required when updating the sample data

Checklist

Please confirm that this pull request has done the following:

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

Copy link

codecov bot commented Jan 22, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Files with missing lines Coverage Δ
packages/ref/src/cmip_ref/testing.py 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

@lewisjared
Copy link
Contributor Author

@bouweandela I'm trying to make the tests that depend on the sample data use pytest-regressions where possible to make it easier to bump versions in future

@@ -123,4 +123,4 @@ fetch-test-data: ## Download any data needed by the test suite

.PHONY: update-test-data-registry
update-test-data-registry: ## Update the test data registry
curl --output packages/ref/src/ref/datasets/sample_data.txt https://raw.githubusercontent.com/CMIP-REF/ref-sample-data/refs/heads/main/registry.txt
curl --output packages/ref/src/cmip_ref/datasets/sample_data.txt https://raw.githubusercontent.com/CMIP-REF/ref-sample-data/refs/heads/main/registry.txt
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we could avoid the need to manually update the registry file and bump the version to the correct value: how about making this command bump the SAMPLE_VERSION variable to the latest release of the sample data and adding a bit of code in packages/ref/src/cmip_ref/testing.py that automatically downloads the file from https://raw.githubusercontent.com/CMIP-REF/ref-sample-data/refs/tags/{SAMPLE_VERSION}/registry.txt if it's not yet available locally? e.g. it could be stored in pooch.os_cache("cmip_ref") / f"sample-data-registry-{SAMPLE_VERSION}.txt"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We would also have to/should track the hash of the registry file. I quite like seeing the diff of the registry in the PR. Maybe a future enhancement if we have to do this often.

Copy link
Contributor

Choose a reason for hiding this comment

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

We would also have to/should track the hash of the registry file

The SAMPLE_VERSION git tag/commit already refers to a unique version of that file, so I don't think we would need another one.

If you like seeing the diff to make it more clear which files have changed, maybe we could just make the make update-test-data-registry also automatically figure out what the latest version is and update SAMPLE_VERSION, so we avoid some manual work and we are sure that the registry file always matches the SAMPLE_VERSION.

* origin/main:
  Add temporal constraints (#64)
  case changes
  ilamb3 to ilamb
  missing dep
  added changelog
  ilamb3 implementation of the example metric
@lewisjared lewisjared mentioned this pull request Jan 23, 2025
3 tasks
@lewisjared lewisjared merged commit 59a3565 into main Jan 23, 2025
13 checks passed
@lewisjared lewisjared deleted the update-sample-data branch January 23, 2025 02:49
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