Skip to content

Rudimentary check for geometry instance dimension #1171

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

benjwadams
Copy link
Contributor

Requirement states "One of the dimensions of the data variable with geometry must be the number of geometries to which the data applies." Currently only checks that the number of non-coordinate variable dimensions is greater than one.

Requirement states "One of the dimensions of the data variable with
geometry must be the number of geometries to which the data applies."
Currently only checks that the number of non-coordinate variable dimensions
is greater than one.
geom_valid.out_of += 1
# TODO: figure out more robust way of determining instance dimension
# need at least one instance dimension for the geometry variable
if len(set(var.dimensions) - {var.name}) < 1:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Need suggestions on a better check for determining which dimension is related to the number of geometry instances.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is how I understand it!

The number of geometry instances should be determined as follow:

  • Check the data variable with the attribute "geometry":

    -- Extract the geometry container variable listed under the "geometry" attribute.

    -- The geometry container variable should list the attribute "node_coordinates" with the nodes coordinates variables.

    -- The nodes coordinates variables should list the attribute "nodes".

    -- The number of geometry instances is the dimension of the nodes coordinates variables.

    -- This number of geometry instances is also listed in the data variable list of dimensions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, that makes sense to me.

@benjwadams
Copy link
Contributor Author

This looks like we need to have an instance dimension for geometry related variables, but I don't think we have a reliable way of determining that at the moment.

geom_valid.out_of += 1
# TODO: figure out more robust way of determining instance dimension
# need at least one instance dimension for the geometry variable
if len(set(var.dimensions) - {var.name}) < 1:
Copy link
Contributor

Choose a reason for hiding this comment

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

This is how I understand it!

The number of geometry instances should be determined as follow:

  • Check the data variable with the attribute "geometry":

    -- Extract the geometry container variable listed under the "geometry" attribute.

    -- The geometry container variable should list the attribute "node_coordinates" with the nodes coordinates variables.

    -- The nodes coordinates variables should list the attribute "nodes".

    -- The number of geometry instances is the dimension of the nodes coordinates variables.

    -- This number of geometry instances is also listed in the data variable list of dimensions.

@leilabbb
Copy link
Contributor

leilabbb commented May 8, 2025

This looks like we need to have an instance dimension for geometry related variables, but I don't think we have a reliable way of determining that at the moment.

It could be done by checking out the dimension of SomeVariable with goemetry attribute against (1) the file listed dimension and (2) the node coordinates

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