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

Specific unit testing of Cube.coord_dims #4552

Open
wjbenfold opened this issue Jan 28, 2022 · 5 comments
Open

Specific unit testing of Cube.coord_dims #4552

wjbenfold opened this issue Jan 28, 2022 · 5 comments

Comments

@wjbenfold
Copy link
Contributor

📰 Custom Issue

Currently there isn't specific unit testing of Cube.coord_dims. I'd like to see this change.

Suggested coverage:

  • coord on the cube
  • coord not on the cube (but matches one that is)
  • coord not on the cube (and doesn't match one that is)
  • string
  • coord on multiple dims
  • coord is aux factory
  • coord is aux_coord
@wjbenfold wjbenfold self-assigned this Jan 28, 2022
@pp-mo
Copy link
Member

pp-mo commented Jan 31, 2022

The way this currently works, we do have tests for the cube_dims methods of Coord / AncillaryVariable / CellMeasure.
(which is essentially the same routine):

These are all, actually, basically the same thing, but it is implemented like this because Cube doesn't provide a method to access an arbitrary 'dimensional cube component', equivalent to a _DimensionalMetadata.
So we just need to fetch the correct type of object :

I guess the Cube API is done this way, just to make the public Cube API methods explicit, and not too abstract.
This also reflects the fact that the cube stores these things apart in separate data structures
Ugly though, isn't it ?

@pp-mo
Copy link
Member

pp-mo commented Jan 31, 2022

Cube doesn't provide a method to access an arbitrary 'dimensional cube component' ... just to make the public Cube API methods explicit ... Ugly though, isn't it ?

Although the unstructured support has now added Connectivity as a subclass of _DimensionalMetadata, and that does not relate to cube dimensions in the same way -- and so, interestingly, its cube_dims method has to be disabled.

@trexfeathers
Copy link
Contributor

Although the unstructured support has now added Connectivity as a subclass of _DimensionalMetadata, and that does not relate to cube dimensions in the same way -- and so, interestingly, its cube_dims method has to be disabled.

This, you may recall, is why @bjlittle has recently mentioned restructuring the inheritance model for _DimensionalMetadata (although if we're going to put in the effort I'd personally quite like to spend the time combining _DimensionalMetadata and Cube into the same inheritance hierarchy).

Copy link
Contributor

github-actions bot commented Nov 4, 2023

In order to maintain a backlog of relevant issues, we automatically label them as stale after 500 days of inactivity.

If this issue is still important to you, then please comment on this issue and the stale label will be removed.

Otherwise this issue will be automatically closed in 28 days time.

@github-actions github-actions bot added the Stale A stale issue/pull-request label Nov 4, 2023
Copy link
Contributor

github-actions bot commented Dec 2, 2023

This stale issue has been automatically closed due to a lack of community activity.

If you still care about this issue, then please either:

  • Re-open this issue, if you have sufficient permissions, or
  • Add a comment stating that this is still relevant and someone will re-open it on your behalf.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 2, 2023
@trexfeathers trexfeathers added Type: Testing and removed Stale A stale issue/pull-request labels Dec 6, 2023
@trexfeathers trexfeathers reopened this Dec 6, 2023
@scitools-ci scitools-ci bot removed this from 🚴 Peloton Dec 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

3 participants