Skip to content

ShocSimple.topology can raise an error on variables without a standard_name #178

@mx-moth

Description

@mx-moth

latitude = next(
name for name, variable in self.dataset.variables.items()
if variable.dims == self._dimensions
and variable.attrs["standard_name"] == "latitude"
)
longitude = next(
name for name, variable in self.dataset.variables.items()
if variable.dims == self._dimensions
and variable.attrs["standard_name"] == "longitude"
)

This code tries to find latitude and longitude variables. If a variable has the correct dimensions but does not have a standard name, this will raise a KeyError. The code should be updated to handle this case.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions