Skip to content

Running the notebooks

There are notebooks in the examples/notebooks directory.

In order to run them, first you should clone the repository using git:

$ git clone https://github.com/VilmaLab/apitofsim.git
$ cd apitofsim/examples/notebooks

These notebooks explore some of the internals of apitofsim.

  • gas-cluster-collision-sampler.py: This notebook plots the distribution of collision angle and normal velocity of the cluster and the gas, shows how the rejection sampler works, and compares it to other sampling methods.
  • dos.py: This compares different algorithms for computing the density of states (DOS) of a cluster in apitofsim.

Running the notebooks with Mamba

The recommended way to run the notebooks is using Mamba. This will use a version of apitofsim from a package.

First install miniforge according to the instructions. Then create the environment:

 $ mamba create -p ./cenv -f env.yaml

Then you can run a notebook using:

 $ mamba run -p ./cenv marimo run gas-cluster-collision-sampler.py

Running the notebooks with UV

You can also install the requirements for the notebooks with uv. This will compile and use the version of apitofsim you have checked out.

First install uv according to the instructions.

Assuming you have clone apitofsim and are in the root directory:

 $ uv sync --all-groups

You can then run a notebook using:

 $ uv run marimo edit gas-cluster-collision-sampler.py