Go in your terminal to the folder where you want to clone the repo and run
git clone https://github.com/hbeukers/simulation-tutorial.git
To use this repo you need uv
installed.
Go to the repo folder and run
uv sync
Depending on the availability of the packages on your platform it might need some time to build, just let it run.
This should be enough to set everything up, including all packages and python version.
Use one of the following methods to run the notebooks in the notebooks
folder:
Install the Jupyter extension. Open the notebook in VS Code and select as kernel .venv
. Now you can run the notebooks in VS Code.
You can also start a Jupyter server in the more traditional way by working in the browser. Run the following command in the folder of the repository.
uv run jupyter lab
The repo was set up using the following commands:
Go to the folder were you have your repositories
uv init simulation-tutorial --lib
To install the wanted packages
uv add xarray[io, parallel, viz]
uv add multiprocess
uv add tqdm
uv add jupyter
uv add qutip
uv add lmfit
uv add ruff --dev
Change python version
uv python pin 3.13
uv sync
Add the following lines to pyproject.toml
such that the project becomes an editable install and we can import modules from our own repository.
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["src/simulation_tutorial"]
Add the following lines to pyproject.toml
to make sure ruff
also formats jupyter notebooks, directly fixes linting issues and also sorts the imports
[tool.ruff]
extend-include = ["*.ipynb"]
fix = true
[tool.ruff.lint]
extend-select = ["I"]
You can format the code with
uv run ruff format
and lint using
uv run ruff check