-
Notifications
You must be signed in to change notification settings - Fork 24
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
Adding a few rof notebooks #126
Conversation
… this, and change from pre-commit reformatting
Hey @nmizukami ! Thanks so much for adding these notebooks! I made those changes we discussed to One note: I think we'll need to provide Would you be able to pull these changes in locally, test running your notebook with |
Hi Teagan (@TeaganKing), The notebook almost ran with You can see /glade/work/mizukami/CUPiD/examples/coupled_model/month_annual_flow.ipynb. cupid prints on screen this:
I have seen this before. I don't fully understand the error, but this is coming from When I ran the notebook outside cupid, it runs fine but I activated hopefully I am simply setting something e.g., environment incorrectly... |
Hi @nmizukami , Sorry I let this slip! In the environment in which this was working, did you have a particular version of This error may be because PROJ is already installed-- I'm not sure where at this point, but can look into that. |
Hi @TeaganKing, some hint is that I can ran outside cupid-run, meaning I can run the notebook manually on jupyterhub with |
It sounds like there may be some issue related to the ipykernel installation. I think one of these might be the installation from ipykernel (a soft linked conda environment) and the other may be a conda environment found elsewhere (possibly an outdated I had updated a test environment but not my actual cupid-analysis environment; I'm doing that now and will test your notebook out. This is probably not the most efficient workflow, but I wonder if it might also be worth removing your cupid-analysis environment, see if it's still listed as an option in JupyterHub, make sure that both versions are removed, and then re-install a clean version? |
I did the following steps to remove cupid-analysis env and reinstall it on terminal.
It did not fix it. After removing cupid-analysis, jupyterhub still showed cupid-analysis, though [conda-env:cupid-analysis] was gone. |
Hi @TeaganKing , trying to run
|
casper-login1:/glade/work/mizukami/CUPiD/examples/coupled_model (main_adding_rof)> cupid-run -rof
|
Hi @TeaganKing, I was able to create /glade/work/mizukami/CUPiD/examples/coupled_model/computed_notebooks/quick-run/_build/html/index.html |
Hi @nmizukami , I'm glad that is temporarily working (but of course we need this to work for any user's environment). Yes, I think this would be a good conversation to have with CISL. Regarding looking at output, see the second section on this page for recommendations on NCAR machines. |
Hey @nmizukami , I added a PR to bring |
To-do:
|
Thanks for clarifying-- the way you are using LocalCluster works! For the notebook names, would these work? Or if you prefer, maybe you could just take out
RE plotting in line-- I think that's fine if the plots show up when observations are available. Since the default is save_figs=False, I think this is reasonable. Did you want to take out the coupled_model config file changes, per our discussion on updating the config file to a similar format as the key_metrics config file? |
Thanks for making these changes, @nmizukami ! These notebook names are clearer now. I also removed the jupyter book build bit for the rof notebooks that are no longer being computed in the coupled model config file. Both notebooks run on the order of 1min now! |
I think the only outstanding comment I'm concerned about is the inclusion of personal directories-- which may need to be pushed to a future issue ticket when we have a more clear location for hosting observational datasets. @mnlevy1981 did you want to take a quick look at this, as well? |
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 spent some time trying to reduce the number of lines in metrics.py
before realizing you never import it.
Also, global_discharge_gauge_compare_obs.ipynb
ran successfully but
- Cell
[14]
(in3.2. Annual cycle (at monthly step)
) is the last cell that produces output; cells 15 - 21 have the%%time
output but no plots or tables - Did some metadata cells get moved around? I see the following sections in order:
3. Analysis for 24 large rivers 3.1 Annual flow series 3.2. Annual cycle (at monthly step) 3.3. scatter plots of monthly flow 3.4. scatter plots of annual flow 4. Anaysis for Large 50 rivers 4.1 Summary tables 4.2. scatter plot of annual mean flow 3. Anaysis for all 922 sites 3.1 Compute metris at all the sites (no plots nor tables) 4.2. Spatial metric map 4.3 Boxplots of Error metrics (RMSE, %bias, and correlation coefficient)
(Maybe the reason I could delete metrics.py
is because the cells that should call those functions aren't being invoked correctly?)
I haven't had a chance to look at colors.py
or utility.py
yet, and if it turns out metrics.py
is supposed to be called I can go look closer to see if more functions can be replaced with existing numpy calls
examples/nblibrary/rof/global_discharge_gauge_compare_obs.ipynb
Outdated
Show resolved
Hide resolved
examples/nblibrary/rof/global_discharge_ocean_compare_obs.ipynb
Outdated
Show resolved
Hide resolved
Thanks for looking at the scripts. Actually it is not imported. I was going to use Cell I put this metrics.py even though they are not used. This computes error metrics, also streamflow metrics (high flow, low flow extreme events etc.), which might be useful (at least use for hydrology, river often). I can leave this out if confusing now, and add it when (if) need later.
Yes, Cell 15 through 21 are skipped if there are no observations available. For this case, the simulation period year 0001 - 0101, so it is outside the time period when observation is available. these cells compute error against observations. in those cells, the second line
Yes, this needs to be updated. But i have been wondering if this is needed?? Also right now each section has a link to the corresponding cell. I don't think the link is not useful here?
utility.py and colors.py are imported (but not all the functions), but metrics.py is not called. So what I could do is to include the functions used only? These scrips are from the scripts I use for my other notebooks, so if these become useful, could be added later. |
I would definitely encourage you to have some markdown cells that describe what plots are being generated. I don't think they need to be organized like a paper with sections and subsections. I hadn't noticed the links from the top of the notebook to each specific section until you mentioned it... let me look at how
Yes, please remove functions that are not being used (and then I'm happy to review whatever is left). One reason to provide modules like |
Ok, I will clean up the scripts (sorry for confusing you.) and the markdown cells. |
Hi @mnlevy1981, I think the scripts are clean now, and fixed the errors you pointed out in the notebooks. Also markdown cells are update. The notebooks still runs ok, though I saw lots of exceptions from the dask distributed. |
"domain_dir = setup[\n", | ||
" \"ancillary_dir\"\n", | ||
"] # ancillary directory including ROF domain, river network data etc.\n", | ||
"geospatial_dir = setup[\"ancillary_dir\"] # including shapefiles etc\n", |
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.
Since geospatial_dir
also appears in setup
, can we rename this variable to ancillary_dir
?
Once the comments regarding ancillary data variable naming and personal directories are resolved, we can merge this. |
Hi @TeaganKing and @mnlevy1981 , I have updated the notebooks and setup.yaml based on your comments. thanks! |
Great, thanks so much @nmizukami ! This looks good to me. I think merging is blocked due to Mike's change request-- @mnlevy1981 can you please check that this addressed your comments as well and then merge this in? |
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 great, thanks for the contribution!
Initial commits for ROF notebooks.
An ultimate set of the notebooks intend to mimic old ROF diagnostic plots
This PR is just starting with a few notebooks.
All Submissions:
pre-commit
check)?New Feature Submissions:
Changes to Core Features: