Install and check the environment

Before starting a calculation, create an environment in which its software dependencies can be installed and recorded together. FLODI requires Python 3.10 or newer, NumPy, and SciPy; using a virtual environment keeps those packages separate from other projects and makes the setup easier to reproduce. From your project directory, create and activate it with:

python3 -m venv .venv
source .venv/bin/activate

These commands use a Unix shell, including Linux, macOS, or WSL on Windows. In Windows PowerShell use python -m venv .venv and activate with .venv\Scripts\Activate.ps1. The assignment’s setup section explains the recommended working environment.

Install the package

For a published release, install from PyPI:

python -m pip install flodi

If you are developing the library, install from a checkout instead:

git clone https://github.com/ifilot/flodi.git
cd flodi
python -m pip install .

Use the same activated environment to install packages and run scripts. If you use an editor, select that environment’s Python interpreter there as well.

Plotting dependencies

The integration, derivative, Poisson, and finite-ball example scripts use Matplotlib for their plots. Install it in the same environment when you want to run those examples:

python -m pip install matplotlib

The core field operations work without Matplotlib, so you can run the quickstart before installing plotting dependencies.

Check an import before a long calculation

python -c "from flodi import RadialGrid; print(RadialGrid.uniform(n_r=20, r_max=5).shape)"

The command constructs a radial grid and prints its shape, (20,), confirming that this interpreter can import the package. You can then save Your first fields as a plain Python script and run it in a fresh terminal process. Keeping its outputs in an ordinary directory makes the resulting figures easier to find and reproduce independently of editor state or notebook execution order.

Record the environment

Save the package versions with the settings used for a result:

python -m pip show flodi numpy scipy matplotlib

Your own repository should document installation and the commands needed to reproduce your runs. If an editor behaves differently from the terminal, check that both use the Python interpreter from this environment.