abm-covid-lux / abmlux

Agent-based epidemic modelling
Other
4 stars 0 forks source link

Type hinting in some core modules and a github action to check #122

Closed StephenWattam closed 4 years ago

StephenWattam commented 4 years ago

Type hints offer a way to catch errors caused by inconsistent use of typed variables, and offer better documentation for internal interfaces.

Not sure if they're worth using everywhere, but I think they might offer a good way to catch common bugs in the more complex bits of our code.

Not asking to merge this just yet, but see what you think. I did catch a couple of issues when adding this test. Typehints are widely used by "properly engineered" libraries and are definitely part of making the codebase robust.

StephenWattam commented 4 years ago

hm, why does pytest fail :-(

StephenWattam commented 4 years ago

Python 3.9 introduces this, which makes this PR somewhat out of date: https://www.python.org/dev/peps/pep-0585/

StephenWattam commented 4 years ago

Going to close this PR so we don't have to undo this work for 3.9's new syntax