MetOffice / PyPRECIS

PyPRECIS is the python based training environment for Met Office PRECIS training courses.
BSD 3-Clause "New" or "Revised" License
20 stars 2 forks source link

follow approach of scitools/iris course for examples #141

Open nhsavage opened 2 years ago

nhsavage commented 2 years ago

In the scitools courses e.g. https://github.com/SciTools/courses/blob/master/course_content/iris_course/1.The_Iris_Cube.ipynb

the approach is to put each example in it's own file, and then include a way to load it inside the relevant worksheet using:

SAMPLE SOLUTION: Un-comment and execute the following, to view a possible solution, and some code. Then run it ...

# SAMPLE SOLUTION
# %load solutions/iris_exercise_1.2a

this has two advantages:

  1. it makes it easier for the user to access the relevant answers
  2. it make it easier to test (no need to cut and paste the solutions in)