Skip to content

Commit

Permalink
pipestat setup optional
Browse files Browse the repository at this point in the history
  • Loading branch information
stolarczyk committed Feb 1, 2021
1 parent 4b66aa8 commit 0916e3e
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions pypiper/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,21 +348,22 @@ def __init__(
self.debug("No config file")
self.config = None

# pipesatat setup
potential_namespace = getattr(self, "sample_name", self.name)

# don't force default pipestat_results_file value unless
# pipestat config not provided
if pipestat_config is None and pipestat_results_file is None:
pipestat_results_file = pipeline_filepath(
self, filename="pipestat_results.yaml")
self._pipestat_manager = PipestatManager(
namespace=pipestat_namespace or potential_namespace,
record_identifier=pipestat_record_id or potential_namespace,
schema_path=pipestat_schema,
results_file_path=pipestat_results_file,
config=pipestat_config
)
if pipestat_schema is not None:
# pipesatat setup
potential_namespace = getattr(self, "sample_name", self.name)

# don't force default pipestat_results_file value unless
# pipestat config not provided
if pipestat_config is None and pipestat_results_file is None:
pipestat_results_file = pipeline_filepath(
self, filename="pipestat_results.yaml")
self._pipestat_manager = PipestatManager(
namespace=pipestat_namespace or potential_namespace,
record_identifier=pipestat_record_id or potential_namespace,
schema_path=pipestat_schema,
results_file_path=pipestat_results_file,
config=pipestat_config
)

@property
def pipestat(self):
Expand All @@ -375,7 +376,7 @@ def pipestat(self):
:return pipestat.PipestatManager: object to use for results reporting
"""
return self._pipestat_manager
return getattr(self, "_pipestat_manager", None)

@property
def _completed(self):
Expand Down

0 comments on commit 0916e3e

Please sign in to comment.