Installation#
The package requires Python 3.12 or newer. The installation of motulator and its dependencies is described in the documentation of motulator; motulator and PyTorch are installed automatically as dependencies of this package. The package supports motulator 0.15 and 0.16, and the support is extended after each new release of motulator has been tested.
The PyTorch wheels on PyPI for Linux include CUDA support and are large. The small networks of this package are trained in a reasonable time on a CPU, so a CPU-only build is sufficient. It is installed before the package with the command:
pip install --index-url https://download.pytorch.org/whl/cpu torch
Option 1: Use pip#
The simplest way to install the package is to use pip:
pip install motulator-gradnet
Note
Instead of global installation described above, using a virtual environment is generally recommended.
Option 2: Clone the Repository#
For developers and advanced users, cloning the repository is recommended. The following instructions are for VS Code:
Install VS Code, Python, and
giton your computer. Install also the recommended extensions in VS Code.Clone the project using the command:
git clone https://github.com/Aalto-Electric-Drives/motulator-gradnet
Launch VS Code from the cloned project’s root directory.
Create a virtual environment in the workspace.
Install the package with its optional dependencies in the VS Code terminal, after the virtual environment is created and activated:
pip install -e .[dev,doc]
The
devdependencies are needed for the tests and the code checks and thedocdependencies for building this documentation.Now you can run the example scripts in the
examples/folder.
The tests are run with pytest and the documentation is built with the command:
sphinx-build -b html docs/source docs/build/html