DP0: how to get a fresh copy of tutorial notebooks?

Hi, apologies if that’s documented somewhere already, I couldn’t find info about it…
But how would I obtain a fresh copy of the most current tutorial NBs, while logged into the JupyterLab NB aspect of RSP? Can I git clone from somewhere, is there another mechanism?
(To clarify: say I’ve edited myself into some broken state in one of the NBs in /notebooks/tutorial-notebooks/, how do I start from scratch?)

Thank you!

Hi! I got to a similar situation and solved it this way:

  1. go to terminal inside jupyter lab and go to notebooks directory
  2. git restore 01_Intro_to_DP0_Notebooks.ipynb; git pull

I hope it helps =)

1 Like

Hi @JuliaGschwend Thank you! Before I try: this will overwrite my changes I guess? (I better make some copies…)

Thanks @rnikutta for the question and @JuliaGschwend’s suggestion of using the git restore command should fix things for you.

I encountered a similar error recently and documented the solutions in this GitHub Issue thread, which might also be of use to you here. It includes instructions for how to keep your changes.

1 Like

Thank you @MelissaGraham !
In the meantime I also figured out how to just get the latest and freshest copy into a new directory:

mkdir my
cd my
git clone https://github.com/rubin-dp0/tutorial-notebooks

And now I can navigate in JupyterLab to my/tutorial-notebooks/ and work there. (I’m sure this is documented somewhere, just that I couldn’t find it…)

Thank you!

That will get you a new, additional copy of the tutorial-notebooks, yes, but git clone into a new directory is not the preferred method in this case. The tutorials in your my/tutorial-notebooks/ directory will not automatically be updated when we release new versions or new notebooks to the prod branch, like the ones in your /notebooks/tutorial-notebooks/ directory will be. Since the DP0-era RSP is in active development, such updates might happen on weeks-to-months timescales.

This git clone option is fine so long as those details are understood, though! And probably you’ll still want to do the git restore method in your /notebooks/tutorial-notebooks/to undo the broken states of those notebooks.

Absolutely, will restore, and will always consider the version in /notebooks/tutorial-notebooks/ as the truth state. Thank you.

1 Like