Installation
This page details how to setup a Python virtual environment using uv to install and run AFMSlicer.
Virtual Environment
We recommend using uv to install and manage your virtual environments but you do not have to. Other options such virtualenvwrapper and MiniForge also allow you to create and manage virtual environments but are not covered here.
Install uv
uv has excellent instructions on how to install the software on different operating systems.
Create a Virtual Environment
To create a virtual environment you should create a directory for undertaking
your work, change directory into it and then us uv venv --python 3.11.
NB Because of a performance regression in one of TopoStats dependencies, the package Topoly TopoStats only supports Python 3.10 and 3.11. The developers are aware and are hoping this will be resolved in the near future.
You can now activate the environment and check that your are using the python
binary from that environment.
You should see output similar to the following although the first line will
depend on your operating system and the path where you created the afm_slicing
programme.
If you use direnv to activate virtual environments automatically when
you enter them you can add the following to .envrc to activate the environment
from within the AFMSlicer directory.
PyPI
Currently AFMSlicer has not been packaged and released to PyPi, when this changes instructions will be added.
Development
AFMSlicer is in the early stages of development and as such must be installed from the GitHub repository along with development versions of its dependency TopoStats. The steps involved in installing the development version are described below and require that you install and use uv to set things up.
- Clone the AFMSlicer repository.
- Clone the TopoStats repository.
- Switch to the
ns-rse/1102-switching-to-TopoStats-classbranch on TopoStats. - Activate the virtual environment and synchronise it.
- Install the development version of TopoStats under the virtual environment (this will pull in the AFMReader dependency automatically).
- Install AFMSlicer.