Skip to content

Commit

Permalink
Update morphology metadata only once after saving the entire MS (#733)
Browse files Browse the repository at this point in the history
* update meta only once during generated MS saving

* bump deps

* bump v to match with bsb-hdf5

* skip deps

* moved plugins to their own section to avoid circular conflicts during CI

* add missing dependency

* add missing requirements

* bump to bsb-hdf5 0.8.1
  • Loading branch information
Helveg committed Jun 13, 2023
1 parent e8c1cac commit 8c1527b
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 9 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,13 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install wheel
# Install the regular requirements
pip install -r requirements.txt --prefer-binary
pip install -e .
# Install the default plugins, without dependencies, to avoid circular dependency
# conflicts with the BSB itself
pip install -r plugins.txt --prefer-binary --no-deps
# Install the BSB from the repo without dependencies, already installed above.
pip install -e . --no-deps
- name: Run tests & coverage
run: |
coverage run -p -m unittest discover -v -s ./tests
Expand Down
2 changes: 1 addition & 1 deletion bsb/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "4.0.0a54"
__version__ = "4.0.0a55"

import functools

Expand Down
5 changes: 4 additions & 1 deletion bsb/placement/distributor.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,10 +321,13 @@ def _specials(self, partitions, indicator, positions):
mr = self.scaffold.morphologies
uid = uuid.uuid4()
loaders = []
all_meta = mr.get_all_meta()
for gen_morpho, i in generated.items():
name = f"{prefix}-{uid}-{i}"
saved = mr.save(name, gen_morpho)
saved = mr.save(name, gen_morpho, update_meta=False)
all_meta[name] = saved.get_meta()
loaders.append(saved)
mr.set_all_meta(all_meta)
morphologies = MorphologySet(loaders, indices)
if not isinstance(morphologies, MorphologySet) and morphologies is not None:
morphologies = MorphologySet(loaders, morphologies)
Expand Down
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ toml==0.10.2
furo==2023.3.27
appdirs==1.4.4
sphinx-copybutton==0.5.0
sphinxext-bsb==0.2.0
sphinxext-bsb==0.2.1
5 changes: 5 additions & 0 deletions plugins.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Plugins
bsb-hdf5==0.8.1

# Plugin dependencies
shortuuid
5 changes: 2 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ errr==1.2.0
psutil==5.9.4
coverage==7.0.4
appdirs==1.4.4
tqdm==4.65.0
quantities==0.14.1

# IO
h5py==3.7.0
Expand All @@ -29,9 +31,6 @@ nrn-patch==4.0.0a4
NEURON==8.2.2
nrn-subprocess==1.3.4

# Plugins
bsb-hdf5==0.7.4

# HTTP
requests==2.30.0
urllib3==2.0.2
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
long_description = fh.read()

requires = [
"bsb-hdf5~=0.7.4",
"bsb-hdf5~=0.8.1",
"h5py~=3.0",
"numpy~=1.19",
"scipy~=1.5",
Expand Down Expand Up @@ -111,7 +111,7 @@
"sphinxemoji",
"sphinx_design~=0.2",
"sphinx-copybutton~=0.5",
"sphinxext-bsb~=0.2.0",
"sphinxext-bsb~=0.2.1",
"snakeviz",
],
"arbor": ["arbor~=0.6", "arborize[arbor]==4.0.0a4"],
Expand Down

0 comments on commit 8c1527b

Please sign in to comment.