-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated neuroml2 imports with error messages (#472)
* Fixed showmsg() bug in pybind11 based version. The newer implementation of showmsg() shows the outgoing messages with misdirected arrows. Fixed now. * Added newer version of pybind11 * Swapped clocks for channel and compartment to fix #467 * This actually fixes scheduling for channels and compartments #467 The previous commit only updated the docs. This one modifies the actual tick assignments. Now electrical compartments are scheduled on ticks 2 and 3 and channels (all derived from ChanBase) on 4. * Minor fix for compiler warning on loop var creating copy from const * Removed CMake generated compile command. the compile command file is generated by cmake in each build environment and should not be part of the repo. * Added error message at neuroml import error, corrected imports. * Updated neuroml2 reader. Yet to debug Granule_98 model. * Updated neuroml2 reader to handle spherical compartment for CaPool Also created separate test script for Granule98 model. * Fixed deprecated imp module use in rdesigneur. - rdesigneur used imp module, now replaced by importlib. - commented out debug logs from neuroml2 reader - TODO: tests/support has files which conflict with tests/core. These seem to be old test code which may better be removed. * Updated test script for Granule98 model --------- Co-authored-by: HarshaRani <[email protected]>
- Loading branch information
Showing
6 changed files
with
131 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# test_granule98.py --- | ||
# | ||
# Filename: test_granule98.py | ||
# Description: | ||
# Author: Subhasis Ray | ||
# Created: Mon Apr 8 21:41:22 2024 (+0530) | ||
# Last-Updated: Wed Apr 10 19:59:48 2024 (+0530) | ||
# By: Subhasis Ray | ||
# | ||
|
||
# Code: | ||
"""Test code for the Granule cell model | ||
""" | ||
import os | ||
import numpy as np | ||
# import unittest | ||
import logging | ||
|
||
|
||
LOGLEVEL = os.environ.get('LOGLEVEL', 'INFO') | ||
logging.basicConfig(level=LOGLEVEL) | ||
|
||
|
||
import moose | ||
from moose.neuroml2.reader import NML2Reader | ||
|
||
|
||
def run(nogui=True): | ||
reader = NML2Reader() | ||
filename = 'test_files/Granule_98/GranuleCell.net.nml' | ||
reader.read(filename) | ||
soma = reader.getComp(reader.doc.networks[0].populations[0].id, 0, 0) | ||
data = moose.Neutral('/data') | ||
pg = reader.getInput('Gran_10pA') | ||
inj = moose.Table(f'{data.path}/pulse') | ||
moose.connect(inj, 'requestOut', pg, 'getOutputValue') | ||
vm = moose.Table(f'{data.path}/Vm') | ||
moose.connect(vm, 'requestOut', soma, 'getVm') | ||
print('A' * 10, soma) | ||
|
||
simtime = 300e-3 | ||
moose.reinit() | ||
moose.start(simtime) | ||
|
||
t = np.arange(len(vm.vector)) * vm.dt | ||
print('%' * 10, len(vm.vector), len(inj.vector)) | ||
results = np.array([t, vm.vector, inj.vector], dtype=[('time', float), ('Vm', float), ('Im', float)]) | ||
fname = 'Granule_98.npy' | ||
np.save(fname, results) | ||
print(f'Saved results in {fname}') | ||
if not nogui: | ||
import matplotlib.pyplot as plt | ||
fig, axes = plt.subplots(nrows=2, sharex='all') | ||
axes[0].plot(t, vm.vector, label='Vm') | ||
axes[1].plot(t, inj.vector, label='Im') | ||
plt.legend() | ||
plt.show() | ||
|
||
|
||
run(nogui=False) | ||
|
||
|
||
# | ||
# test_granule98.py ends here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters