How to reference gap junctions in the configuration file

Open
#415 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
30/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
python
Domain
backend

Research direction

Start with simulator_network.py at load_gap_junc_files, called by PointNetwork.from_config, and inspect the configured gap_juncs files alongside the HDF5 error for the missing source_ids object. Confirm the expected gap-junction file structure and configuration entry points, then verify that loading the supplied files completes without the KeyError.

Written by the indexing model from the issue text.

Description

Hello,

I want to create a network of gap junctions and simulate it using the PointNet simulator, but I'm not sure how to reference the gap junctions in the configuration file.

I have created gap junction connections as follows:

net_pre.import_nodes(nodes_file_name=path_pre_h5,node_types_file_name=path_pre_csv)
net_post.import_nodes(nodes_file_name=path_post_h5,node_types_file_name=path_post_csv)


net_pre.add_gap_junctions(source=net_pre.nodes(pop_name='PV'), target=net_post.nodes(pop_name='SST'), connection_rule=connection_rule,resistance=1250)

net_pre.build()
net_pre.save_edge('network')

Then I referenced these gap junctions in the configuration file as follows:

    "networks": {
        "nodes": [
            {
                "nodes_file": "$NETWORK_DIR/test_net_nodes.h5",
                "node_types_file": "$NETWORK_DIR/test_net_node_types.csv"
            }
        ],
        "edges": [],
        "gap_juncs": [
        	{
        	"gap_juncs_file":"$NETWORK_DIR/test_net_test_net_edges.h5",
        	"gap_juncs_types_file":"$NETWORK_DIR/test_net_test_net_edge_types.csv"
            }
            
        ]

However, I am getting this error:


Traceback (most recent call last):
  File "/home/margaux/miniconda3/envs/ENV_NEST/config_command_run_pointnet.py", line 20, in <module>
    main(sys.argv)
  File "/home/margaux/miniconda3/envs/ENV_NEST/config_command_run_pointnet.py", line 15, in main
    network = pointnet.PointNetwork.from_config(configure)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/margaux/miniconda3/envs/ENV_NEST/lib/python3.11/site-packages/bmtk/simulator/core/simulator_network.py", line 260, in from_config
    network.load_gap_junc_files(config.gap_juncs)
  File "/home/margaux/miniconda3/envs/ENV_NEST/lib/python3.11/site-packages/bmtk/simulator/core/simulator_network.py", line 192, in load_gap_junc_files
    self._gap_juncs[network][key] = f[key][()]
                                    ~^^^^^
  File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
  File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
  File "/home/margaux/miniconda3/envs/ENV_NEST/lib/python3.11/site-packages/h5py/_hl/group.py", line 357, in __getitem__
    oid = h5o.open(self.id, self._e(name), lapl=self._lapl)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
  File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
  File "h5py/h5o.pyx", line 190, in h5py.h5o.open
KeyError: "Unable to open object (object 'source_ids' doesn't exist)"

Thank you for your help!
Margaux

Dominant language
Python
Stars
339
Forks
103
Avg merge
2h 7m
Merged PRs (30d)
14

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from AllenInstitute/bmtk

All issues in AllenInstitute/bmtk

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.