payu-org / payu

A workflow management tool for numerical models on the NCI computing systems
Apache License 2.0
18 stars 25 forks source link

Assert is an anti-pattern in production code #367

Open aidanheerdegen opened 9 months ago

aidanheerdegen commented 9 months ago

payu is using assert in a number of locations throughout the production code

https://github.com/search?q=repo%3Apayu-org%2Fpayu%20assert&type=code

This is not good practice:

https://www.inspiredpython.com/article/assertions-and-exceptions-are-not-the-same

Note that it is fine in to use assert in tests.