Skip to content

Add __array_interface__ to FunctionChain

Tobias Hangleiter requested to merge hotfix/function_chain into master

This dunder attribute specifies how numpy converts objects to arrays. Since FunctionChain is currently iterable, this means np.array(chain) will result in array([*chain.functions]) which is arguably not what one wants.

Alternatively, __iter__() could be removed. It's not really necessary as functions is exposed.

Merge request reports