Skip to content

feedback on "high-level computation patterns" #166

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

Closed
dcherian opened this issue Mar 20, 2023 · 3 comments · Fixed by #186
Closed

feedback on "high-level computation patterns" #166

dcherian opened this issue Mar 20, 2023 · 3 comments · Fixed by #186
Assignees

Comments

@dcherian
Copy link
Contributor

  • @scottyhq points out that we should address that new users start by writing loops, we should encourage them to think of converting loops to these higher level helpers
  • @JessicaS11 points out that these high level objects are hard to debug and understand. So some more intro material would be useful.
@keewis
Copy link
Contributor

keewis commented Mar 21, 2023

see pydata/xarray#7641 for an example for the conversion from loops to groupby.

The intro material should include tips on how to visualize those high-level objects (like, use .construct for rolling or call dict on groupby objects). I find that looking at a small sample of what they contain really helps when trying to come up with ways to transform the high-level object back to a Dataset / DataArray.

Also, maybe this is something for the main repository, but calling arr.rolling(...).construct("window_dim").isel(...) to get something that is easy to understand might be a bit much to write, so we probably should modify the repr of those objects to be a bit more informative?

@dcherian
Copy link
Contributor Author

Just chatted with @maxrjones .

Another concept to emphasize with rolling is views vs copies after calling .construct. And that if you have a vectorize-able function calling it on the output of .construct is probably a lot better than using Rolling.__iter__

@dcherian dcherian mentioned this issue May 18, 2023
34 tasks
@JessicaS11 JessicaS11 self-assigned this Jun 2, 2023
@JessicaS11 JessicaS11 linked a pull request Jun 23, 2023 that will close this issue
@DOptimusPrime
Copy link

You can also check the my links. We have used some of Xarray high computational patterns. I will be posting some more of my work which combine xarray with other packages like gdal

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

Successfully merging a pull request may close this issue.

4 participants