Skip to content

cc-a/unit_analysis_demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unit Static Analyser Molecular Dynamics Demo Project

This project is a simple exemplar demonstration of usage of the unit-static-analyser in a scientific code base.

Running Unit Static Analysis

It is recommended you create and activate a standalone virtual environment then run:

pip install -r requirements.txt
unit-static-analyser ./moldyn

This should simply show no errors were detected. To see the units discovered within the code base you can run:

unit-static-analyser -u ./moldyn

How it Works

Units 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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages