PyHa icon indicating copy to clipboard operation
PyHa copied to clipboard

PyLint

Open sprestrelski opened this issue 2 years ago • 4 comments

Add linting, similar to the setup here: https://github.com/UCSD-E4E/acoustic-multiclass-training/blob/main/.github/workflows/pylint.yml

This should also include some restructuring to remove old/irrelevant functions

sprestrelski avatar Nov 18 '23 22:11 sprestrelski

Would this allow us to remove runtime type checking assertions?

npham-dev avatar Nov 21 '23 06:11 npham-dev

Maybe? Linting should help typecheck any parameters that get passed in, but wouldn't necessarily help if we change the datatype in the function (ie. dictionary --> DataFrame).

sprestrelski avatar Nov 21 '23 07:11 sprestrelski

Why would we want to remove runtime type checking?

JacobGlennAyers avatar Nov 21 '23 18:11 JacobGlennAyers

For the same reason we don't check if something is a number in Java. Static type checkers remove the possibility of using a string instead of a number, as an example (so runtime guards don't make sense).

Admittedly it would be useful in cases where types don't cover (ie: this value should be greater than 0). We could also use pydantic to still have runtime guards without checking ourselves.

npham-dev avatar Nov 21 '23 19:11 npham-dev