Skip to content

Commit

Permalink
Merge pull request #144 from bdpedigo/fix-typing
Browse files Browse the repository at this point in the history
Fix tuple typing spec
  • Loading branch information
fcollman authored Jan 17, 2024
2 parents 0e90f94 + 454b0e8 commit e23ae17
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions caveclient/chunkedgraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
import datetime
import json
import logging
import sys
from typing import Iterable, Union
from typing import Iterable, Tuple, Union
from urllib.parse import urlencode

import networkx as nx
Expand All @@ -19,11 +18,6 @@
default_global_server_address,
)

# get the version of python at runtime, decide how to specify tuple types

if sys.version_info < (3, 8):
from typing import Tuple as tuple

SERVER_KEY = "cg_server_address"

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -534,7 +528,7 @@ def execute_split(
root_id,
source_supervoxels=None,
sink_supervoxels=None,
) -> tuple[int, list]:
) -> Tuple[int, list]:
"""Execute a multicut split based on points or supervoxels.
Parameters
Expand Down Expand Up @@ -585,7 +579,7 @@ def preview_split(
source_supervoxels=None,
sink_supervoxels=None,
return_additional_ccs=False,
) -> tuple[list, list, bool, list]:
) -> Tuple[list, list, bool, list]:
"""Get supervoxel connected components from a preview multicut split.
Parameters
Expand Down Expand Up @@ -699,7 +693,7 @@ def get_contact_sites(self, root_id, bounds, calc_partners=False) -> dict:

def find_path(
self, root_id, src_pt, dst_pt, precision_mode=False
) -> tuple[np.ndarray, np.ndarray, np.ndarray]:
) -> Tuple[np.ndarray, np.ndarray, np.ndarray]:
"""
Find a path between two locations on a root ID using the level 2 chunked
graph.
Expand Down Expand Up @@ -749,7 +743,7 @@ def find_path(

def get_subgraph(
self, root_id, bounds
) -> tuple[np.ndarray, np.ndarray, np.ndarray]:
) -> Tuple[np.ndarray, np.ndarray, np.ndarray]:
"""Get subgraph of root id within a bounding box.
Parameters
Expand Down Expand Up @@ -1335,7 +1329,7 @@ def get_delta_roots(
timestamp_future: datetime.datetime = datetime.datetime.now(
datetime.timezone.utc
),
) -> tuple[np.ndarray, np.ndarray]:
) -> Tuple[np.ndarray, np.ndarray]:
"""
Get the list of roots that have changed between `timetamp_past` and
`timestamp_future`.
Expand Down

0 comments on commit e23ae17

Please sign in to comment.