Skip to content

Commit

Permalink
Fix type of add_synapse_points
Browse files Browse the repository at this point in the history
  • Loading branch information
ranlu committed Feb 15, 2024
1 parent 1ce9e9a commit 8c26c41
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions dags/synaptor_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def generate_nglink(
seg_path: str,
workflowtype: str,
storagedir: str,
add_synapse_points: str,
add_synapse_points: bool | int | str,
img_path: Optional[str] = None,
voxelres: Optional[tuple[int, int, int]] = None,
) -> None:
Expand All @@ -50,9 +50,12 @@ def generate_nglink(
slack_message(wrap_payload(os.path.join(storagedir, "ng.json")), broadcast=True)


def getboolean(rawvalue: str) -> bool:
def getboolean(rawvalue: bool | int | str) -> bool:
"""Simulating configparser.getboolean"""
value = rawvalue.lower()
if isinstance(rawvalue, str):
value = rawvalue.lower()
else:
value = rawvalue
if value in [True, 1, "yes", "y", "true", "t", "on"]:
return True
elif value in [False, 0, "no", "n", "false", "f", "off"]:
Expand Down Expand Up @@ -139,7 +142,7 @@ def nglink_op(
seg_path: str,
workflowtype: str,
storagedir: str,
add_synapse_points: str,
add_synapse_points: bool | int | str,
img_path: str,
voxelres: tuple[int, int, int],
) -> PythonOperator:
Expand Down

0 comments on commit 8c26c41

Please sign in to comment.