From 2ad16db84085b28f69ac41c439ec5e2660ac9120 Mon Sep 17 00:00:00 2001 From: Hiroaki Imoto Date: Fri, 17 Feb 2023 10:14:57 +0900 Subject: [PATCH] Release v0.11.1 (#244) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- biomass/construction/reaction_rules.py | 2 -- biomass/construction/template/observable.py | 1 - biomass/construction/template/viz.py | 3 --- biomass/construction/text2model.py | 8 ++++---- biomass/models/Nakakuki_Cell_2010/ode.py | 3 --- biomass/models/Nakakuki_Cell_2010/viz.py | 2 -- biomass/models/circadian_clock/viz.py | 1 - biomass/models/g1s_transition/ode.py | 3 --- biomass/models/g1s_transition/viz.py | 3 --- biomass/models/insulin_signaling/ode.py | 1 - biomass/models/insulin_signaling/reaction_network.py | 1 - biomass/models/insulin_signaling/viz.py | 3 --- biomass/models/mapk_cascade/reaction_network.py | 1 - biomass/models/mapk_cascade/viz.py | 1 - biomass/models/nfkb_pathway/viz.py | 2 -- biomass/models/pan_rtk/ode.py | 3 --- biomass/models/pan_rtk/viz.py | 3 --- biomass/models/prolif_quies/ode.py | 4 ---- biomass/models/prolif_quies/viz.py | 3 --- biomass/models/tgfb_smad/ode.py | 1 - biomass/models/tgfb_smad/reaction_network.py | 1 - biomass/models/tgfb_smad/viz.py | 3 --- biomass/version.py | 2 +- 24 files changed, 6 insertions(+), 51 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index acaa08e5..a7699cc7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,7 +6,7 @@ repos: additional_dependencies: [toml] - repo: https://github.com/psf/black - rev: 22.12.0 + rev: 23.1.0 hooks: - id: black additional_dependencies: [toml] diff --git a/biomass/construction/reaction_rules.py b/biomass/construction/reaction_rules.py index 41921c8c..daf99a95 100644 --- a/biomass/construction/reaction_rules.py +++ b/biomass/construction/reaction_rules.py @@ -384,7 +384,6 @@ def _raise_exception(self, line_num: int, line: str) -> None: ) def _process_pval_section(self, func_name: str, line_num: int, line: str, *args: str) -> None: - param_values = line.split("|")[1].strip().split(",") if all("=" in pval for pval in param_values): for pval in param_values: @@ -461,7 +460,6 @@ def _process_pval_section(self, func_name: str, line_num: int, line: str, *args: ) def _process_ival_section(self, line_num: int, line: str) -> None: - initial_values = line.split("|")[2].strip().split(",") for ival in initial_values: if ival.startswith("fixed "): diff --git a/biomass/construction/template/observable.py b/biomass/construction/template/observable.py index f990c233..09fabfe3 100644 --- a/biomass/construction/template/observable.py +++ b/biomass/construction/template/observable.py @@ -61,7 +61,6 @@ def simulate(self, x: list, y0: list, _perturbation: dict = {}): # unperturbed steady state for i, condition in enumerate(self.conditions): - sol = solve_ode(self.diffeq, y0, self.t, tuple(x)) if sol is None: diff --git a/biomass/construction/template/viz.py b/biomass/construction/template/viz.py index e1128d53..7db7aa0e 100644 --- a/biomass/construction/template/viz.py +++ b/biomass/construction/template/viz.py @@ -35,15 +35,12 @@ def __init__(self) -> None: self.sensitivity_options = SensitivityOptions(self.cm) def get_single_observable_options(self) -> List[SingleObservable]: - return self.single_observable_options def get_multiple_observables_options(self) -> MultipleObservables: - return self.multiple_observables_options def get_sensitivity_options(self) -> SensitivityOptions: - return self.sensitivity_options @staticmethod diff --git a/biomass/construction/text2model.py b/biomass/construction/text2model.py index 2554989f..e1c9ff16 100644 --- a/biomass/construction/text2model.py +++ b/biomass/construction/text2model.py @@ -505,7 +505,7 @@ def _update_observable(self) -> None: for i, condition in enumerate(self.sim_conditions): # Use ';' for adding description of each condition if i == 0: - lines[line_num + 1] = ( + lines[line_num] += ( 3 * self.indentation + f'if condition == \'{condition[0].strip(" ")}\':\n' + 4 * self.indentation @@ -515,7 +515,7 @@ def _update_observable(self) -> None: + ("\n\n" if len(self.sim_conditions) == 1 else "") ) else: - lines[line_num + 1] += ( + lines[line_num] += ( 3 * self.indentation + f'elif condition == \'{condition[0].strip(" ")}\':\n' + 4 * self.indentation @@ -526,8 +526,8 @@ def _update_observable(self) -> None: ) # pa: parameters # init: initial conditions - lines[line_num + 1] = self._convert_names( - line=lines[line_num + 1], + lines[line_num] = self._convert_names( + line=lines[line_num], p=re.findall(r"p\[(.*?)\]", condition[1]), init=re.findall(r"init\[(.*?)\]", condition[1]), ) diff --git a/biomass/models/Nakakuki_Cell_2010/ode.py b/biomass/models/Nakakuki_Cell_2010/ode.py index 9ab90589..84dad8c5 100644 --- a/biomass/models/Nakakuki_Cell_2010/ode.py +++ b/biomass/models/Nakakuki_Cell_2010/ode.py @@ -28,7 +28,6 @@ def _get_ppMEK_slope(t, ligand) -> float: # Refined Model def diffeq(self, t, y, *x): - v = self.flux(t, y, x) if self.perturbation: @@ -104,7 +103,6 @@ def diffeq(self, t, y, *x): def param_values(): - x = [0] * C.NUM x[C.V1] = 0.34284837 @@ -228,7 +226,6 @@ def param_values(): def initial_values(): - y0 = [0] * V.NUM y0[V.ERKc] = 9.60e02 diff --git a/biomass/models/Nakakuki_Cell_2010/viz.py b/biomass/models/Nakakuki_Cell_2010/viz.py index 59794ccb..ba08a901 100644 --- a/biomass/models/Nakakuki_Cell_2010/viz.py +++ b/biomass/models/Nakakuki_Cell_2010/viz.py @@ -33,7 +33,6 @@ def __init__(self): self.sensitivity_options = SensitivityOptions(self.cm) def get_single_observable_options(self): - for i, _ in enumerate(self.obs_names): self.single_observable_options[i].divided_by = 60 # sec. -> min. self.single_observable_options[i].xlim = (-5, 95) @@ -98,7 +97,6 @@ def get_multiple_observables_options(self): return self.multiple_observables_options def get_sensitivity_options(self): - return self.sensitivity_options @staticmethod diff --git a/biomass/models/circadian_clock/viz.py b/biomass/models/circadian_clock/viz.py index 260ad7b9..13f8f5fa 100644 --- a/biomass/models/circadian_clock/viz.py +++ b/biomass/models/circadian_clock/viz.py @@ -56,7 +56,6 @@ def get_multiple_observables_options(self): return self.multiple_observables_options def get_sensitivity_options(self): - return self.sensitivity_options @staticmethod diff --git a/biomass/models/g1s_transition/ode.py b/biomass/models/g1s_transition/ode.py index e373db61..020cfb89 100644 --- a/biomass/models/g1s_transition/ode.py +++ b/biomass/models/g1s_transition/ode.py @@ -9,7 +9,6 @@ def __init__(self, perturbation): # Refined Model def diffeq(self, t, y, *x): - v = self.flux(t, y, x) if self.perturbation: @@ -69,7 +68,6 @@ def diffeq(self, t, y, *x): def param_values(): - x = [0] * C.NUM ## CYCE SYNTHESISx[C.DEGRADATION AND P27 BINDING/DISSOCIATION: @@ -111,7 +109,6 @@ def param_values(): def initial_values(): - y0 = [0] * V.NUM y0[V.Cdh1dp] = 1.0 diff --git a/biomass/models/g1s_transition/viz.py b/biomass/models/g1s_transition/viz.py index 29267956..52682125 100644 --- a/biomass/models/g1s_transition/viz.py +++ b/biomass/models/g1s_transition/viz.py @@ -33,15 +33,12 @@ def __init__(self): self.sensitivity_options = SensitivityOptions(self.cm) def get_single_observable_options(self): - return self.single_observable_options def get_multiple_observables_options(self): - return self.multiple_observables_options def get_sensitivity_options(self): - return self.sensitivity_options @staticmethod diff --git a/biomass/models/insulin_signaling/ode.py b/biomass/models/insulin_signaling/ode.py index bd0f27b4..1e4d3a37 100644 --- a/biomass/models/insulin_signaling/ode.py +++ b/biomass/models/insulin_signaling/ode.py @@ -8,7 +8,6 @@ def __init__(self, perturbation): self.perturbation = perturbation def diffeq(self, t, y, *x): - v = self.flux(t, y, x) if self.perturbation: diff --git a/biomass/models/insulin_signaling/reaction_network.py b/biomass/models/insulin_signaling/reaction_network.py index 019c5303..8d9d00d1 100644 --- a/biomass/models/insulin_signaling/reaction_network.py +++ b/biomass/models/insulin_signaling/reaction_network.py @@ -10,7 +10,6 @@ def __init__(self) -> None: @staticmethod def flux(t, y, x): - v = {} v[1] = x[C.k1_synthesis] * (y[V.pro_IRcom] - y[V.IRcom]) diff --git a/biomass/models/insulin_signaling/viz.py b/biomass/models/insulin_signaling/viz.py index a8cc0123..23c63b64 100644 --- a/biomass/models/insulin_signaling/viz.py +++ b/biomass/models/insulin_signaling/viz.py @@ -33,7 +33,6 @@ def __init__(self): self.sensitivity_options = SensitivityOptions(self.cm) def get_single_observable_options(self): - for i, _ in enumerate(self.obs_names): self.single_observable_options[i].xticks = [120 * i for i in range(5)] self.single_observable_options[i].xlabel = "time (min)" @@ -42,11 +41,9 @@ def get_single_observable_options(self): return self.single_observable_options def get_multiple_observables_options(self): - return self.multiple_observables_options def get_sensitivity_options(self): - return self.sensitivity_options @staticmethod diff --git a/biomass/models/mapk_cascade/reaction_network.py b/biomass/models/mapk_cascade/reaction_network.py index bf38dd41..71adfa27 100644 --- a/biomass/models/mapk_cascade/reaction_network.py +++ b/biomass/models/mapk_cascade/reaction_network.py @@ -12,7 +12,6 @@ def __init__(self) -> None: @staticmethod def flux(t, y, x) -> dict: - v = {} v[1] = ( x[C.V1] diff --git a/biomass/models/mapk_cascade/viz.py b/biomass/models/mapk_cascade/viz.py index 6e8e33e2..4a849844 100644 --- a/biomass/models/mapk_cascade/viz.py +++ b/biomass/models/mapk_cascade/viz.py @@ -67,7 +67,6 @@ def get_multiple_observables_options(self): return self.multiple_observables_options def get_sensitivity_options(self): - return self.sensitivity_options @staticmethod diff --git a/biomass/models/nfkb_pathway/viz.py b/biomass/models/nfkb_pathway/viz.py index 3fec5523..9fbb5b34 100644 --- a/biomass/models/nfkb_pathway/viz.py +++ b/biomass/models/nfkb_pathway/viz.py @@ -41,11 +41,9 @@ def get_single_observable_options(self): return self.single_observable_options def get_multiple_observables_options(self): - return self.multiple_observables_options def get_sensitivity_options(self): - return self.sensitivity_options @staticmethod diff --git a/biomass/models/pan_rtk/ode.py b/biomass/models/pan_rtk/ode.py index 4b5ab55e..e2bafdc3 100644 --- a/biomass/models/pan_rtk/ode.py +++ b/biomass/models/pan_rtk/ode.py @@ -9,7 +9,6 @@ def __init__(self, perturbation): # Refined Model def diffeq(self, t, y, *x): - v = self.flux(t, y, x) if self.perturbation: @@ -113,7 +112,6 @@ def diffeq(self, t, y, *x): def param_values(): - x = [0] * C.NUM x[C.AKT_activation_pEGFR] = 1.00000000000008e-5 @@ -586,7 +584,6 @@ def param_values(): def initial_values(): - y0 = [0] * V.NUM y0[V.dose_EGF] = 0.0 diff --git a/biomass/models/pan_rtk/viz.py b/biomass/models/pan_rtk/viz.py index 29267956..52682125 100644 --- a/biomass/models/pan_rtk/viz.py +++ b/biomass/models/pan_rtk/viz.py @@ -33,15 +33,12 @@ def __init__(self): self.sensitivity_options = SensitivityOptions(self.cm) def get_single_observable_options(self): - return self.single_observable_options def get_multiple_observables_options(self): - return self.multiple_observables_options def get_sensitivity_options(self): - return self.sensitivity_options @staticmethod diff --git a/biomass/models/prolif_quies/ode.py b/biomass/models/prolif_quies/ode.py index 7b1a61e6..44aef624 100644 --- a/biomass/models/prolif_quies/ode.py +++ b/biomass/models/prolif_quies/ode.py @@ -9,12 +9,10 @@ def __init__(self, perturbation): @staticmethod def _heaviside(x): - return 1 * (x > 0) # Refined Model def diffeq(self, t, y, *x): - v = self.flux(t, y, x) if self.perturbation: @@ -134,7 +132,6 @@ def diffeq(self, t, y, *x): def param_values(): - x = [0] * C.NUM x[C.Bg] = 0.05 @@ -196,7 +193,6 @@ def param_values(): def initial_values(): - y0 = [0] * V.NUM y0[V.tP21] = 0.6 diff --git a/biomass/models/prolif_quies/viz.py b/biomass/models/prolif_quies/viz.py index 29267956..52682125 100644 --- a/biomass/models/prolif_quies/viz.py +++ b/biomass/models/prolif_quies/viz.py @@ -33,15 +33,12 @@ def __init__(self): self.sensitivity_options = SensitivityOptions(self.cm) def get_single_observable_options(self): - return self.single_observable_options def get_multiple_observables_options(self): - return self.multiple_observables_options def get_sensitivity_options(self): - return self.sensitivity_options @staticmethod diff --git a/biomass/models/tgfb_smad/ode.py b/biomass/models/tgfb_smad/ode.py index fb6e7a01..1810a22f 100644 --- a/biomass/models/tgfb_smad/ode.py +++ b/biomass/models/tgfb_smad/ode.py @@ -8,7 +8,6 @@ def __init__(self, perturbation): self.perturbation = perturbation def diffeq(self, t, y, *x): - v = self.flux(t, y, x) if self.perturbation: diff --git a/biomass/models/tgfb_smad/reaction_network.py b/biomass/models/tgfb_smad/reaction_network.py index 14d26e76..588a6f41 100644 --- a/biomass/models/tgfb_smad/reaction_network.py +++ b/biomass/models/tgfb_smad/reaction_network.py @@ -10,7 +10,6 @@ def __init__(self) -> None: @staticmethod def flux(t, y, x) -> dict: - v = {} v[1] = y[V.Rec] * x[C.Rec_act] * y[V.TGFb] diff --git a/biomass/models/tgfb_smad/viz.py b/biomass/models/tgfb_smad/viz.py index 40d113e7..7d7d8937 100644 --- a/biomass/models/tgfb_smad/viz.py +++ b/biomass/models/tgfb_smad/viz.py @@ -33,7 +33,6 @@ def __init__(self): self.sensitivity_options = SensitivityOptions(self.cm) def get_single_observable_options(self): - for i, _ in enumerate(self.obs_names): self.single_observable_options[i].xticks = [200 * i for i in range(4)] self.single_observable_options[i].xlabel = "time (min)" @@ -41,11 +40,9 @@ def get_single_observable_options(self): return self.single_observable_options def get_multiple_observables_options(self): - return self.multiple_observables_options def get_sensitivity_options(self): - return self.sensitivity_options @staticmethod diff --git a/biomass/version.py b/biomass/version.py index db23021d..dd7217d1 100644 --- a/biomass/version.py +++ b/biomass/version.py @@ -1,2 +1,2 @@ """BioMASS library version""" -__version__ = "0.11.0" +__version__ = "0.11.1"