Skip to content

Commit

Permalink
Initial test of removing owmeta...
Browse files Browse the repository at this point in the history
  • Loading branch information
pgleeson committed Jun 26, 2024
1 parent d6788cf commit 7312885
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 16 deletions.
14 changes: 9 additions & 5 deletions c302/OpenWormReader.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@
from c302.NeuroMLUtilities import analyse_connections
from c302 import print_, MUSCLE_RE

from owmeta_core.bundle import Bundle
from owmeta_core.context import Context
from owmeta.neuron import Neuron
from owmeta.muscle import BodyWallMuscle
from owmeta.worm import Worm
try:
from owmeta_core.bundle import Bundle
from owmeta_core.context import Context
from owmeta.neuron import Neuron
from owmeta.muscle import BodyWallMuscle
from owmeta.worm import Worm
except:
print("owmeta not installed! Cannot run OpenWormReader")
exit()

############################################################

Expand Down
23 changes: 14 additions & 9 deletions c302/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,18 @@

import collections

from owmeta_core import __version__ as owc_version
from owmeta_core.bundle import Bundle
from owmeta_core.context import Context
from owmeta import __version__ as owmeta_version
from owmeta.cell import Cell
from owmeta.neuron import Neuron
from owmeta.muscle import Muscle
try:
from owmeta_core import __version__ as owc_version
from owmeta_core.bundle import Bundle
from owmeta_core.context import Context
from owmeta import __version__ as owmeta_version
from owmeta.cell import Cell
from owmeta.neuron import Neuron
from owmeta.muscle import Muscle
owmeta_installed = True
except:
print("owmeta not installed! Proceeding anyway...")
owmeta_installed = False

try:
from urllib2 import URLError # Python 2
Expand Down Expand Up @@ -618,8 +623,8 @@ def generate(net_id,
info = "\n\nParameters and setting used to generate this network:\n\n"+\
" Data reader: %s\n" % data_reader+\
" c302 version: %s\n" % __version__+\
" owmeta version: %s\n" % owmeta_version+\
" owmeta_core version: %s\n" % owc_version+\
" owmeta version: %s\n" % ('<not installed>' if not owmeta_installed else owmeta_version) +\
" owmeta_core version: %s\n" % ('<not installed>' if not owmeta_installed else owc_version) +\
" Cells: %s\n" % (cells if cells is not None else "All cells")+\
" Cell stimulated: %s\n" % (cells_to_stimulate if cells_to_stimulate is not None else "All neurons")+\
" Connection: %s\n" % (conns_to_include if conns_to_include is not None else "All connections") + \
Expand Down
2 changes: 1 addition & 1 deletion c302/c302_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import numpy as np
from pyneuroml import pynml
from pyneuroml import plot as pyneuroml_plot
from owmeta_core.bundle import Bundle

import c302

Expand Down Expand Up @@ -456,6 +455,7 @@ def generate_conn_matrix(nml_doc, save_fig_dir=None, verbose=False, figsize=defa
all_cells = sorted(all_cells)

try:
from owmeta_core.bundle import Bundle
with Bundle('openworm/owmeta-data', version=6) as bnd:
all_neuron_info, all_muscle_info = c302._get_cell_info(bnd, all_cells)
except Exception as e:
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
'xlrd',
'xlwt',
'pyNeuroML>=0.5.11',
'owmeta>=0.12.3',
'WormNeuroAtlas',
],
entry_points={
Expand Down

0 comments on commit 7312885

Please sign in to comment.