Skip to content
This repository was archived by the owner on Feb 26, 2025. It is now read-only.

Commit d40a16b

Browse files
authored
add entry_noise option (#41)
Enable/Disable noise on entry nodes
1 parent 546b801 commit d40a16b

File tree

6 files changed

+23
-1
lines changed

6 files changed

+23
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
### v0.1.6
4+
* New parameter `entry_noise` to enable or disable the endfeet activity on entry nodes. (#41)
5+
* Add helper script to load archngv graphs and convert them in pickle binary format. (#40)
6+
37
### v0.1.5
48
* Lazy import of mpi4py module (#27)
59

astrovascpy/bloodflow.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,11 @@ def simulate_ou_process(
547547
- np.ndarray: (nb_iteration, n_edges) radius values at each time-step for each edge.
548548
"""
549549

550+
if "entry_noise" not in params:
551+
raise BloodFlowError("Missing boolean parameter: entry_noise")
552+
if not isinstance(params["entry_noise"], bool):
553+
raise BloodFlowError("The parameter entry_noise must be true or false")
554+
550555
nb_iteration = round(simulation_time / time_step)
551556
# nb_iteration_noise = number of time_steps before relaxation starts:
552557
nb_iteration_noise = round(relaxation_start / time_step)
@@ -587,6 +592,13 @@ def simulate_ou_process(
587592
if radii is not None:
588593
graph.edge_properties.loc[end_df.index, "radius"] = radii[:, time_it]
589594

595+
if params["entry_noise"]:
596+
radii_at_entry_edges = graph.edge_properties["radius"].iloc[input_edge].to_numpy()
597+
else:
598+
radii_at_entry_edges = (
599+
graph.edge_properties["radius_origin"].iloc[input_edge].to_numpy()
600+
)
601+
590602
radii_at_entry_edges = graph.edge_properties["radius"].iloc[input_edge].to_numpy()
591603
input_flows = entry_speed[time_it] * np.pi * radii_at_entry_edges**2
592604
else:

astrovascpy/typing.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ class VasculatureParams(TypedDict):
3838
3939
Args:
4040
41+
entry_noise: Boolean value to enable or disable the endfeet activity on entry nodes.
42+
4143
threshold_r: radius (µm) threshold. A radius smaller than the threshold is considered a capillary. A radius bigger than the threshold is considered an artery.
4244
4345
c_cap: constant used in the ROU parameter calibration for capillaries
@@ -62,6 +64,7 @@ class VasculatureParams(TypedDict):
6264
blood_viscosity: float
6365
base_pressure: float
6466

67+
entry_noise: NotRequired[bool]
6568
c_cap: NotRequired[float]
6669
c_art: NotRequired[float]
6770
threshold_r: NotRequired[float]

astrovascpy/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99
# See the License for the specific language governing permissions and
1010
# limitations under the License.
1111

12-
VERSION = "0.1.5"
12+
VERSION = "0.1.6"
1313
version = VERSION

examples/data/params.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ max_nb_inputs: 3 # maximum number of inputs to inject flow/pressure into vascula
1111

1212
base_pressure: 1.33e-3 # reference pressure in g * um^{-1} * s^{-2}. At resting state equal to the external pressure
1313

14+
# Enable/Disable endfeet activity on entry nodes.
15+
entry_noise: true
1416

1517
### OU calibration parameters
1618

tests/test_bloodflow.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ def params():
3636
"max_nb_inputs": 3,
3737
"depth_ratio": 0.05,
3838
"vasc_axis": 1,
39+
"entry_noise": True,
3940
"threshold_r": 3,
4041
"max_r_capill": 1.38,
4142
"t_2_max_capill": 2.7,

0 commit comments

Comments
 (0)