Skip to content

Commit

Permalink
Query NEST version
Browse files Browse the repository at this point in the history
  • Loading branch information
pnbabu committed Jun 26, 2023
1 parent b272c27 commit ddf0403
Showing 1 changed file with 2 additions and 22 deletions.
24 changes: 2 additions & 22 deletions pynestml/codegeneration/nest_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,29 +50,9 @@ def detect_nest_version(cls) -> str:
vt = nest.Create("volume_transmitter")
try:
neuron = nest.Create("hh_psc_alpha_clopath")
neurons = nest.Create("iaf_psc_exp", 2)
nest.Connect(neurons[0], neurons[1], syn_spec={"synapse_model": "stdp_synapse",
"weight": 1., "delay": 1.})
syn = nest.GetConnections(target=neurons[1], synapse_model="stdp_synapse")
except Exception:
pass
if "DataConnect" in dir(nest):
nest_version = "v2.20.2"
elif "kernel_status" not in dir(nest): # added in v3.1
nest_version = "v3.0"
elif "Kplus" in syn.get().keys(): # "Kplus" trace variable is made accessible via get_status() in master
nest_version = "v" + nest.__version__
if "post0.dev0" in nest_version:
nest_version = "master"
elif "prepared" in nest.GetKernelStatus().keys(): # "prepared" key was added after v3.3 release
nest_version = "v3.4"
elif "tau_u_bar_minus" in neuron.get().keys(): # added in v3.3
nest_version = "v3.3"
elif "tau_Ca" in vt.get().keys(): # removed in v3.2
nest_version = "v3.1"
else:
nest_version = "v3.2"
except ModuleNotFoundError:
nest_version = ""
Expand Down

0 comments on commit ddf0403

Please sign in to comment.