From 7c58b3372f5a8f28e3e46c08006eceb6900c1d33 Mon Sep 17 00:00:00 2001 From: filimarc Date: Fri, 1 Nov 2024 17:25:14 +0100 Subject: [PATCH] docs: update tutorials --- examples/morphologies/usage.py | 2 +- examples/tutorials/load_data.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/morphologies/usage.py b/examples/morphologies/usage.py index 269f0d58..1b5b0d48 100644 --- a/examples/morphologies/usage.py +++ b/examples/morphologies/usage.py @@ -15,7 +15,7 @@ first_quarter = np.arange(len(special_branch)) < len(special_branch) / 4 special_branch.label(["initial_segment"], first_quarter) # Assign random data as the `random_data` property to the branch -special_branch.set_property(random_data=np.random.random(len(special_branch))) +special_branch.set_properties(random_data=np.random.random(len(special_branch))) print(f"Random data for each point:", special_branch.random_data) network.morphologies.save("processed_morphology", morpho) diff --git a/examples/tutorials/load_data.py b/examples/tutorials/load_data.py index 69123e75..445faa0d 100644 --- a/examples/tutorials/load_data.py +++ b/examples/tutorials/load_data.py @@ -11,10 +11,10 @@ print(f"My network has {len(scaffold.cell_types)} cell types") # Load placement information from the storage. -for cell_type in scaffold.cell_types: - ps = cell_type.get_placement_set() +for cell_type in scaffold.cell_types.items(): + ps = cell_type[1].get_placement_set() pos = ps.load_positions() - print(f"{len(pos)} {cell_type.name} placed") + print(f"{len(pos)} {cell_type[1].name} placed") # The positions are a (Nx3) numpy array print("The median cell is located at", np.median(pos, axis=0))