suny-downstate-medical-center / netpyne

A Python package to facilitate the development, parallel simulation, optimization and analysis of multiscale biological neuronal networks in NEURON.
http://www.netpyne.org
MIT License
148 stars 138 forks source link

Fail with better error message on import failure for sonatalImport #602

Closed dhasegan closed 3 years ago

dhasegan commented 3 years ago

Before:

>>> from netpyne.conversion import sonataImport
Note: SONATA import failed; import/export functions for SONATA will not be available. 
  To use this feature please install "HDF5" and the "tables" Python package.

After:

>>> from netpyne.conversion import sonataImport
Note: SONATA import failed; import/export functions for SONATA will not be available.
  To use this feature install those Python packages:  ['tables', 'pyneuroml', 'neuroml']

unclear for me whats the relationship of neuroml and hdf5 right now

dhasegan commented 3 years ago

added handling of the case where theres an ImportError that is not from a missing package. For example:

In [1]: from netpyne.conversion import sonataImport
Note: SONATA import failed; import/export functions for SONATA will not be available.
 cannot import name 'dsalfjka' from 'netpyne' (/Users/danielhasegan/workspace/netpyne/netpyne/__init__.py)