BlueBrain / MorphIO

A python and C++ library for reading and writing neuronal morphologies
https://morphio.readthedocs.io
Apache License 2.0
26 stars 22 forks source link

Assert used where an exception should be raised #435

Closed Helveg closed 1 year ago

Helveg commented 1 year ago

https://github.com/BlueBrain/MorphIO/blob/aec82bfac2744bbae26be5f4ff49717e05c65eb3/morphio/__init__.py#L9

It's improper to use the assert keyword to raise an error when a library is mismatched. The assert keyword is to be used to assert internal code correctness. They may be optimized away with -O and -OO optimizer flags. It would be unfortunate if exactly those users looking to run under highly optimized conditions would run into a sneaky library mismatch bug :)