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

Made set_up_variable_cube test helper support non-square grid cells #1988

Conversation

MO-PeterJordan
Copy link
Contributor

@MO-PeterJordan MO-PeterJordan commented Apr 5, 2024

Made set_up_variable_cube test helper support non-square grid cells
This supports making gradient divide by distance instead of degrees. Specifically it is required to allow testing of gradient for circular coordinate systems.

Testing:

  • Ran tests and they passed OK
  • Added new tests for the new feature(s) - n/a. Amended existing tests to cover new behaviour.

CLA

  • If a new developer, signed up to CLA

Copy link
Contributor

@MoseleyS MoseleyS left a comment

Choose a reason for hiding this comment

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

One small tweak should fix Sphinx.

Add your name and email address to .mailmap, this should fix the Contributing check.

improver/synthetic_data/set_up_test_cubes.py Outdated Show resolved Hide resolved
@MO-PeterJordan
Copy link
Contributor Author

One small tweak should fix Sphinx.

Add your name and email address to .mailmap, this should fix the Contributing check.

Done

.mailmap Outdated Show resolved Hide resolved
@MO-PeterJordan MO-PeterJordan force-pushed the make-set-up-variable-cube-support-non-square-cubes branch 3 times, most recently from df6e555 to 7fe71ea Compare April 10, 2024 16:03
@MO-PeterJordan
Copy link
Contributor Author

Have rebased to edit original commit author to match correct name in mailmap (i.e. Peter Jordan)

@MoseleyS
Copy link
Contributor

This still isn't happy. It seems that the commit that squashes all your previous commits together is authored by peter.jordan rather than MO-PeterJordan (use git log).
The CI Test uses git shortlog -s which shows that there is just this one commit to sort out. You might need to create a new branch with the right user, then cherry-pick this one commit into it and create a new PR from it.

…ed contributors list and mailmap

Co-authored-by: Stephen Moseley <stephen.moseley@metoffice.gov.uk>

Co-authored-by: Stephen Moseley <stephen.moseley@metoffice.gov.uk>
@MO-PeterJordan MO-PeterJordan force-pushed the make-set-up-variable-cube-support-non-square-cubes branch from 7fe71ea to 730109d Compare April 11, 2024 08:37
Copy link
Contributor

@MoseleyS MoseleyS left a comment

Choose a reason for hiding this comment

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

While all the automated CI tests pass, these do not include the acceptance tests, and there's one set that fail. They're all associated with this CLI:
improver/cli/generate_metadata_cube.py
The issue is that the cli always passes in a keyword argument {"grid_spacing": None}, except for the one acceptance test that actually sets a value to it. This code needs reworking to get it to pass.

source etc/site-init
export IMPROVER_ACC_TEST_DIR=/data/users/cfst/improver_test_data/data
pytest improver_tests/acceptance/test_generate_metadata_cube.py

@MO-PeterJordan
Copy link
Contributor Author

All tests now pass. Ready for re-review.

Copy link

codecov bot commented Apr 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.39%. Comparing base (96cdbef) to head (d50ef06).

❗ Current head d50ef06 differs from pull request most recent head 02c284b. Consider uploading reports for the commit 02c284b to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1988   +/-   ##
=======================================
  Coverage   98.39%   98.39%           
=======================================
  Files         124      124           
  Lines       12209    12212    +3     
=======================================
+ Hits        12013    12016    +3     
  Misses        196      196           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

MoseleyS
MoseleyS previously approved these changes Apr 16, 2024
Copy link
Contributor

@mspelman07 mspelman07 left a comment

Choose a reason for hiding this comment

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

Thanks Peter, generally I think the changes look good, just a couple of small things to look at.

Copy link
Contributor

@MoseleyS MoseleyS left a comment

Choose a reason for hiding this comment

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

Re-approved

@MoseleyS MoseleyS merged commit 84a8944 into metoppv:master Apr 22, 2024
8 checks passed
@MO-PeterJordan MO-PeterJordan deleted the make-set-up-variable-cube-support-non-square-cubes branch April 22, 2024 14:15
MoseleyS added a commit to MoseleyS/improver that referenced this pull request Aug 22, 2024
…etoppv#1988)

* Changed helper methods and updated tests using it to match. Also signed contributors list and mailmap

Co-authored-by: Stephen Moseley <stephen.moseley@metoffice.gov.uk>

Co-authored-by: Stephen Moseley <stephen.moseley@metoffice.gov.uk>

* Changed one of the generate metadata tests to match new set-up-test-cube logic

* Fixed generate_metadata tests

* Tidying up

* small review acton

* Added tests for test cubes with equal x and y dimensions

* Bugfix

---------

Co-authored-by: Stephen Moseley <stephen.moseley@metoffice.gov.uk>
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.

3 participants