OGGM / tutorials

Notebook tutorials for the Open Global Glacier Model (OGGM)
https://tutorials.oggm.org
BSD 3-Clause "New" or "Revised" License
18 stars 18 forks source link

added warning on beginner tutorials about utils.mkdir if reset=True #47

Closed lilianschuster closed 2 years ago

lilianschuster commented 2 years ago

In the tutorials, the working_dir is often created via utils.mkdir(...., reset=True). When people use this on folders with other data, the content of the folder can get removed. To at least warn the users, I added the following to the beginner tutorials (once in the text in getting_started.ipynb when the working_dir gets introduced and as code comment on the other notebooks):

Attention: if you use reset=True together with utils.mkdir(path_to_folder, reset=True) when you define the working_dir, all files of that folder (also those not created by OGGM) are removed or overwritten. So, only use reset=True if you have e.g. a temporary directory or if you are sure that the entire content of that folder can be removed!

Thanks to Kim Cholibois for reporting this issue!

review-notebook-app[bot] commented 2 years ago

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

fmaussion commented 2 years ago

Thanks @lilianschuster !

Actually, I think we should remove reset=True from all notebooks except maybe one or two occurrences (to show that it exists). What do you think?

Where we keep it you can shorten the text a bit:

 Beware! If you use `reset=True` in `utils.mkdir`, ALL DATA in this folder will be deleted!
 Use with caution!