aiidateam / plumpy

A python workflows library that supports writing Processes with a well defined set of inputs and outputs that can be strung together.
https://plumpy.readthedocs.io
Other
8 stars 17 forks source link

The `if_` and `while_` constructs do not raise when the predicate returns anything but a boolean #258

Closed sphuber closed 1 year ago

sphuber commented 1 year ago

The interface assumes that a boolean is returned, but in the _IfStepper the return value is simply checked for being "truthy", meaning that incorrect types being returned can go by undetected. Instead, it should raise if the predicate callable returns a value that is not of bool type.

sphuber commented 1 year ago

Fixed in #259