MHKiT-Python
MHKiT-Python copied to clipboard
Assert Statements are for Debugging
Currently MHKiT uses assert staements in its production code (primarilty for type checking functional inputs). As stated in the docs (https://docs.python.org/3/reference/simple_stmts.html#the-assert-statement) assert stements are for debugging.
We should raise an error if the user does not pass the correct information.
So going forward we would convert:
assert isinstance(station_number, (str, type(None))), (f'station_number must be of type string')
to this
if not isinstance(station_number, (str, type(None))):
raise ValueError(f'station_number must be of type string. Got: {station_number}')