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

Changes to assignment warning in sel/isel methods #9869

Open
JanukanS opened this issue Dec 10, 2024 · 1 comment
Open

Changes to assignment warning in sel/isel methods #9869

JanukanS opened this issue Dec 10, 2024 · 1 comment

Comments

@JanukanS
Copy link
Contributor

What is your issue?

I have a few suggestions on the warning against value assignment in the DataArray.sel documentation. I wanted to get a maintainer's opinion on if these changes are helpful before I submit a PR.

1. Similar functions should have this warning
DataArray.isel, Dataset.sel and Dataset.isel also can't be used for value assignment and should have a similar warning on their documentation page.

2. Warning should be specific to the function
Each warning should only warn against using a specific function. Currently the warning on DataArray.sel warns against using either DataArray.sel or DataArray.isel. The code example in the warning should use a specific function. The example in the DataArray.sel warning currently uses the isel method.

3. Warning should tell user how to properly assign values
The warning currently tells the user not to use isel/sel for value assignment but doesn't direct the user towards an alternative. The code example currently tells the user what not to do. The example can be extended by a line to show the correct way (i.e. direct/loc indexing)

@JanukanS JanukanS added the needs triage Issue that has not been reviewed by xarray team member label Dec 10, 2024
@dcherian dcherian added topic-documentation and removed needs triage Issue that has not been reviewed by xarray team member labels Dec 10, 2024
@dcherian
Copy link
Contributor

Thanks, these sound like great improvements to our documentation. Would you be willing to help out by sending in a Pull Request to make these changes? We have some instructions on how to contribute here.

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

No branches or pull requests

2 participants