diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a0efce..750d13b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +### v0.1.6 +* New parameter `entry_noise` to enable or disable the endfeet activity on entry nodes. (#41) +* Add helper script to load archngv graphs and convert them in pickle binary format. (#40) + ### v0.1.5 * Lazy import of mpi4py module (#27) diff --git a/astrovascpy/bloodflow.py b/astrovascpy/bloodflow.py index e282eb2..6bd5e47 100644 --- a/astrovascpy/bloodflow.py +++ b/astrovascpy/bloodflow.py @@ -547,6 +547,11 @@ def simulate_ou_process( - np.ndarray: (nb_iteration, n_edges) radius values at each time-step for each edge. """ + if "entry_noise" not in params: + raise BloodFlowError("Missing boolean parameter: entry_noise") + if not isinstance(params["entry_noise"], bool): + raise BloodFlowError("The parameter entry_noise must be true or false") + nb_iteration = round(simulation_time / time_step) # nb_iteration_noise = number of time_steps before relaxation starts: nb_iteration_noise = round(relaxation_start / time_step) @@ -587,6 +592,13 @@ def simulate_ou_process( if radii is not None: graph.edge_properties.loc[end_df.index, "radius"] = radii[:, time_it] + if params["entry_noise"]: + radii_at_entry_edges = graph.edge_properties["radius"].iloc[input_edge].to_numpy() + else: + radii_at_entry_edges = ( + graph.edge_properties["radius_origin"].iloc[input_edge].to_numpy() + ) + radii_at_entry_edges = graph.edge_properties["radius"].iloc[input_edge].to_numpy() input_flows = entry_speed[time_it] * np.pi * radii_at_entry_edges**2 else: diff --git a/astrovascpy/typing.py b/astrovascpy/typing.py index 767a927..9068648 100644 --- a/astrovascpy/typing.py +++ b/astrovascpy/typing.py @@ -38,6 +38,8 @@ class VasculatureParams(TypedDict): Args: + entry_noise: Boolean value to enable or disable the endfeet activity on entry nodes. + 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. c_cap: constant used in the ROU parameter calibration for capillaries @@ -62,6 +64,7 @@ class VasculatureParams(TypedDict): blood_viscosity: float base_pressure: float + entry_noise: NotRequired[bool] c_cap: NotRequired[float] c_art: NotRequired[float] threshold_r: NotRequired[float] diff --git a/astrovascpy/version.py b/astrovascpy/version.py index 98f5b76..55ccc05 100644 --- a/astrovascpy/version.py +++ b/astrovascpy/version.py @@ -9,5 +9,5 @@ # See the License for the specific language governing permissions and # limitations under the License. -VERSION = "0.1.5" +VERSION = "0.1.6" version = VERSION diff --git a/examples/data/params.yaml b/examples/data/params.yaml index 1cc1734..aa88bbe 100644 --- a/examples/data/params.yaml +++ b/examples/data/params.yaml @@ -11,6 +11,8 @@ max_nb_inputs: 3 # maximum number of inputs to inject flow/pressure into vascula base_pressure: 1.33e-3 # reference pressure in g * um^{-1} * s^{-2}. At resting state equal to the external pressure +# Enable/Disable endfeet activity on entry nodes. +entry_noise: true ### OU calibration parameters diff --git a/tests/test_bloodflow.py b/tests/test_bloodflow.py index 4cd2032..ffe6bfa 100644 --- a/tests/test_bloodflow.py +++ b/tests/test_bloodflow.py @@ -36,6 +36,7 @@ def params(): "max_nb_inputs": 3, "depth_ratio": 0.05, "vasc_axis": 1, + "entry_noise": True, "threshold_r": 3, "max_r_capill": 1.38, "t_2_max_capill": 2.7,