PyToDa (Python Tools for the Daily Usage) provides useful tools for the day to day usage with the multi-physics simulation framework 4C and is based on PySkel. Currently the following tools are available:
- An arbitrary unit converter which can be very easily be included in other frameworks.
- A logging framework which can be easily included into other frameworks.
The remaining parts of the readme are structured as follows:
For a quick and easy start an Anaconda/Miniconda environment is highly recommended. Other ways to install PyToDa are possible but here the installation procedure is explained based on a conda install. After installing Anaconda/Miniconda execute the following steps:
- Create a new Anaconda environment based on the
environment.yml
file:
conda env create -f environment.yml
- Activate your newly created environment:
conda activate pytoda
- Install all PyToDa requirements (latest versions) with:
pip install -e .
or install the pinned versions with
pip install -e ."[safe]"
- Now you are up and running 🎉
The following brief tutorials highlight how each tool can be used:
The unit converter can be called with
convert_unit --unit_length "m" --unit_weight "g" --unit_time "s" --quantity "1 bar"
by providing the base units for the target unit system. Finally, the provided quantity will be converted into the target unit system.
The logger can be simply included into any software framework by providing the functions with the necessary arguments. An example for the logger usage can be found within PySkel.
To locally execute the tests and create the html coverage report simply run
pytest
To locally create the documentation from the provided docstrings simply run
pdoc --docformat google --output-dir docs src/pytoda
To ease the dependency update process pip-tools
is utilized. To create the necessary requirements.txt
file simply execute
pip-compile --all-extras --output-file=requirements.txt requirements.in
To upgrade the dependencies simply execute
pip-compile --all-extras --output-file=requirements.txt --upgrade requirements.in
Finally, perforfmance critical packages such as Numpy and Numba are installed via conda to utilize BLAS libraries.
All contributions are welcome. See CONTRIBUTING.md
for more information.
This project is licensed under a MIT license. For further information check LICENSE.md
.