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

New callbacks to standardise some dim names #983

Merged
merged 20 commits into from
Dec 16, 2024
Merged

New callbacks to standardise some dim names #983

merged 20 commits into from
Dec 16, 2024

Conversation

jwarner8
Copy link
Contributor

@jwarner8 jwarner8 commented Dec 12, 2024

Fixes #982
Also added new fix for pressure level coordinate where surface recipes actively seek cubes where there is no pressure level data, i.e. pressure level list = [], but some AIFS cubes have the pressure coordinate called 'pressure_level' so this ensures cubes use 'pressure'.

Contribution checklist

Aim to have all relevant checks ticked off before merging. See the developer's guide for more detail.

  • Documentation has been updated to reflect change.
  • New code has tests, and affected old tests have been updated.
  • All tests and CI checks pass.
  • Ensured the pull request title is descriptive.
  • Conda lock files have been updated if dependencies have changed.
  • Attributed any Generative AI, such as GitHub Copilot, used in this PR.
  • Marked the PR as ready to review.

@jwarner8 jwarner8 marked this pull request as ready for review December 12, 2024 14:00
Copy link
Contributor

github-actions bot commented Dec 12, 2024

Coverage

@jwarner8 jwarner8 self-assigned this Dec 12, 2024
@jwarner8 jwarner8 added bug Something isn't working enhancement New feature or request labels Dec 12, 2024
tests/operators/test_read.py Outdated Show resolved Hide resolved
tests/operators/test_read.py Outdated Show resolved Hide resolved
@jwarner8
Copy link
Contributor Author

Fixes additional bug in get_cube_yxcoordname, where a spatial coordinate could be returned even though the dimension is scalar, and not a dim_coord. And thus using get_cube_yxcoordname may suggest cube is spatial (even though its been collapsed and spatial coords still exist as scalars in the metadata).

@jwarner8 jwarner8 requested a review from jfrost-mo December 12, 2024 16:42
@jwarner8
Copy link
Contributor Author

Actually, hold fire, still not getting coverage for https://tmpweb.net/LXAHrJ43vmBu/z_f5ac9763053bfad5_read_py#t349. I will look tomorrow...

@jwarner8
Copy link
Contributor Author

Now ready for review, I think I hadn't given the coverage time to update/might have been cached in browser, now back at 100% coverage.

Copy link
Member

@jfrost-mo jfrost-mo left a comment

Choose a reason for hiding this comment

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

A normalisation callback is a good idea.

The big think I notices was that you are converting to grid_latitude, where I think, looking at the CF Conventions, that we should be converting to latitude instead.

I'm also uncertain about whether we want to exclude scalar coordinates, as latitude and longitude are just as sensible on point data as they are on gridded.

src/CSET/operators/read.py Show resolved Hide resolved
src/CSET/operators/read.py Show resolved Hide resolved
src/CSET/operators/read.py Outdated Show resolved Hide resolved
src/CSET/operators/read.py Outdated Show resolved Hide resolved
src/CSET/operators/read.py Outdated Show resolved Hide resolved
tests/operators/test_read.py Show resolved Hide resolved
tests/operators/test_read.py Show resolved Hide resolved
tests/operators/test_read.py Outdated Show resolved Hide resolved
tests/operators/test_read.py Show resolved Hide resolved
src/CSET/operators/_utils.py Outdated Show resolved Hide resolved
@jwarner8 jwarner8 requested a review from daflack December 16, 2024 12:12
@jwarner8
Copy link
Contributor Author

Reviewed by James already and comments addressed, but not sure if I can merge until he approves. Adding @daflack as reviewer for final glance (and see if merges are possible if there is at least one reviewer who accepts)

Copy link
Contributor

@daflack daflack left a comment

Choose a reason for hiding this comment

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

Other than a typo looks good to me.

src/CSET/operators/_utils.py Outdated Show resolved Hide resolved
@jwarner8 jwarner8 dismissed jfrost-mo’s stale review December 16, 2024 13:14

Have discussed this PR with JamesF in person Friday, and David has also re-reviewed so dismissing review as James on holiday for 3 weeks.

@jwarner8 jwarner8 merged commit da2ab23 into main Dec 16, 2024
8 checks passed
@jwarner8 jwarner8 deleted the aifs_comp branch December 16, 2024 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Collapsing cube over latitude/longitude coords with different names
3 participants