graphium
graphium copied to clipboard
Replace `assert` statements by `if / raise`
My understanding is that assert statements can be removed at compile time (to improve performance, which seems specifically relevant to Graphium), so any error that a downstream user can make and should be informed about should ideally be a raised and specific (e.g. RuntimeError, ValueError, TypeError, KeyError, ...) Exception. To have sanity checks during debugging / development, you can still use assert statements.
Originally posted by @cwognum in https://github.com/datamol-io/graphium/pull/414#discussion_r1278383785