Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand Down
33 changes: 28 additions & 5 deletions docs/getting-started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand All @@ -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:

Expand All @@ -43,7 +66,7 @@ source .venv/bin/activate
python simulation.py
```

## Manual setup
## Manual source setup

For CI or an existing environment:

Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading