Skip to content

Commit 85dde16

Browse files
committed
Fixed wms version default in the Workflow class
Modifyed the Snakemake logger to take WMS version as optional parameter
1 parent 8da4fe0 commit 85dde16

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

wfcommons/common/workflow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def __init__(self,
7171
self.created_at: str = str(datetime.now().astimezone().isoformat())
7272
self.schema_version: str = f"{__schema_version__}"
7373
self.runtime_system_name: Optional[str] = "WfCommons" if not runtime_system_name else runtime_system_name
74-
self.runtime_system_version: Optional[str] = str(__version__) if not runtime_system_version else runtime_system_version
74+
self.runtime_system_version: Optional[str] = "unknown" if not runtime_system_version else runtime_system_version
7575
self.runtime_system_url: Optional[str] = f"https://docs.wfcommons.org/en/v{__version__}/" if not runtime_system_url else runtime_system_url
7676
self.executed_at: Optional[str] = str(datetime.now().astimezone().isoformat()) if not executed_at else executed_at
7777
self.makespan: Optional[float] = makespan

wfcommons/wfinstances/logs/snakemake.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ class SnakemakeLogsParser(LogsParser):
4747
:param path_prefix_rewrite: A tuple that specifies that a file path prefix(for the workflow data files)
4848
should be replaced by another prefix (this is useful when the workflow execution was on a
4949
different machine than the log parsing)
50+
:param snakemake_version: The Snakemake version (e.g., "9.20.0")
51+
:type snakemake_version: str
5052
"""
5153

5254
def __init__(self,
@@ -55,7 +57,8 @@ def __init__(self,
5557
description: Optional[str] = None,
5658
logger: Optional[Logger] = None,
5759
rules_to_ignore: Optional[list[str]] = None,
58-
path_prefix_rewrite: Optional[tuple[str, str]] = None
60+
path_prefix_rewrite: Optional[tuple[str, str]] = None,
61+
snakemake_version: Optional[str] = "unknown"
5962
) -> None:
6063
"""Create an object of the Snakemake parser."""
6164

@@ -69,6 +72,7 @@ def __init__(self,
6972

7073
self.execution_dir : pathlib.Path = execution_dir
7174
self.snkmt_db: pathlib.Path = snkmt_db
75+
self.snakemake_version: str = snakemake_version
7276

7377
self.file_map = {}
7478
self.file_objects = {}
@@ -99,6 +103,7 @@ def build_workflow(self, workflow_name: Optional[str] = None) -> Workflow:
99103
self.workflow = Workflow(name=self.workflow_name,
100104
description=self.description,
101105
runtime_system_name=self.wms_name,
106+
runtime_system_version=self.snakemake_version,
102107
runtime_system_url=self.wms_url)
103108

104109
# Parse the sqlite db for to identify rules

0 commit comments

Comments
 (0)