Skip to content

Commit

Permalink
make sure we are descending the dict completely
Browse files Browse the repository at this point in the history
  • Loading branch information
mbthornton-lbl committed Nov 15, 2024
1 parent a2a7e75 commit 80f6c1f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions nmdc_automation/workflow_automation/wfutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -556,9 +556,12 @@ def _normalize_workflow_dict(workflow_dict: Dict[str, Any]) -> Dict[str, Any]:
"""
Traverse the workflow dict and normalize incorrectly formatted values e.g. "16.37" -> 16.37
"""
logging.info("Normalizing workflow dict")
for key, value in workflow_dict.items():
if isinstance(value, dict):
workflow_dict[key] = _normalize_workflow_dict(value)
elif isinstance(value, list):
workflow_dict[key] = [_normalize_value(key, item) for item in value]
else:
workflow_dict[key] = _normalize_value(key, value)
return workflow_dict
Expand All @@ -569,6 +572,7 @@ def _normalize_value(key: str, value: Any) -> Any:
Normalize a value based on the key.
"""
if key in ["completeness", "contamination"]:
logging.info(f"Normalizing {key} value: {value}")
return float(value)
return value

Expand Down

0 comments on commit 80f6c1f

Please sign in to comment.