Skip to content
This repository has been archived by the owner on May 15, 2024. It is now read-only.

Latest commit

 

History

History

PythonAPI

The FEDEM python API

This folder contains the sources of the python wrapper for FEDEM, the fedempy package. The source code resides in the sub-folder src/fedempy which is compiled into the python package fedempy by the setup.py script. In addition, some test drivers are placed in the sub-folder PythonAPITests which are invoked as regression/integration tests by the cmake-based build system for the fedem-solvers project.

See here, for the extracted source code documentation of the python code, which is generated using the Sphinx tool. That page also contains some basic installation and end-user documentation for fedempy.

Local build of python package

Run the command

python setup.py sdist

This will create the archive fedempy-<VERSION>.tar.gz where <VERSION> is the content of the file version.txt. To install the built package, use the command:

pip install dist/fedempy-<VERSION>.tar.gz

For doing development on the fedempy package, you may choose to install from the sources in editable mode instead, i.e.,

pip install --editable .

Local build of source code documentation

Run the bash script doc/make.sh to rebuild the html-documentation using the sphinx-build tool. It will generate the html-files in the subfolder doc/build/html.

Static code analysis

You can perform some static code checks locally by running the following commands:

python -m isort --check --diff setup.py src test
python -m black --config=pyproject.toml --check --diff setup.py src test
python -m pylint setup.py src test
python -m mypy --config-file mypy.ini setup.py src test