Project structure#

The Code Shelf project consists of several repositories that are all part of the Code Shelf group on GitLab:

Any members can contribute to the shelves to add and update submissions. These submissions are then annotated with additional metadata and copied to the ‘deploy’ repository when they are ready for use. Deployment must be started manually. See the dedicated deployment page for more information.

Repository layout#

Shelves#

Each shelf contains the following essential files:

File / folder

Purpose

notebooks/

Folder with submitted Jupyter notebooks.

scripts/

Folder with submitted Python scripts.

templates/

Folder with submitted Jupyter notebook templates for use with SciCat’s Jupyter Generator through SciWyrm.

pyproject.toml

Configuration of the shelf and analysis tools. Contains a [tool.code-shelf] table

pixi.toml

Configuration of Python environments

This structure is defined by the Code Shelf template.

pyproject.toml lacks a [build-system] table, meaning that the shelves are not Python packages that could be installed with pip or other package managers. Rather, they are collections of code that can be copied out of the repository directly or deployed to the deploy repository.

Deployment repository#

The deployment repository has a similar structure to the shelves but contains subfolders in notebooks/, etc.:

File / folder

Purpose

notebooks/<instrument>/

Folders with Jupyter notebooks for each instrument.

scripts/<instrument>/

Folders with Python scripts for each instrument.

templates/<instrument>/

Folders with Jupyter notebook templates for each instrument.

.code-shelf-deployment

Empty marker file to indicate that this folder is a deployment repository. Used by Bibliotekar.

The deploy repository does not contain a pyprpoject.toml or pixi.toml file because any code committed to it must have been vetted before. No automated tests are run on the deployment repo.

Bibliotekar#

Bibliotekar is a regular Python package with src-layout and a pyproject.toml file. It is managed with Pixi and the Pixi configuration is stored in pyproject.toml.