Closed erialC-P closed 2 months ago
Check out this pull request on
See visual diffs & provide feedback on Jupyter Notebooks.
Powered by ReviewNB
View / edit / reply to this conversation on ReviewNB
robbibt commented on 2024-08-13T03:33:26Z ----------------------------------------------------------------
Line #4. !pip install sunriset
Is this necessary? It should be installed when we install Intertidal (it's included in the setup.py and requirements.in)
You're right. This was legacy code. Deleted :)
_erialC-P commented on 2024-08-19T03:30:52Z_ ----------------------------------------------------------------Actually...with a fresh kernel, it turns out that I did need to keep this line. I wonder if it's because it's a non-standard package...?
View / edit / reply to this conversation on ReviewNB
robbibt commented on 2024-08-13T03:33:27Z ----------------------------------------------------------------
Line #8. HTML("Jupyter.notebook.kernel.restart()")
What is this for?
On further testing, it's totally redundant as it doesn't work. I was trying to automatically restart the kernel following the pip install. Will test whether a restart is even required.
View / edit / reply to this conversation on ReviewNB
robbibt commented on 2024-08-13T03:33:27Z ----------------------------------------------------------------
Line #2. %cd ../Supplementary_data/Customising_intertidal_exposure
I'd probably avoid doing this, and instead update the output paths where you export results (e.g. add "../Supplementary_data/..." to the output paths).
I'm torn about whether we just want to save those outputs directly in "Real_world_examples", or in that "Supplementary_data" folder instead. The second option is probably cleaner but not something we've done before in other notebooks...
good point. I've removed that line and updated figure outputs into the R_W_E folder
View / edit / reply to this conversation on ReviewNB
robbibt commented on 2024-08-13T03:33:28Z ----------------------------------------------------------------
"Load data"
(some headings use "All Starting Capitals" and others use "Just the first capital" - should standardise for consistency with other notebooks.
erialC-P commented on 2024-08-15T02:00:30Z ----------------------------------------------------------------
fixed :)
View / edit / reply to this conversation on ReviewNB
robbibt commented on 2024-08-13T03:33:29Z ----------------------------------------------------------------
Line #3. ds = dc.load(product="ga_s2ls_intertidal_cyear_3", **query_params)
Do we need to load all DEA Intertidal layers here? Or could we just load "elevation" and "exposure"? If so, that could improve load times quite a bit
great suggestion!
View / edit / reply to this conversation on ReviewNB
robbibt commented on 2024-08-13T03:33:29Z ----------------------------------------------------------------
Line #16. # Add the geomad data layers into the master dataset
I'd be tempted to leave these as separate datasets, just easier to manage that way
Done :)
View / edit / reply to this conversation on ReviewNB
robbibt commented on 2024-08-13T03:33:30Z ----------------------------------------------------------------
Line #45. path = '/home/jovyan/dea_intertidal/dea-intertidal'
This points to your copy of the DEA Intertidal repo which users running this notebook won't have access to. We should use a relative link here so that the data gets saved next to or near this notebook (e.g. inside "Real_world_examples", or "Supplementary_data")
Yep - since found that little bug too. Updated to os.getcwd() which should set all figure outputs to the R_W_E folder alongside the notebook
View / edit / reply to this conversation on ReviewNB
robbibt commented on 2024-08-13T03:33:31Z ----------------------------------------------------------------
Line #59. Image(gif_path)
I do think this code block would be a natural candidate for a function that we could call from dea_tools.coastal
! Would help hide away a fair bit of code and led to a simpler user experience, as well as providing a nice tool that could be run in different locations too. But we could always do that down the track.
Yeah, definitely open to that! Wasn't sure if this figure style was a bit niche to this application but a func would allow it to be very customisable!
View / edit / reply to this conversation on ReviewNB
robbibt commented on 2024-08-13T03:33:31Z ----------------------------------------------------------------
Line #14. modelled_freq = '30 min',
If this notebook takes a while to run, I would be very tempted to reduce this to something far less short - e.g. "3 h" perhaps. You could add this as a parameter up top, and add an explanatory note that we're using a low frequency for demonstration purposes, but for real analyses you'd use something shorter
Yep! I agree that this is a good idea. Testing with a 2 H frequency gives results consistent with the notebook narrative so I'll reduce the frequency and add a note above with advice about freq selection.
View / edit / reply to this conversation on ReviewNB
robbibt commented on 2024-08-13T03:33:32Z ----------------------------------------------------------------
Line #15. modelled_freq = '30 min',
Same comment here - I reckon use a longer freq as the default, but allow the user to change this once they've run the notebook for the first time
View / edit / reply to this conversation on ReviewNB
robbibt commented on 2024-08-13T03:33:33Z ----------------------------------------------------------------
Line #36. exp_counts = {"Exp >= 70%": (np.array(exp70_100)),#*0.0001,
Are these code comments meant to be here?
Nope! More legacy code :D
View / edit / reply to this conversation on ReviewNB
robbibt commented on 2024-08-13T03:33:33Z ----------------------------------------------------------------
Line #81. plt.show()
This figure is so cool!
Thanks! It tells a pretty cool story :)
@erialC-P I've just done a quick skim through for now, but this is fantastic... feels almost like an interactive/runnable version of a scientific paper, which is really neat and perfect for a Real world example I think! 🤩
I've suggested some small changes - I might jump into the branch and make some minor code suggestions at a later point too. For now, my only "more general" comment would be to go through and run either Black or YAPF code formatting on all the code cells so everything is nice and consistent - I think some got missed earlier.
On further testing, it's totally redundant as it doesn't work. I was trying to automatically restart the kernel following the pip install. Will test whether a restart is even required.
View entire conversation on ReviewNB
good point. I've removed that line and updated figure outputs into the R_W_E folder
View entire conversation on ReviewNB
Yep - since found that little bug too. Updated to os.getcwd() which should set all figure outputs to the R_W_E folder alongside the notebook
View entire conversation on ReviewNB
Yeah, definitely open to that! Wasn't sure if this figure style was a bit niche to this application but a func would allow it to be very customisable!
View entire conversation on ReviewNB
Yep! I agree that this is a good idea. Testing with a 2 H frequency gives results consistent with the notebook narrative so I'll reduce the frequency and add a note above with advice about freq selection.
View entire conversation on ReviewNB
Actually...with a fresh kernel, it turns out that I did need to keep this line. I wonder if it's because it's a non-standard package...?
View entire conversation on ReviewNB
Proposed changes
This PR adds a new notebook to the Real_world_examples suite and demonstrates customisation options that are available when undertaking intertidal exposure analysis. The notebook is a bit slow to run in some places, with the whole runtime being approximately 6 - 10 minutes. Much of this speed is accounted for in the use of the exposure function which runs very high resolution tidal modelling in the background. However, some of the lagginess may be related to the use of animations/gifs in the notebook.
Checklist
(Replace
[ ]
with[x]
to check off)Load packages
General advice
)jupyterlab_code_formatter
tool can be used to format code cells to a consistent style: select each code cell, then clickEdit
and then one of theApply X Formatter
options (YAPF
orBlack
are recommended).NCI
andDEA Sandbox
(flag if not working as part of PR and ask for help to solve if needed)Notebook currently compatible with the NCI|DEA Sandbox environment only
line below the notebook title to reflect the environments the notebook is compatible with