Code Monkey home page Code Monkey logo

glia's People

Contributors

dependabot[bot] avatar helveg avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

glia's Issues

Compiling without assets causes error

$ 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.

Use the `nmodl` package

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

Compiling with 0.5 in a 0.4 env errors

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.

Dialects

Certain 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.

Context resolves to string

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'

Revert MPI distributed compiling / no hotloading plans

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.

Integrate Astrocyte

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.

RecursionError: maximum recursion depth exceeded

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

Remove lingering .glia & .neuron at uninstall

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:

  • Change the install detection method
  • Remove these folders at uninstall
    • Pip doesn't want arbitrary code execution at install or uninstall
    • Instead of creating them at install time, add them as data files
     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.

Local library

Allow users to add assets to a local library

  • --local flag to pkg add
  • Package name "local"
  • Stored in the cache dir
  • Not cleared on cache clear
  • Shared among Glia minor versions for convenience?

Break circular imports with `_io` module

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

Add getters/setters

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")

Compile each mod seperately, utilizing MPI

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 :)

Special "local" package

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

shutil error when target is already present

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

Report what the selection is when throwing NoMatchesError

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.

Environment settings

  • Add env vars
  • Add env settings in env cache
  • CPU/GPU
  • Compile & autoload yes/no
  • nrnivmodl flags
  • abc flags
  • verbosity

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.