Checking conditions with the easycheck package

We all know that the assert statement should not be used in production code. Instead, you can use assertion-like functions from the easycheck package. Consider the following example. You have a function that fits a statistical model that requires sample size (n) to be at least 20. So,
You can also issue warnings with easycheck:
If n is smaller than 20, you will see the following warning: "TooSmallSampleSizeWarning: Sample of 10 is too small" The easycheck package offers functions dedicated to - checking general conditions (like above) - checking an object's type - checking path(s) - checking an object's length - comparing floating-point numbers - checking function arguments - combining several conditions Most of them have aliases dedicated to unit testing. The package's advantages are the readability of the code, and the ease of using the package's functions. You can install easycheck from PyPi (pip install easycheck). You can find easycheck on GitHub: https://github.com/nyggus/easycheck/. If you like it, consider leaving a star. Contributions are also welcome! Enjoy easycheck-ing, Marcin
participants (1)
-
Marcin Kozak