This project is a simple exemplar demonstration of usage of the unit-static-analyser in a scientific code base.
It is recommended you create and activate a standalone virtual environment then run:
pip install -r requirements.txt
unit-static-analyser ./moldynThis should simply show no errors were detected. To see the units discovered within the code base you can run:
unit-static-analyser -u ./moldynUnits are declared in the codebase via type aliases in moldyn/unit_types.py.
These are imported in moldyn/md_engine.py and applied as typical type hints. Running
unit-static-analyser tracks the units associated with different variables and checks
for correct usage. For more detail see unit-static-analyser.
To experiment, try changing some of the unit strings defined in unit_types.py and see
the errors generated when the tool is run.