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

Update PyPRECIS tutorials to latest Iris release and ensure runs from conda env #97

Closed nhsavage closed 2 years ago

nhsavage commented 2 years ago

As part of the international training work, we need to start by testing if we can make the existing notebooks work under a conda environment instead of scitools. At present this will still be at Iris 2.2.0. A later version will update this to Iris 3

nhsavage commented 2 years ago

f7b27bf makes an environment file that runs worksheet 1 on VDI and fixes some typos in makedata.py

hsteptoe commented 2 years ago

Consider creating a conda lock file base on the requirements yml. This would provide a more platform-specific robust environment, with pre-solved packages. More details https://github.com/conda-incubator/conda-lock

nhsavage commented 2 years ago

Consider creating a conda lock file base on the requirements yml. This would provide a more platform-specific robust environment, with pre-solved packages. More details https://github.com/conda-incubator/conda-lock

Thanks for that suggestion. I am struggling with conflicting advice on this one - while a lock file makes the environment more robust, it harms portability because it adds platform specific stuff. If the aim is that we can run this on multiple platforms, we may need a middle way where we lock down the version of all packages imported explicitly as well as ones needed to "make it work properly" e.g. dask and mo-pp (which were real stumbling blocks here)

nhsavage commented 2 years ago

Worksheet 4 failing in timesries plotting with IrisError: Cannot plot against time in a non-gregorian calendar, because "nc_time_axis" is not available : Install the package from https://github.com/SciTools/nc-time-axis to enable this usage.

nhsavage commented 2 years ago

Worksheet 4 failing in timesries plotting with IrisError: Cannot plot against time in a non-gregorian calendar, because "nc_time_axis" is not available : Install the package from https://github.com/SciTools/nc-time-axis to enable this usage.

this has been fixed by adding the extra dependency nc_time_axis to the enviroment. However. the line plots are now failing with an error related to the netCDF time axis

Worksheet 5 is failing at

diff_mod_obs = model_baseline_rg - obs

with

NotYetImplementedError: Cannot use 'subtract' with differing units (% & 1)

nhsavage commented 2 years ago

now added latest version of environment and lock files and checked all notebooks work