dbbs-lab / glia Goto Github PK
View Code? Open in Web Editor NEWNMODL asset manager
License: GNU General Public License v3.0
NMODL asset manager
License: GNU General Public License v3.0
Right now [MULTI]
status is returned and counts as a failed test. Instead each mechanism should just be tested.
Astrocyte shouldn't be a standalone tool and should be integrated as glia pkg
subcommands in a glia_pkg
folder. When we do it will be easier to reduce the stupidly large and heterogenous code blocks for defining mods now.
When you rebuild arbor the catalogues should be rebuilt as well.
Causes problems because at install it checks whether .glia
is there to determine installation. So upon 2nd install glia thinks it's already installed. Either:
include_package_data=True,
data_files=[
('.glia', ['data_files/preferences', 'data_files/cache']),
('.neuron', [])
],
Not sure if it will work if new files are added to that folder.
nrnivmodl
flagsabc
flagsCertain mod files work only in certain simulators, users should be able to mark this by adding a dialect
, which will exclude it from other simulators.
astro
contains brittle logic to modify NMODL files, but now an official nmodl parser has been released which we can use. We can probably remove most of the declarations in the astro package setup
Maybe even make it the default behavior so users know when it is being triggered, it should be toggleable with a CLI command
See cnr-ibf-pa/hbp-bsp-issues#544 (comment).
Should use the explicit form import sys; sys.exit(1)
instead.
Allow users to add assets to a local library
--local
flag to pkg add
Compiling with MPI currently causes synchronous write issues. We could do a round robin of all available mods to the MPI processes and have them produce seperate library files ๐ Speedup + bugfix in one. It will also make deployments easier in the future as each mod file can just try
to import its DLL and if it fails it already existed and we'll assume that's fine :)
The stale x86_64
folder gets picked up as a folder to load a lib from, throws file not found error. The whole folder should be cleared from .mod files as well.
claudia@claudia-ms-7a70:~/dbbs-mod-collection$ astro add mod dbbs_mod_collection/mod/glia__dbbs_mod_collection__AMPA__autistic.mod -v autistic
Traceback (most recent call last):
File "/home/claudia/.pyenv/versions/3.9.4/bin/astro", line 8, in <module>
sys.exit(astrocyte_cli())
File "/home/claudia/.pyenv/versions/3.9.4/lib/python3.9/site-packages/astrocyte/cli.py", line 188, in astrocyte_cli
cl_args.func(cl_args)
File "/home/claudia/.pyenv/versions/3.9.4/lib/python3.9/site-packages/astrocyte/cli.py", line 277, in add_mod_file
pkg.add_mod_file(args.file, name=args.name, variant=args.variant)
File "/home/claudia/.pyenv/versions/3.9.4/lib/python3.9/site-packages/astrocyte/__init__.py", line 68, in add_mod_file
self.import_mod_file(
File "/home/claudia/.pyenv/versions/3.9.4/lib/python3.9/site-packages/astrocyte/__init__.py", line 76, in import_mod_file
copy2(origin, destination)
File "/home/claudia/.pyenv/versions/3.9.4/lib/python3.9/shutil.py", line 435, in copy2
copyfile(src, dst, follow_symlinks=follow_symlinks)
File "/home/claudia/.pyenv/versions/3.9.4/lib/python3.9/shutil.py", line 244, in copyfile
raise SameFileError("{!r} and {!r} are the same file".format(src, dst))
shutil.SameFileError: 'dbbs_mod_collection/mod/glia__dbbs_mod_collection__AMPA__autistic.mod' and '/home/claudia/dbbs-mod-collection/dbbs_mod_collection/mod/glia__dbbs_mod_collection__AMPA__autistic.mod' are the same file
Best to solve or clarify this error
Traceback (most recent call last):
File ".\dev_microcircuit.py", line 71, in <module>
scaffold.run_simulation("poc")
File ".\..\scaffold\scaffold.py", line 260, in run_simulation
simulation, simulator = self.prepare_simulation(simulation_name)
File ".\..\scaffold\scaffold.py", line 276, in prepare_simulation
simulator = simulation.prepare()
File ".\..\scaffold\simulators\neuron.py", line 92, in prepare
self.connect_neurons()
File ".\..\scaffold\simulators\neuron.py", line 150, in connect_neurons
to_cell.connect(from_cell, from_section, to_section, synapse_type)
File ".\..\..\dbbs-models\dbbs_models\neurons\base.py", line 187, in connect
synapse = Synapse(self, to_section, synapse_point_process, synapse_attributes, variant=synapse_variant)
File ".\..\..\dbbs-models\dbbs_models\synapses\base.py", line 9, in __init__
self._point_process_glia_name = g.resolve(point_process_name, pkg="dbbs_mod_collection", variant=variant)
File "c:\users\robin\documents\git\glia\glia\__init__.py", line 63, in resolve
return manager.resolver.resolve(asset, pkg=pkg, variant=variant)
File "c:\users\robin\documents\git\glia\glia\resolution.py", line 64, in resolve
raise NoMatchesError("Selection could not be resolved.")
glia.exceptions.NoMatchesError: Selection could not be resolved.
Pretty much every file needs to know the Glia paths and imports the ._glia
module for it which contains a bunch of functions that are all actually completely independent on the Glia
manager class and can be moved to an _io
module for reading/writing the state and retrieving cache paths. This would break all the circular dependencies that .assets
for example has and would simplify importing Package
, Mod
and Catalogue
glia unset Na
$ glia compile
dlopen failed -
libnrnoc.so.0: cannot open shared object file: No such file or directory
GLIA ERROR Library could not be loaded into NEURON.
Compiling in separate libraries takes longer than compiling them all in 1 lib. Increases complexity, and would only enable hot re-loading, which is probably a frilly feature anyway. + things that need to be reloaded can be compiled into a new lib and then loaded.
We have a lot of cascading preference logic, but it's never tested.
Currently the long and technically unknown glia names make it hard for users to get or set properties of inserted mechanisms.
p_sec = p.Section()
try:
Na_FHF = glia.get(p_sec, "Na", "granule_cell_FHF", x=0.5)
except glia.NotPresentError:
print("Wasn't found")
Here you can import your local files without having to distribute them with astro first, making glia a bit more usefull since there's no glia packages yet
pip3 install nrn-glia
Defaulting to user installation because normal site-packages is not writeable
Collecting nrn-glia
Using cached nrn_glia-0.5.1-py3-none-any.whl (32 kB)
Collecting nrn-patch>=3.0.0b0
Using cached nrn_patch-4.0.0a4-py3-none-any.whl (22 kB)
Requirement already satisfied: setuptools in /usr/lib/python3/dist-packages (from nrn-glia) (59.6.0)
Requirement already satisfied: packaging>=19.0 in /usr/lib/python3/dist-packages (from nrn-glia) (21.3)
Collecting errr
Using cached errr-1.2.0-py3-none-any.whl (5.9 kB)
Requirement already satisfied: appdirs in /usr/lib/python3/dist-packages (from nrn-glia) (1.4.4)
Requirement already satisfied: requests in /usr/lib/python3/dist-packages (from nrn-glia) (2.25.1)
Collecting nrn-glia[neuron]==4.0.0a4
Using cached nrn_glia-4.0.0a4-py3-none-any.whl (33 kB)
Requirement already satisfied: NEURON>=8.0 in /home/bremen/.local/lib/python3.10/site-packages (from nrn-patch>=3.0.0b0->nrn-glia) (8.2.2)
Requirement already satisfied: numpy>=1.21.0 in /home/bremen/.local/lib/python3.10/site-packages (from nrn-patch>=3.0.0b0->nrn-glia) (1.23.4)
ERROR: Exception:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pip/_internal/cli/base_command.py", line 165, in exc_logging_wrapper
status = run_func(*args)
File "/usr/lib/python3/dist-packages/pip/_internal/cli/req_command.py", line 205, in wrapper
return func(self, options, args)
File "/usr/lib/python3/dist-packages/pip/_internal/commands/install.py", line 339, in run
requirement_set = resolver.resolve(
File "/usr/lib/python3/dist-packages/pip/_internal/resolution/resolvelib/resolver.py", line 94, in resolve
result = self._result = resolver.resolve(
File "/usr/lib/python3/dist-packages/pip/_vendor/resolvelib/resolvers.py", line 482, in resolve
return _build_result(state)
File "/usr/lib/python3/dist-packages/pip/_vendor/resolvelib/resolvers.py", line 427, in _build_result
if not _has_route_to_root(state.criteria, key, all_keys, connected):
File "/usr/lib/python3/dist-packages/pip/_vendor/resolvelib/resolvers.py", line 408, in _has_route_to_root
if _has_route_to_root(criteria, pkey, all_keys, connected):
File "/usr/lib/python3/dist-packages/pip/_vendor/resolvelib/resolvers.py", line 408, in _has_route_to_root
if _has_route_to_root(criteria, pkey, all_keys, connected):
File "/usr/lib/python3/dist-packages/pip/_vendor/resolvelib/resolvers.py", line 408, in _has_route_to_root
if _has_route_to_root(criteria, pkey, all_keys, connected):
[Previous line repeated 986 more times]
File "/usr/lib/python3/dist-packages/pip/_vendor/resolvelib/resolvers.py", line 400, in _has_route_to_root
for p in criteria[key].iter_parent():
RecursionError: maximum recursion depth exceeded
with glia.context(pkg="dbbs_mod_collection"):
dbbs_cell = dbbs_models.BasketCell()
Yields:
Traceback (most recent call last):
File "protocols/psth.py", line 13, in <module>
dbbs_cell = dbbs_models.BasketCell()
File "/home/martina/.pyenv/versions/3.7.6/lib/python3.7/site-packages/arborize/core.py", line 114, in __init__
self._init_section(section)
File "/home/martina/.pyenv/versions/3.7.6/lib/python3.7/site-packages/arborize/core.py", line 167, in _init_section
self._init_section_label(section, label)
File "/home/martina/.pyenv/versions/3.7.6/lib/python3.7/site-packages/arborize/core.py", line 186, in _init_section_label
mod_name = g.resolve(mechanism)
File "/home/martina/.pyenv/versions/3.7.6/lib/python3.7/site-packages/glia/__init__.py", line 40, in resolve
return _manager.resolve(asset, pkg=pkg, variant=variant)
File "/home/martina/.pyenv/versions/3.7.6/lib/python3.7/site-packages/glia/_glia.py", line 30, in wrapper
return func(self, *args, **kwargs)
File "/home/martina/.pyenv/versions/3.7.6/lib/python3.7/site-packages/glia/_glia.py", line 320, in resolve
return self.resolver.resolve(*args, **kwargs)
File "/home/martina/.pyenv/versions/3.7.6/lib/python3.7/site-packages/glia/resolution.py", line 71, in resolve
return resolved.mod_name
AttributeError: 'str' object has no attribute 'mod_name'
THe paths etc should be able to be created without access to the manager instance.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.