-
Notifications
You must be signed in to change notification settings - Fork 113
Computational pattern tutorial edits #186
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
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
for more information, see https://pre-commit.ci
@scottyhq @dcherian @yutik-nn @e-marshall It turns out I'm having trouble creating a loop example because I've hit upon the thing that usually keeps me from using groupby (this code is also in the tutorial notebook on this branch):
the outputs (acknowledging the differences in printing vs storing and object type) of:
and
match and make sense to me (12 values, one for each month, with all the days of each of the years included in the mean). Then
returns a large array of len 12, with each of those also being an array with lots of values. Why is the behavior of these different, and what am I missing conceptually? |
Use |
Thanks, @dcherian! It took me some head scratching, but I see what's going on now. I also dug in a bit to the I'd be curious to explore some ideas around minimizing this cognitive dissonance for new users (assuming others encounter this issue). Something like changing the default of the |
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
The need for grouped/rolling/coarsen reduction over all dimensions of the array seems rare (even in my experience): pydata/xarray#2363, not to mention somewhat confusing for a dataset where arrays can have different dimensions. At this point, any changes to defaults are very unlikely. However, every "pattern" should be consistent in this behaviour. |
@scottyhq The QC linkchecker is failing with an anchor error for a specific discussion comment, even though the url works fine if you stick it in a browser... thoughts on how we might want to handle this? As best I understand it (from e.g.), GH generated anchors are an unresolved issue in certain cases... the comments for the particular discussion thread I'm linking to are long (>60 replies), so the only alternative I can think of to point to the correct comment would be to provide the date of the solution post. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like these additions a lot! I think they make the material a lot more approachable when you're working through it on your own.
Note that that doesn't even contain the final solution: there were a lot of things that were unclear, so instead we resorted to using a different channel. The final solution computes the binary mask, applies Not sure how to deal with that, maybe we can just ask them to post the final state in a new comment? |
Great idea, @keewis. I've added a comment in the discussion to this effect. |
Maybe we don't need to link to it ? |
I took the link out for now until the final solution is posted (though it turns our that even though the QC checker failed the anchored link it renders fine in the preview. I also noticed the preview has all the exercise solutions numbered as 8. @lsetiawan Is this an easy thing to fix? Otherwise this should be about ready to go! |
I think you need
instead of
|
I tried and it failed: |
I think you assign the label under
(it took me a while to figure it out too) |
For some reason |
Thanks @JessicaS11 this is a great improvement! |
Haha - well it seems obvious in retrospect (I thought "generalize" was a sort of odd command). Thanks for the update and for fixing+merging! |
* upstream/main: Update indexing material (xarray-contrib#192) Migrate to exercise syntax (xarray-contrib#196) Bump pangeo/base-image from 2023.06.20 to 2023.07.05 in /.devcontainer (xarray-contrib#193) Add Nebari-specific instructions for SciPy 2023 (xarray-contrib#195) Add contributors image (xarray-contrib#194) Computational pattern tutorial edits (xarray-contrib#186) Housekeeping + clean up sidebar (xarray-contrib#190)
Addresses #166 and adds examples of why you should use these functions instead of loops.