Skip to content

Commit 3759586

Browse files
authored
Merge pull request #60 from VirtualFlyBrain/fix/listallimages-class-only
Attach ListAllAvailableImages only to anatomy Class terms
2 parents 66ea55e + c81efb9 commit 3759586

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

src/vfbquery/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
cache's version stamp can never drift apart.
77
"""
88

9-
__version__ = "1.22.8"
9+
__version__ = "1.22.9"

src/vfbquery/vfb_queries.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -820,9 +820,14 @@ def term_info_parse_object(results, short_form):
820820
if termInfo["IsIndividual"] and techniques:
821821
termInfo["Technique"].extend(techniques)
822822
termInfo["Technique"] = sorted(list(set(termInfo["Technique"])))
823-
# add a query to `queries` list for listing all available images
824-
q = ListAllAvailableImages_to_schema(termInfo["Name"], {"short_form":vfbTerm.term.core.short_form})
825-
queries.append(q)
823+
# add a query for listing all available images -- only for anatomy
824+
# Class terms (get_instances expects a Class, per this query's own
825+
# Class+Anatomy criteria). DataSets/Individuals that merely have
826+
# images must not get it (they use DatasetImages etc.), otherwise a
827+
# dataset shows a spurious "List all available images" query.
828+
if contains_all_tags(termInfo["SuperTypes"], ["Class", "Anatomy"]):
829+
q = ListAllAvailableImages_to_schema(termInfo["Name"], {"short_form":vfbTerm.term.core.short_form})
830+
queries.append(q)
826831

827832
# If the term has channel images but not anatomy channel images, create thumbnails from channel images.
828833
if vfbTerm.channel_image and len(vfbTerm.channel_image) > 0:

0 commit comments

Comments
 (0)