Closed r-barnes closed 2 years ago
Hi Richard, thanks for checking things out here and trying to clean up the code base.
I have to ask though: are all these type checks necessary? I scanned through quickly and found a few type annotations in the model that are wrong, so I'm wondering if they were auto generated or you did them manually? I guess I will need to check them carefully before merging. What happens if the wrong type is passed to the method; does Python care or are these just for static code analyzers? I guess it doesn't hurt to have them if it is just the latter?
@amoodie - Apologies. The first PR I did by hand. This one was semi-automated.
The type annotations have no run-time effect, but can be interpreted by IDEs (such as vscode+pylance) for real-time type consistency checking and used with static analyzers (Pyre, mypy, pylance) to test for consistency errors without having to run a test suite.
They are not strictly necessary, but there are some advantages to having them:
To be clear, the main advantage for me is that these allow me to reason about what's happening in the code.
Codecov Report
100.00% <100.00%> (ø)
79.41% <100.00%> (ø)
98.30% <100.00%> (ø)
97.15% <100.00%> (-0.01%)
98.00% <100.00%> (-0.02%)
89.44% <100.00%> (-0.02%)
84.09% <100.00%> (-0.04%)
44.48% <100.00%> (ø)
76.41% <100.00%> (ø)
54.54% <100.00%> (ø)
Continue to review full report at Codecov.