Skip to content

Commit

Permalink
search_annotations: fix bug when there are no cached versions
Browse files Browse the repository at this point in the history
  • Loading branch information
schlegelp committed Mar 11, 2024
1 parent b6b9aff commit 9f104e7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion fafbseg/flywire/annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -1134,7 +1134,12 @@ def search_annotations(x,
# Map to the latest cached version
cached_versions = _get_cached_annotation_materializations(commit)
available_version = get_cave_client(dataset=dataset).materialize.get_versions()
available_and_cached = cached_versions[np.isin(cached_versions, available_version)]

if len(cached_versions):
available_and_cached = cached_versions[np.isin(cached_versions, available_version)]
else:
available_and_cached = []

if len(available_and_cached):
materialization = sorted(available_and_cached)[-1]
else:
Expand Down

0 comments on commit 9f104e7

Please sign in to comment.