Assignment 4: Project templates#

Introduction#

In this assignment, you convert the code of your previous assignment into the structure of the project templates.

To avoid disappointments, here are a few rules for all tasks:

  1. All previous comments about git, docstrings, side-effects, file-paths and generated files under version control remain valid for this assignment.

  2. Before you submit, it is a good idea to remove the bld folder once and make sure that the project runs through.

  3. You have to work in the pixi environment that is created by the project templates. If you need libraries that are not in the environment, you need to add them to pyproject.toml.

The deadline is 13 January, 11:59 pm#

Task 1#

Check that your system satisfies the necessary prerequisites for the templates. Note that with the possible exception of LaTeX, this should be the case. Also make sure to be in a folder without spaces.

Create your exercise repository by following this link

Accept the assignment, create the repository, and clone it to your computer.

Task 2#

This task should only be done by one group member!

Follow the steps outlined in the Customising the template for your needs, Section “Renaming the project”.

Once you’ve done this, commit your changes and push them.

Task 3#

Now all team members (except for the one who did the previous task) can clone the exercise repository and run the project.

Go to the Running the project section of the documentation and follow the instructions.

If you have issues due to LaTeX, make sure you have a modern distribution installed and that your installation paths are valid.

Note

Important!!!

  1. Do not change and/or commit any files during this step.

  2. Do not continue with any other task until the entire project can be built without errors for all members of your group.

Task 4#

From here onwards, you are back in the normal Git workflow.

Follow the instructions in the documentation on how to customise the template for your project.

Task 5#

Read the section on Porting an existing project of the documentation, but do not follow the instructions yet. Apply the strategy when working on the next tasks.

Task 6#

Transfer all code from your data management assignment (assignment 2) to your project and convert the structure such that pytask runs everything that needs to be run.

Task 7#

Transfer all code from your Monte Carlo assignment (assignment 3, including the tests) to your project and convert the structure such that pytask runs everything that needs to be run.

Task 8#

Make sure that paths to the most commonly used directories are only defined once in the config file. They should be imported from there whenever they are needed.

Make sure to specify all dependencies and products of your tasks. It is possible to have pytask projects that run without error but still have missing dependencies. This could then produce errors when they are run on larger or faster machines. It also means that you may make wrong assumptions about what code a set of results is based on. E.g., an intermediate step might not be executed even though it should be because pytask does not know about a dependency which has changed.

Task 9#

Make sure that all long-running tasks (e.g. the Monte Carlo simulation) are separated from other tasks that depend on them (e.g. plotting).