Clone this repository to get access to the slides and practice problems:
$ git clone https://github.com/esm-tools/pycmor_workshop.git
$ cd pycmor_workshop
$ mkdir work
Make a folder to work in, for example:
$ cd work
During the live workshop, you'll be able to use the QOS --qos=training in DKRZ's HPC, to gain priority in the slurm queue. To benefit from this make sure you add this to your salloc or sbatch commands, or to the #SBATCH headers of the scripts.
- Workshop intro - Slides, Video
- Aims
- Outline
- Pycmor - Slides, Video
- What is Pycmor?
- Main Pycmor features
- Demo: pycmor cli, Video
- Time to resolve installation problems @pgierz
- Have you installed Pycmor inside a conda environment named
pycmoralready? - Can you run
pycmor --helpand other commands? - Maybe you need to upgrade (
pip install --upgrade py-cmor[dev,fesom])
- Have you installed Pycmor inside a conda environment named
- Presentation - Slides, Video
- Exercise: Running a basic pycmor process (text and solutions), Video
- Presentation - Slides, Video
- Exercise: Unit conversion (text and solutions), Video
- Presentation - Slides, Video
- Exercise: File timespan (text and solutions), Video
- Presentation - Slides, Video
- Exercise: Temporal frequency, Video
- Presentation - Slides, Video
- Exercise: Adjust timestamp, Video
- Presentation - Slides, Video
- Exercise: Costumizing your compute resources, Video
- Presentation - Slides, Video
- Exercise: Add a custom step in the pipeline, Video
- Presentation - Slides
- Exercise: Using aux files
- Presentation - Slides
- Exercise: Using pyfesom2 with pycmor
As the data to run the exercises lives on Levante,(DKRZ), we need to setup the Pycmor package on Levante.
The installation is done in 2 steps:
- Create a virtual environment
- Install Pycmor
Note: the exercises assume you have a pycmor conda environment, so make sure when you create the environment that its name matches that.
module load python3
eval "$(conda shell.bash hook)" # Init conda without the need to add extra lines to ~/.bashrc
conda create -n pycmor python=3.10 # Create a conda environment named pycmorconda activate pycmor
pip install --isolated py-cmor[dev,fesom]You can then check the Pycmor works by running:
pycmor --version
pycmor --helpFor additional information, check out the following links
- Creating Virtual environments on Levante: Python environment locations.
- Installing Pycmor: Pycmor documentation.
The Pycmor workshop repository contains scripts to run the exercises.
work="/work/$(id -gn)/$USER"
echo "work directory: $work"
cd $work
git clone https://github.com/esm-tools/pycmor_workshop.git
cd pycmor_workshopThis workshop is designed for ease-of-use if you are working on DKRZ's Levante system. You can access all of the test data here:
/work/ab0995/a270243/pycmor_workshop/exercises/data
If you want to be able to see the files as part of your own repository, you can make a link
pwd # You should be in the root of the repository (`/work/$PROJECT/$USER/pycmor_workshop`)
ln -sv /work/ab0995/a270243/pycmor_workshop/exercises/data ./exercises/dataAlternatively, if you would like to use synthetic data made up of random numbers, but with realistic metadata, dimensions,
and attributes, you can generate some. Make sure you are in the same Python environment as pycmor is installed for this:
make fake-data
ln -sv ./fake-data ./exercises/data