AllenInstitute / AllenInstitute/bmtk

save_nodes fails to overwrite (nodes file already open)

Open
#37 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
335
Forks
102
Avg merge
1d 5h
Merged PRs (30d)
6

Description

When trying to modify and re-run a network interactively in ipython/jupyter, NetworkBuilder.save_nodes fails with the message (from h5py): IOError: Unable to create file (unable to truncate a file which is already open)
It seems like the file is left open on loading the network when BioNetwork.from_config is called, maybe in SonataNodes.load()?. Not sure if that's intentional, or could be fixed?

Contributor guide

Open the contributing guide

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.

Research direction

Reproduce the failure by loading a network through BioNetwork.from_config in IPython or Jupyter, then calling NetworkBuilder.save_nodes. Inspect SonataNodes.load() first to trace whether the nodes file remains open, and confirm done when the loaded network can be modified and saved again without the h5py truncation error.

Written by the indexing model from the issue text.

Assessment

Tech stack
jupyter, python
Domain
data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.