Skip to content

Commit

Permalink
make is_latest_root work with other datasets
Browse files Browse the repository at this point in the history
  • Loading branch information
schlegelp committed Mar 18, 2024
1 parent 40fb99a commit bef70d1
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions fafbseg/flywire/segmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -936,16 +936,15 @@ def is_latest_root(id, timestamp=None, progress=True, *, dataset=None, **kwargs)

is_latest = np.ones(len(id)).astype(bool)

client = get_cave_client(dataset=dataset)
session = requests.Session()
token = get_chunkedgraph_secret()
session.headers["Authorization"] = f"Bearer {token}"
url = (
"https://prod.flywire-daf.com/segmentation/api/v1/table/"
f"{FLYWIRE_DATASETS.get(dataset, dataset)}/is_latest_roots?int64_as_str=1"
client.chunkedgraph._endpoints["is_latest_roots"].format_map(client.chunkedgraph.default_url_mapping)
)

if isinstance(timestamp, str) and timestamp.startswith("mat"):
client = get_cave_client(dataset=dataset)
if isinstance(timestamp, str) and timestamp.startswith("mat"):
if timestamp == "mat" or timestamp == "mat_latest":
timestamp = client.materialize.get_timestamp()
else:
Expand Down

0 comments on commit bef70d1

Please sign in to comment.