diff --git a/README.md b/README.md index 7e97712..c88408b 100644 --- a/README.md +++ b/README.md @@ -20,9 +20,27 @@ and [quickstart](https://trimagnetix.github.io/nmag-python-3/getting-started/qui ## Installation -From a clone of this repository: +If you only want to run Nmag and do not need the source code, install the +published package in a virtual environment: ```bash +python3 -m venv .venv +.venv/bin/python -m pip install --upgrade pip +.venv/bin/python -m pip install nmag-python-3 +``` + +You can then run a simulation with: + +```bash +.venv/bin/python simulation.py +``` + +To work from the source repository or contribute to Nmag, clone the repository +and use its setup script instead: + +```bash +git clone https://github.com/TriMagnetix/nmag-python-3.git +cd nmag-python-3 ./scripts/setup.sh ``` diff --git a/docs/getting-started/installation.md b/docs/getting-started/installation.md index a27a2b9..81f72e0 100644 --- a/docs/getting-started/installation.md +++ b/docs/getting-started/installation.md @@ -5,9 +5,12 @@ Nmag currently targets Linux and Python 3.10 or newer. A normal installation needs: -- Python, `venv`, and `pip`; -- a C compiler for dependencies without a wheel for your platform; and -- Git to work from the source repository. +- Python, `venv`, and `pip`; and +- a C compiler for dependencies without a wheel for your platform. + +Git is only required if you choose the source checkout setup. The published +package is the simplest option when you want to run Nmag without cloning the +repository. On Ubuntu or Debian: @@ -16,7 +19,27 @@ sudo apt update sudo apt install python3 python3-venv python3-pip build-essential ``` -## Recommended setup +## Install from PyPI + +Create a virtual environment and install the published package: + +```bash +python3 -m venv .venv +.venv/bin/python -m pip install --upgrade pip +.venv/bin/python -m pip install nmag-python-3 +``` + +This installation is sufficient for normal simulations and uses the standard +Python/Numba execution path. The optional native Rust accelerator is available +when installing from a source checkout. + +Run a simulation with: + +```bash +.venv/bin/python simulation.py +``` + +## Install from a source checkout Clone the repository and use its setup script: @@ -43,7 +66,7 @@ source .venv/bin/activate python simulation.py ``` -## Manual setup +## Manual source setup For CI or an existing environment: diff --git a/docs/getting-started/quickstart.md b/docs/getting-started/quickstart.md index 85b4c71..8800d3c 100644 --- a/docs/getting-started/quickstart.md +++ b/docs/getting-started/quickstart.md @@ -11,7 +11,7 @@ well-resolved physical body. --8<-- "docs/examples/quickstart.py" ``` -Run it from an installed checkout: +Run it from an environment where `nmag-python-3` is installed: ```bash .venv/bin/python quickstart.py