Skip to content

Commit

Permalink
Ensure that problems installing NEST extensions produce only a warnin…
Browse files Browse the repository at this point in the history
…g, not an error.
  • Loading branch information
apdavison committed May 5, 2017
1 parent e48a7bf commit 7b47de2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 3 additions & 1 deletion doc/installation.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Optional dependencies are:
Installing PyNN
===============

.. note:: if using NEURON, it is easiest if you install NEURON *before* you install PyNN (see below).
.. note:: if using NEURON or NEST, it is easiest if you install NEURON/NEST *before* you install PyNN (see below).

The easiest way to get PyNN is to use pip_::

Expand All @@ -49,6 +49,8 @@ Test it using something like the following::
>>> sim.end()

(This assumes you have NEST installed).
If you get a warning "Unable to install NEST extensions. Certain models may not be available" then ensure the
program :command:`nest-config` is on your system PATH.

With NEURON as the simulator, make sure you install NEURON *before* you install PyNN.
The PyNN installation will then compile PyNN-specific membrane mechanisms, which are loaded when importing the :mod:`neuron` module::
Expand Down
6 changes: 5 additions & 1 deletion pyNN/nest/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"""

import warnings
import numpy
try:
import tables # due to freeze when importing nest before tables
Expand Down Expand Up @@ -47,7 +48,10 @@
if logger.level == logging.NOTSET:
logger.setLevel(logging.ERROR)

nest.Install('pynn_extensions')
try:
nest.Install('pynn_extensions')
except nest.NESTError as err:
warnings.warn("Unable to install NEST extensions. Certain models may not be available.\nFurther details: {}".format(err))


# ==============================================================================
Expand Down

0 comments on commit 7b47de2

Please sign in to comment.