Skip to content

Commit

Permalink
change variable name to fix mypy error
Browse files Browse the repository at this point in the history
  • Loading branch information
liannette committed Dec 2, 2024
1 parent e2227df commit 642c67c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions src/nplinker/genomics/bgc.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,17 +229,17 @@ def _to_string(value: Any) -> str:
"""
# Convert list to comma-separated string
if isinstance(value, list):
value = ", ".join(map(str, value))
formatted_value = ", ".join(map(str, value))
# Convert dict to comma-separated string
elif isinstance(value, dict):
value = ", ".join([f"{k}:{v}" for k, v in value.items()])
formatted_value = ", ".join([f"{k}:{v}" for k, v in value.items()])
# Convert None to empty string
elif value is None:
value = ""
formatted_value = ""
# Convert anything else to string
else:
value = str(value)
return value
formatted_value = str(value)
return formatted_value

# CG: why not providing whole product but only amino acid as product monomer?
# this property is not used in NPLinker core business.
Expand Down
10 changes: 5 additions & 5 deletions src/nplinker/metabolomics/spectrum.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,14 +149,14 @@ def _to_string(value: Any) -> str:
"""
# Convert list to comma-separated string
if isinstance(value, list):
value = ", ".join(map(str, value))
formatted_value = ", ".join(map(str, value))
# Convert dict to comma-separated string
elif isinstance(value, dict):
value = ", ".join([f"{k}:{v}" for k, v in value.items()])
formatted_value = ", ".join([f"{k}:{v}" for k, v in value.items()])
# Convert None to empty string
elif value is None:
value = ""
formatted_value = ""
# Convert anything else to string
else:
value = str(value)
return value
formatted_value = str(value)
return formatted_value

0 comments on commit 642c67c

Please sign in to comment.