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

More robust subsetting for periods #361

Open
1 task
RondeauG opened this issue Mar 7, 2024 · 0 comments
Open
1 task

More robust subsetting for periods #361

RondeauG opened this issue Mar 7, 2024 · 0 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@RondeauG
Copy link
Collaborator

RondeauG commented Mar 7, 2024

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.
@RondeauG RondeauG added bug Something isn't working enhancement New feature or request labels Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant