Skip to content

Commit

Permalink
Merge branch 'master' into Fix_to_connected_neurons_by_type
Browse files Browse the repository at this point in the history
  • Loading branch information
dosumis authored Sep 4, 2024
2 parents 44b6653 + a8ce672 commit 59c4419
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
9 changes: 9 additions & 0 deletions src/vfb_connect/cross_server_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,15 @@ def lookup_id(self, key, return_curie=False, allow_subsitutions=True, subsitutio
print(f"\033[31mError:\033[0m Unrecognized value: \033[31m{key}\033[0m")
return ''

def __version__(self):
from importlib.metadata import version, PackageNotFoundError
return version('vfb_connect')
try:
return version('vfb_connect')
except PackageNotFoundError:
return '0.0.0'
return '0.0.0'

def get_terms_by_region(self, region, cells_only=False, verbose=False, query_by_label=True, summary=True, return_dataframe=True):
"""Generate TermInfo reports for all terms relevant to annotating a specific region, optionally limited to cells.
Expand Down
7 changes: 5 additions & 2 deletions src/vfb_connect/neo/query_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,11 @@ def get_images(self, short_forms: iter, template, image_folder, image_type='swc'
continue
for imv in image_matches:
if imv['template_anatomy']['label'] == template:
r = requests.get(imv['image_folder'] + '/volume.' + image_type)
### Slightly dodgy warning - could mask network errors
try:
r = requests.get(imv['image_folder'] + '/volume.' + image_type)
except requests.exceptions.RequestException as e:
print(f"\033[33mWarning:\033[0m No '{image_type}' file found for '{label}'. Error: {e}")
continue
if not r.ok:
print("33mWarning:\033[0m No '%s' file found for '%s'." % (image_type, label))
continue
Expand Down

0 comments on commit 59c4419

Please sign in to comment.