graphium icon indicating copy to clipboard operation
graphium copied to clipboard

Replace `assert` statements by `if / raise`

Open DomInvivo opened this issue 1 year ago • 0 comments

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

DomInvivo avatar Aug 05 '23 02:08 DomInvivo