Skip to content

Request for additional xcube rule: coordinate values should be monotonic and unique #78

Description

@clarasb

Description

For xcube datasets, coordinate values should be monotonic and unique. This is important because xarray can only create efficient indexes when coordinate labels are well ordered and non-duplicated. It also helps ensure that multi-dimensional tile fetching works reliably.

At the moment, xrlint has an xcube/increasing-time rule that checks the time coordinate specifically. This issue proposes to add a more general xcube rule for all relevant one-dimensional coordinate variables.

Proposed rule

Add a new xcube rule, for example:

xcube/monotonic-unique-coords

The rule should check coordinate variables where:

coord.name in dataset.coords
coord.dims == (coord.name,)

For each such coordinate, values should be:

  • monotonic, either strictly increasing or strictly decreasing
  • unique, with no duplicate coordinate labels

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions