Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import NEST_SYNAPSE_TYPES from nest.__init__.py #306

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/nest/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
except ImportError:
pass
import nest
NEST_SYNAPSE_TYPES = nest.Models(mtype='synapses')
from . import simulator
from pyNN import common, recording, errors, space, __doc__

Expand Down
6 changes: 3 additions & 3 deletions src/nest/standardmodels/synapses.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import nest
from pyNN.standardmodels import synapses, build_translations
from pyNN.nest.synapses import get_synapse_defaults, NESTSynapseMixin
from pyNN.nest import NEST_SYNAPSE_TYPES
import logging

logger = logging.getLogger("PyNN")
Expand Down Expand Up @@ -48,10 +49,9 @@ def _get_nest_synapse_model(self, suffix):
logger.warning(", ".join(model for model in base_model))
base_model = list(base_model)[0]
logger.warning("By default, %s is used" % base_model)
available_models = nest.Models(mtype='synapses')
if base_model not in available_models:
if base_model not in NEST_SYNAPSE_TYPES:
raise ValueError("Synapse dynamics model '%s' not a valid NEST synapse model. "
"Possible models in your NEST build are: %s" % (base_model, available_models))
"Possible models in your NEST build are: %s" % (base_model, NEST_SYNAPSE_TYPES))

# CopyModel defaults must be simple floats, so we use the NEST defaults
# for any inhomogeneous parameters, and set the inhomogeneous values
Expand Down