In many files, assert __ is not None statements are repeatedly used outside of unit tests (e.g., in asset_pricing/covariance.py, iv/absorbing.py, system/model.py, etc.). Running Python in optimization mode (with -O or -OO) will fail to check these assert statements. Beyond this, they're simply less descriptive as generic AssertionErrors compared to, say, TypeErrors with a comprehensive error message (which can explain why we need these assert __is not None checks in the first place). I propose we replace all non-test assert statements with TypeErrors/ValueErrors is appropriate across the codebase; I've already begun drafting a PR. Let me know if, for whatever reason, this is an intentional design choice.
In many files,
assert __ is not Nonestatements are repeatedly used outside of unit tests (e.g., inasset_pricing/covariance.py,iv/absorbing.py,system/model.py, etc.). Running Python in optimization mode (with -O or -OO) will fail to check these assert statements. Beyond this, they're simply less descriptive as generic AssertionErrors compared to, say, TypeErrors with a comprehensive error message (which can explain why we need theseassert __is not Nonechecks in the first place). I propose we replace all non-testassertstatements with TypeErrors/ValueErrors is appropriate across the codebase; I've already begun drafting a PR. Let me know if, for whatever reason, this is an intentional design choice.