Go in your terminal to the folder where you want to clone the repo and run
git clone https://github.com/hbeukers/simulation-tutorial.gitTo use this repo you need uv installed.
Go to the repo folder and run
uv syncDepending 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 labThe repo was set up using the following commands:
Go to the folder were you have your repositories
uv init simulation-tutorial --libTo 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 --devChange python version
uv python pin 3.13
uv syncAdd 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 formatand lint using
uv run ruff check