neurodata / brainlit

Method container for computational neuroscience on brains.
http://brainlit.neurodata.io/
Other
27 stars 17 forks source link

Improve type checking via typeguard #82

Open bvarjavand opened 4 years ago

bvarjavand commented 4 years ago

As the repo is refactored (see the Reformatting project), pep484 type hints are being added (example here).

Typeguard allows for type checking via pep484 type hints, and using them would streamline the codebase and reduce some clutter.

Doing this instead of multiple lines of check_type(<input>, <type>) is far cleaner.

Lines to be changed include every type-checking line after a method (for example, upload.py lines 48-51). You can identify the line if it begins with check_. Scripts with type hints and checking so far include:

jovo commented 4 years ago

link to specific lines that you want changed.

bvarjavand commented 4 years ago

lines to be changed are every single type-checking line after a method (for example, upload.py lines 48-51). Scripts with type hints and checking so far include: