Skip to content

Commit

Permalink
Merge pull request #163 from VirtualFlyBrain/dev
Browse files Browse the repository at this point in the history
Fix for NoneType issue in python 3.9
  • Loading branch information
Robbie1977 authored Aug 29, 2024
2 parents 164c2dc + adf770b commit 5750916
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 26 deletions.
33 changes: 10 additions & 23 deletions docs/source/tutorials/vfb_neurons.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,15 @@
"\u001b[32mEstablishing connections to https://VirtualFlyBrain.org services...\u001b[0m\n",
"\u001b[32mSession Established!\u001b[0m\n",
"\n",
"\u001b[33mType \u001b[35mvfb. \u001b[33mand press \u001b[35mtab\u001b[33m to see available queries. You can run help against any query e.g. \u001b[35mhelp(vfb.get_TermInfo)\u001b[0m\n"
"\u001b[33mType \u001b[35mvfb. \u001b[33mand press \u001b[35mtab\u001b[33m to see available queries. You can run help against any query e.g. \u001b[35mhelp(vfb.terms)\u001b[0m\n"
]
}
],
"source": [
"# Import the VFBConnect class\n",
"from vfb_connect import vfb"
"from vfb_connect import vfb\n",
"\n",
"vfb._load_limit = 10 # Limit the number of results returned to speed things up"
]
},
{
Expand All @@ -51,7 +53,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"VFBTerm(term=Term(term=MinimalEntityInfo(name=LPC1, short_form=VFB_jrchk011), link=https://n2t.net/vfb:VFB_jrchk011))\n"
"LPC1\n"
]
}
],
Expand All @@ -62,37 +64,22 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 17,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"['Entity',\n",
" 'Adult',\n",
" 'Anatomy',\n",
" 'Cell',\n",
" 'Cholinergic',\n",
" 'Individual',\n",
" 'Nervous_system',\n",
" 'Neuron',\n",
" 'Visual_system',\n",
" 'has_image',\n",
" 'has_neuron_connectivity',\n",
" 'has_region_connectivity',\n",
" 'FlyEM_HB',\n",
" 'NBLAST',\n",
" 'NBLASTexp',\n",
" 'neuronbridge']"
"['Adult', 'Cholinergic', 'Nervous_system', 'Visual_system']"
]
},
"execution_count": 4,
"execution_count": 17,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"vfb_neuron.term.core.types"
"vfb_neuron.types"
]
},
{
Expand Down Expand Up @@ -155,7 +142,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"VFBTerms(terms=VFBTerms(terms=[VFBTerm(term=Term(term=MinimalEntityInfo(name=LPC1, short_form=FBbt_00111767), link=https://n2t.net/vfb:FBbt_00111767))]))\n"
"VFBTerms(['LPC1'])\n"
]
}
],
Expand Down
2 changes: 1 addition & 1 deletion src/vfb_connect.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: vfb_connect
Version: 2.1.17.dev23+9a116b9.dirty
Version: 2.1.17.dev24+b4d46e5.dirty
Summary: Wrapper for querying VirtualFlyBrain servers.
Home-page: https://github.com/VirtualFlyBrain/VFB_connect
Author: David Osumi-Sutherland
Expand Down
3 changes: 1 addition & 2 deletions src/vfb_connect/schema/vfb_term.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import json
import os
import sys
from types import NoneType
from typing import Iterable, List, Optional, Union
import navis
import numpy as np
Expand Down Expand Up @@ -2951,7 +2950,7 @@ def __init__(self, terms: Union[List[VFBTerm], List[str], pandas.core.frame.Data
print(f"\033[33mWarning:\033[0m Term with ID {term} not found") if verbose else None
return

if isinstance(terms, list) and all(isinstance(term, NoneType) for term in terms):
if isinstance(terms, list) and all(isinstance(term, type(None)) for term in terms):
self.terms = []
return

Expand Down

0 comments on commit 5750916

Please sign in to comment.