-
Notifications
You must be signed in to change notification settings - Fork 66
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
Created neutral density example notebook #417
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
@@ -0,0 +1,790 @@ | |||
{ |
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.
Please add in the method's doc that it also slices the data to a particular region?
Reply via ReviewNB
@@ -0,0 +1,790 @@ | |||
{ |
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.
Could we then have another example after the plots to do the same with 'mom6'
output?
Reply via ReviewNB
@@ -0,0 +1,790 @@ | |||
{ |
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.
Line #10. gamma[time_step,:,:,longitude] = gamma_XT
Spaces after commas please :)
Reply via ReviewNB
@@ -0,0 +1,790 @@ | |||
{ |
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.
Line #11. # Print the time_step so the impatients know how much is left to do
But how do the impatients know how how many time steps are there? perhaps print(100*time_step/T, "% done")
or something?
Reply via ReviewNB
@@ -0,0 +1,790 @@ | |||
{ |
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.
Instead of python comments, could we have markdown explanations before the code cell?
(That's a general comment, not only for this cell!)
Reply via ReviewNB
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.
Thanks for this @julia-neme! I added few comments!
Done this fixes, but might wait until I get access to |
We'll put |
The issue is linked -- never mind! |
@@ -0,0 +1,790 @@ | |||
{ |
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.
Line #1. t, s = load_temp_salt('mom5')
Can we use T, S for temperature and salinity? t is often used for time....
Reply via ReviewNB
… to install pygamma since it will be incorporated to conda environments
I don't know how/why I've closed this pull request. To finish the notebook I need to choose between:
|
I would stick with the cookbook until we have a MOM6 run in the catalogue (i.e. ACCESS-NRI/access-nri-intake-catalog#175) |
It looks like you deleted/renamed the "master" branch in your fork @julia-neme ? I guess you were doing this to try and get your fork up to date. Because the PR is trying to merge into COSIMA:main from julia-neme:master this has had the side-effect of closing the pull request (I assume) because julia-neme:master doesn't exist anymore. You can either make a new branch in your fork called 'master' (using commit 0193c90) and then we can reopen this PR. Or make a new branch from that commit but that would need a new PR. |
Thanks a lot Anton!! |
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.
added couple of comments via ReviewNB
@julia-neme this notebook needs ~1hr to run???? |
Could we make it shorter? It's only an example -- doesn't need to be publication ready... |
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.
Looks good to me (but I haven't approved yet because I need to run it and it takes forever!!!!)
Could we make this notebook run faster, e.g., by loading less data?
There are two nested-for
loops which are a huuuuuuge hit to performance and not xarray-friendly. Is this a restriction of pygamma_n
? Perhaps xarray.apply_ufunc
could come to the rescue here??
@jemmajeffree is this an case where I'm referring to the cells that do for time_step in range(0, Nt):
for longitude in range(0, Nx):
do_stuff() that make this notebook really really slow... |
Yes! absolutely, it looks like a perfect example. I'll try and get to it in the next week Can anyone at ANU walk me though how to make changes within the pull request? (this is the main thing I've been avoiding with regards to fixing up the apply_ufuncs example, sorry) Something to note: I can probably speed it up (don't know by how much until I poke it), but it will come at a cost of less intuitive and readable code. How much do we/this repo value each of these two priorities? |
You can look how to review here After making the changes I think you can push back your modifications into here. I'm having a go at parallelising this. It's running in 1min now, so I guess that's good enough? Parallelising is also very readable, just one line of code. |
@jemmajeffree just make changes and commit to that branch and push and your PR will be updated I can help you via zoom despite you requested for ANU-onsite help above ;) |
1min???? |
Yep! Do we still want the ufuncs or the parallelisation? |
I'm happy to approve something that runs in 1min... But I haven't seen anything pushed... :) |
I don't know how to integrate the "tweaks" you've pushed jaja. Trying to figure that out. Without loosing my updates |
I can help you with that ;) |
FYI: I did made a few changes in the |
It's a balance... I'd say a 1.5x-2x speedup in the cost of less intuitive-readable code is not really worth it. But a 30x or 100x speedup it worths it! |
If you can parallelise without ufuncs do that. apply_ufuncs is a way of parallelising functions that refuse to do so natively, but you're better off with parallelising within a function if it supports it |
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.
this is great!
I think it's cleaner done with I suggest opening an issue and pointing to this notebook saying that parallelization could be done via |
@julia-neme you may merge this whenever you feel like it! |
This notebook still uses the cookbook, and could be parallelised for efficiency (but I don't know how to do the latter).