-
Notifications
You must be signed in to change notification settings - Fork 51
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
New python kernels silently give different results in Cross-contour_transport.ipynb
#327
Comments
Is it possible to tell which step of the code changed? i.e. at which point do the answers diverge? |
And does someone have the list of which packages changed between |
Are you getting any new warnings? My guess is there is some change in masking or handing of NaNs. @adele-morrison : EDIT: Diff for 23.04 to 23.07: |
Sorry, I just looked into it again. The change happened between @anton-seaice There is no warning using the newer kernels except for one on chunking affecting performance. |
Hi @schmidt-christina, @anton-seaice . The only major issue I'm aware of between those two revisions is the change in default chunking that affects the ERA5 data set. I've not seen that change any numerical output, just how long it takes to get there. Would be interesting to look into, which notebook is it? |
Probably easiest to test in the notebook Hannah created when she came across this issue (it's a condensed version of the notebook Adele pointed to with only the necessary code for the selection of T/S on the contour and binning into density classes), but it won't allow me to upload it here. Should I send it via email @dsroberts ? |
@schmidt-christina, nice instructions here from @aidanheerdegen on how to share code: Maybe others can help also if we can make it public. |
I uploaded the notebook here |
Good catch @schmidt-christina and thanks for raising this issue! This is quite alarming tbh that something would silently start giving different results! Could you confirm that you don't have any warnings imposed to be silent (sometimes we do that in the beginning because warnings can overwhelm us -- I know I do at least!)? |
I think we should post this in the forum -- others might be getting strange results? I was also getting different results in #322 but I (thought I) was convinced it was because the methods for computing meridional heat transport depend on the reference temperature used. I will revisit the PR with this in mind and try using an older conda env.... |
Cross-contour_transport.ipynb
This issue has been mentioned on ACCESS Hive Community Forum. There might be relevant details there: |
@schmidt-christina (or @salvajoe, @willaguiar, @hrsdawson), it would be extremely useful if you could strip down the notebook to what we call Minimal Working Example (MWE). That is, the minimum code for which the problem arises using kernel A and not for kernel B. The notebook at the moment has a lot of things -- are all of them needed to showcase the problem? Perhaps they are, I don't know. If they are then leave them! [Usually this process of stripping down to a minimal working example helps a lot pin-pointing the issue and, sometimes, even finding the solution!] I know I'm asking you to do work but could you please? This seems an important issue. Results that change silently after upgrading packages are very very sneaky and insidious and could result for a lot of struggles by some others who could be probably thinking "oh.. this must be my fault for not getting it right...". Or this could result to publishing wrong results! On another note. What do lines: import logging
logging.captureWarnings(True)
logging.getLogger('py.warnings').setLevel(logging.ERROR) do? Do they suppress warnings? If we remove them do you get any meaningful warning perhaps? |
All of the calculations in the notebook are needed (transport across an isobath binned into density classes is quite a long and complicated calculation). calculations are only done for one kernel and then we just load data saved from my 2023 study to compare against.
I tested that and removed the lines, but still no additional warnings. |
thanks @schmidt-christina for checking! thanks @dsroberts for figuring out -- holding onto my chair for the what else might this investigation bring about and the end of the episode with |
Nice! |
Omg. Excellent detective work |
Nice work @dsroberts !! |
So I've dug a little further and tried to make a reproducer, and it turns out that
And it does, the
In the first cell of @schmidt-christina's notebook causes that warning to appear in a few places. Given this, I think the best place to raise an issue would be over on the COSMIA cookbook repo, as
and is a more appropriate solution than using |
@schmidt-christina would you like to open a PR to fix this example? |
@adele-morrison I'm hoping we fix this before the hackathon; this is quite urgent. At the moment we have online an example that silently gives wrong results and we are potentially creating nightmares for people. @dsroberts did an amazing detective job upstairs figuring the issue out could someone open a PR and fix the example? |
Even a PR that simply deletes the example is better than having something there which is wrong and makes people loose sleep or potentially deteriorates mental health... If nobody has the capacity to fix it I can open a PR to delete the example and whenever we have the capacity we can put it back corrected. |
Hmmm, this seems a little drastic. What about a PR that says |
A caveat message is also a good solution! And if we do that, then we can also link to this issue. (Deleting doesn't mean much... the notebooks always stay in the Github history! We just don't want this to be advertised as an example that we present to people as "working out of the box" so that they take on and modify to continue their work.) |
@anton-seaice shall we raise a new issue? |
I don't mind, but it would "hopefully" get fixed in the same PR so I wouldn't ? |
When using a kernel newer than
analyis3-23.04
, the cross contour transport calculated in this notebook is wrong (see black line compared to blue line where kernelanalyis3-23.04
was used).If anyone is keen to look into what has changed in the new python versions and packages that changes the results, that would be great and please assign yourself. Otherwise I will add a sentence about which kernel to use at the top of the notebook for now and look into it during the COSIMA hackathon.
edit: changed kernel from
analysis3-22.07
toanalysis3-23.04
The text was updated successfully, but these errors were encountered: