diff --git a/starfish/core/pipeline/algorithmbase.py b/starfish/core/pipeline/algorithmbase.py index e3c7a87ef..3113212c3 100644 --- a/starfish/core/pipeline/algorithmbase.py +++ b/starfish/core/pipeline/algorithmbase.py @@ -25,19 +25,19 @@ def helper(*args, **kwargs): method_class_str = str(args[0].__class__) if 'ApplyTransform' in method_class_str or 'Filter' in method_class_str: # Update the log on the resulting ImageStack - result.log.update_log(args[0]) + result.log.update_log(args[0], kwargs) if 'FindSpots' in method_class_str: # Update the log on the resulting SpotFindingResults - result.log.update_log(args[0]) + result.log.update_log(args[0], kwargs) if 'DecodeSpots' in method_class_str: # update log then transfer to DecodedIntensityTable spot_results = kwargs['spots'] - spot_results.log.update_log(args[0]) + spot_results.log.update_log(args[0], kwargs) result.attrs[STARFISH_EXTRAS_KEY] = spot_results.log.encode() if 'DetectPixels' in method_class_str: stack = args[1] # update log with spot detection instance args[0] - stack.log.update_log(args[0]) + stack.log.update_log(args[0], kwargs) # get resulting intensity table and set log it = result[0] it.attrs[STARFISH_EXTRAS_KEY] = stack.log.encode() diff --git a/starfish/core/util/logging.py b/starfish/core/util/logging.py index 45ddfb267..61d00a246 100644 --- a/starfish/core/util/logging.py +++ b/starfish/core/util/logging.py @@ -18,20 +18,23 @@ def __init__(self): """ self._log: List[dict] = list() - def update_log(self, class_instance) -> None: + def update_log(self, class_instance, method_runtime_parameters=None) -> None: """ Adds a new entry to the log list. Parameters ---------- class_instance: The instance of a class being applied to the imagestack + + method_runtime_parameters: Any runtime parameters passed to the method """ entry = {"method": class_instance.__class__.__name__, + "method_runtime_parameters": method_runtime_parameters, "arguments": class_instance.__dict__, "os": get_os_info(), "dependencies": get_core_dependency_info(), "release tag": get_release_tag(), - "starfish version": get_dependency_version('starfish') + "starfish version": get_dependency_version('starfish'), } self._log.append(entry) diff --git a/starfish/test/full_pipelines/api/test_iss_api.py b/starfish/test/full_pipelines/api/test_iss_api.py index fab6a9c39..ffe3f1b56 100644 --- a/starfish/test/full_pipelines/api/test_iss_api.py +++ b/starfish/test/full_pipelines/api/test_iss_api.py @@ -123,6 +123,7 @@ def test_iss_pipeline_cropped_data(tmpdir): assert pipeline_log[0]['method'] == 'WhiteTophat' assert pipeline_log[1]['method'] == 'Warp' + assert 'transforms_list' in pipeline_log[1]['method_runtime_parameters'] assert pipeline_log[2]['method'] == 'BlobDetector' assert pipeline_log[3]['method'] == 'PerRoundMaxChannel'