Skip to content

More robust subsetting for periods #361

@RondeauG

Description

@RondeauG

Addressing a Problem?

In multiple functions, we use a periods argument to subset the Dataset. However we simply do ds_subset = ds.sel(time=slice(period[0], period[1])), which never checks that the entire period is contained within ds.

Potential Solution

A wrapper function in xs.utils that checks that the entire period is contained within ds, and raises an error if it doesn't.

Additional context

Linked to an issue in #360.

Contribution

  • I would be willing/able to open a Pull Request to contribute this feature.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions