Feature Request: Support return values for ezca.LIGOFilterManager.all_do method.
Currently the LIGOFilterManager.all_do
class method doesn't support the callable argument having return values. This is a useful feature to implement. An example use case would be for supporting tests; for example myTestResults = myLIGOFilterManager.all_do(myTest)
.
Below I outline some code that should work to implement this:
# Pregenerate results list.
results = [None for _ in self.filter_dict.values()]
# Alter evaluation of function.
for ii, f in enumerate(self.filter_dict.values()):
results[ii] = func(f, *args, **kwargs)
# Check for any output.
if all([ii is None for ii in results]):
# All results are None, nothing was returned.
return
else:
# At least one result is not None
return results
There may be smarter/better ways to handle this.