Skip to content

Commit

Permalink
FUNCZ-360 Test that spine morphology assignment keeps working.
Browse files Browse the repository at this point in the history
  • Loading branch information
matz-e committed May 17, 2024
1 parent 98334da commit ba4f3c4
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .ci/test_circuit1k_s2s_nodesets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ parquet-compare-ns \
${CIRCUIT%circuit_config.json}nodes.h5 \
$BASE/touches/structural/circuit.parquet \
circuit.parquet \
4
0
22 changes: 22 additions & 0 deletions .ci/test_circuit1k_spines.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
export BASE=$DATADIR/cellular/circuit-1k/
export CIRCUIT=$BASE/circuit_config.json
export RECIPE=$BASE/bioname/recipe.json
export TOUCHES=$BASE/touches/parquet/*.parquet

srun dplace functionalizer \
-H \
--filters SynapseProperties,SpineMorphologies \
--output-dir="$PWD" \
--checkpoint-dir="$PWD" \
--circuit-config=$CIRCUIT \
--recipe=$RECIPE \
-- $TOUCHES

python << EOF
import numpy as np
import pandas as pd
df = pd.read_parquet("circuit.parquet")
assert len(df["spine_morphology"].unique()) > 1
assert set(df["spine_psd_id"].unique()) == set([-1, 0, 1])
assert np.all(df["spine_sharing_id"] == -1) # currently not yet implemented
EOF
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def __init__(self, recipe, source, target):
"""Initializes the filter using the morphology database."""
super().__init__(recipe, source, target)
self._morphologies, self._filter = _create_spine_morphology_udf(
recipe.spine_morphologies.path
target.spine_morphology_path
)

def apply(self, circuit):
Expand Down
4 changes: 4 additions & 0 deletions src/functionalizer/io/circuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,10 @@ def __init__(self, circuit_config: str, population: str, nodeset: str, cache: st
self.morphologies = MorphologyDB(
pop_prop.alternate_morphology_formats.get("h5v1", pop_prop.morphologies_dir)
)
if pop_prop.spine_morphologies_dir:
self.spine_morphology_path = Path(pop_prop.spine_morphologies_dir)
else:
self.spine_morphology_path = None

if not os.path.isdir(self._cache):
os.makedirs(self._cache)
Expand Down

0 comments on commit ba4f3c4

Please sign in to comment.