Installation

The package has been tested on:

  • Linux

  • OSX (ARM & Intel)

  • Windows

If you are encountering issues with the installation, installing from the source should help. If you are still having issues, please refer to the FAQ or raise an issue on the GitHub repository.

Installing with pip

Installing physo from PyPI :

pip install physo

Installing with conda

Installing physo using conda:

conda install -c conda-forge physo

Source Install

Virtual environment

To install the package it is recommended to first create a conda virtual environment:

conda create -n PhySO python=3.12 --yes

Supporting Python 3.8 - 3.12; other versions may also work.

And activate it:

conda activate PhySO

Downloading

physo can be downloaded using git:

git clone https://github.com/WassimTenachi/PhySO

Or by direct downloading a zip of the repository: here

Dependencies

From the repository root:

Installing dependencies :

conda install --file requirements.txt

In order to simplify the installation process, physo has very few and standard dependencies, which are listed in the requirements.txt file.


Without Conda (Alternative) :

If you are unable to use conda or prefer to use another environment manager, you can install the dependencies manually using pip:

pip install --no-index --upgrade pip
pip install torch >= 1.11.0
pip install numpy
pip install sympy
pip install pandas
pip install matplotlib
pip install scikit-learn

This approach is especially useful on some HPC systems, see the HPC installation guide.



NOTE : physo supports CUDA but it should be noted that since the bottleneck of the code is free constant optimization, using CUDA (even on a very high-end GPU) does not improve performances over a CPU and tends to actually hinder performances.


Installing PhySO

Installing physo to the environment (from the repository root):

python -m pip install -e . --no-deps

Testing install

Import test:

python3
>>> import physo

This should result in physo being successfully imported.

Unit tests:

Running all unit tests except parallel mode ones (from the repository root):

python -m unittest discover -p "*UnitTest.py"

This should result in all tests being successfully passed.

Running all unit tests (from the repository root):

python -m unittest discover -p "*Test.py"

This should take 5-15 min depending on your system (as if you have a lot of CPU cores, it will take longer to make the efficiency curves).

HPC & Compute Canada users

If you are using physo on an HPC such as Compute Canada, follow the steps below.

First, connect to the cluster (e.g., Narval, Beluga) and load one of the modules available for Python (module avail python) on your HPC, e.g.:

module load python/3.10.13

Then, create and activate a virtual environment for physo:

virtualenv --no-download PhySO
source PhySO/bin/activate

Install the required dependencies:

pip install --no-index --upgrade pip
pip install torch >= 1.11.0
pip install numpy
pip install sympy
pip install pandas
pip install matplotlib
pip install scikit-learn

Finally, download and install physo:

git clone https://github.com/WassimTenachi/PhySO
python -m pip install -e . --no-deps

Uninstalling

Uninstalling the package:

pip uninstall physo

Removing the conda environment (if you created one):

conda deactivate
conda env remove -n PhySO