composer icon indicating copy to clipboard operation
composer copied to clipboard

Inconsistency in Return Value of Functional Algorithms

Open nik-mosaic opened this issue 2 years ago • 1 comments

🚀 Feature request

Some algorithms return the model at the end of the apply_algorithm() function, others return None. It is not obvious to the user if there is a reason behind this, and why the return types are not consistent.

E.g. Returns model:

Do not return anything:

Motivation

In some cases a user could type model = apply_algorithm(model) and it will succeed as expected, and in other cases it will silently cause model to equal None. Without looking at the source code, the user will not know why.

Solution

Add return model to the end of every algorithm that currently returns None.

nik-mosaic avatar Aug 24 '22 09:08 nik-mosaic

Yes, agreed that we need a consistent rule here! cc: @dblalock to opine on whether these in-place operations should actually return the model, or just always return None.

hanlint avatar Aug 25 '22 17:08 hanlint

Closed as done

mvpatel2000 avatar Jun 22 '23 21:06 mvpatel2000