Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
repos:
- repo: https://github.com/pycqa/isort
rev: 6.0.1
rev: 9.0.0a3
hooks:
- id: isort
additional_dependencies: [toml]

- repo: https://github.com/psf/black
rev: 25.1.0
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 26.5.1
hooks:
- id: black
additional_dependencies: [toml]
Expand Down
32 changes: 8 additions & 24 deletions biomass/construction/julia_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@

from typing import Final

PARAMETERS: Final[
str
] = """\
PARAMETERS: Final[str] = """\
module C

const NAMES = []
Expand All @@ -24,9 +22,7 @@
"""


SPECIES: Final[
str
] = """\
SPECIES: Final[str] = """\
module V

const NAMES = []
Expand All @@ -41,9 +37,7 @@
"""


ODE: Final[
str
] = """\
ODE: Final[str] = """\
function diffeq!(du, u, p, t)
v = Dict{Int64,Float64}()

Expand All @@ -69,9 +63,7 @@
"""


OBSERVABLE: Final[
str
] = """\
OBSERVABLE: Final[str] = """\
const observables = []

function observables_index(observable_name::String)::Int
Expand All @@ -83,9 +75,7 @@
"""


SIMULATION: Final[
str
] = """\
SIMULATION: Final[str] = """\
module Sim
include("./name2idx/parameters.jl")
include("./name2idx/species.jl")
Expand Down Expand Up @@ -187,9 +177,7 @@
"""


EXPERIMENTAL_DATA: Final[
str
] = """\
EXPERIMENTAL_DATA: Final[str] = """\
module Exp
include("./observable.jl")

Expand All @@ -204,9 +192,7 @@
"""


SEARCH_PARAM: Final[
str
] = """\
SEARCH_PARAM: Final[str] = """\
# Specify model parameters and/or initial values to optimize
function get_search_index()::Tuple{Array{Int64,1},Array{Int64,1}}
# parameters
Expand Down Expand Up @@ -437,9 +423,7 @@
end
"""

PROBLEM: Final[
str
] = """\
PROBLEM: Final[str] = """\
# Residual Sum of Squares
function compute_objval_rss(
sim_data::Vector{Float64},
Expand Down
4 changes: 2 additions & 2 deletions biomass/construction/template/problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ def _diff_sim_and_exp(sim_matrix, exp_dict, exp_timepoint, conditions, sim_norm_
def objective(self, indiv, *args):
"""Define an objective function to be minimized."""
if len(args) == 0:
(x, y0) = self.update(indiv)
x, y0 = self.update(indiv)
elif len(args) == 1:
raise ValueError("not enough values to unpack (expected 2, got 1)")
elif len(args) == 2:
(x, y0) = args
x, y0 = args
else:
raise ValueError("too many values to unpack (expected 2)")

Expand Down
2 changes: 1 addition & 1 deletion biomass/model_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def load_param(self, paramset: int) -> OptimizedValues:
Optimized parameter/initial values.
"""
best_individual = self.get_individual(paramset)
(x, y0) = self.problem.update(best_individual)
x, y0 = self.problem.update(best_individual)
optimized_values = OptimizedValues(x, y0)
return optimized_values

Expand Down
4 changes: 2 additions & 2 deletions biomass/models/Nakakuki_Cell_2010/problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ def _diff_sim_and_exp(sim_matrix, exp_dict, exp_timepoint, conditions, sim_norm_
def objective(self, indiv, *args):
"""Define an objective function to be minimized"""
if len(args) == 0:
(x, y0) = self.update(indiv)
x, y0 = self.update(indiv)
elif len(args) == 1:
raise ValueError("not enough values to unpack (expected 2, got 1)")
elif len(args) == 2:
(x, y0) = args
x, y0 = args
else:
raise ValueError("too many values to unpack (expected 2)")

Expand Down
4 changes: 2 additions & 2 deletions biomass/models/circadian_clock/problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ def _diff_sim_and_exp(sim_matrix, exp_dict, exp_timepoint, conditions, sim_norm_
def objective(self, indiv, *args):
"""Define an objective function to be minimized"""
if len(args) == 0:
(x, y0) = self.update(indiv)
x, y0 = self.update(indiv)
elif len(args) == 1:
raise ValueError("not enough values to unpack (expected 2, got 1)")
elif len(args) == 2:
(x, y0) = args
x, y0 = args
else:
raise ValueError("too many values to unpack (expected 2)")

Expand Down
4 changes: 2 additions & 2 deletions biomass/models/g1s_transition/problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ def _diff_sim_and_exp(sim_matrix, exp_dict, exp_timepoint, conditions, sim_norm_
def objective(self, indiv, *args):
"""Define an objective function to be minimized"""
if len(args) == 0:
(x, y0) = self.update(indiv)
x, y0 = self.update(indiv)
elif len(args) == 1:
raise ValueError("not enough values to unpack (expected 2, got 1)")
elif len(args) == 2:
(x, y0) = args
x, y0 = args
else:
raise ValueError("too many values to unpack (expected 2)")

Expand Down
4 changes: 2 additions & 2 deletions biomass/models/insulin_signaling/problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ def _diff_sim_and_exp(sim_matrix, exp_dict, exp_timepoint, conditions, sim_norm_
def objective(self, indiv, *args):
"""Define an objective function to be minimized"""
if len(args) == 0:
(x, y0) = self.update(indiv)
x, y0 = self.update(indiv)
elif len(args) == 1:
raise ValueError("not enough values to unpack (expected 2, got 1)")
elif len(args) == 2:
(x, y0) = args
x, y0 = args
else:
raise ValueError("too many values to unpack (expected 2)")

Expand Down
4 changes: 2 additions & 2 deletions biomass/models/jak_stat_pathway/problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ def _diff_sim_and_exp(sim_matrix, exp_dict, exp_timepoint, conditions, sim_norm_
def objective(self, indiv, *args):
"""Define an objective function to be minimized."""
if len(args) == 0:
(x, y0) = self.update(indiv)
x, y0 = self.update(indiv)
elif len(args) == 1:
raise ValueError("not enough values to unpack (expected 2, got 1)")
elif len(args) == 2:
(x, y0) = args
x, y0 = args
else:
raise ValueError("too many values to unpack (expected 2)")

Expand Down
4 changes: 2 additions & 2 deletions biomass/models/mapk_cascade/problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ def _diff_sim_and_exp(sim_matrix, exp_dict, exp_timepoint, conditions, sim_norm_
def objective(self, indiv, *args):
"""Define an objective function to be minimized"""
if len(args) == 0:
(x, y0) = self.update(indiv)
x, y0 = self.update(indiv)
elif len(args) == 1:
raise ValueError("not enough values to unpack (expected 2, got 1)")
elif len(args) == 2:
(x, y0) = args
x, y0 = args
else:
raise ValueError("too many values to unpack (expected 2)")

Expand Down
4 changes: 2 additions & 2 deletions biomass/models/nfkb_pathway/problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ def _diff_sim_and_exp(sim_matrix, exp_dict, exp_timepoint, conditions, sim_norm_
def objective(self, indiv, *args):
"""Define an objective function to be minimized"""
if len(args) == 0:
(x, y0) = self.update(indiv)
x, y0 = self.update(indiv)
elif len(args) == 1:
raise ValueError("not enough values to unpack (expected 2, got 1)")
elif len(args) == 2:
(x, y0) = args
x, y0 = args
else:
raise ValueError("too many values to unpack (expected 2)")

Expand Down
4 changes: 2 additions & 2 deletions biomass/models/pan_rtk/problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ def _diff_sim_and_exp(sim_matrix, exp_dict, exp_timepoint, conditions, sim_norm_
def objective(self, indiv, *args):
"""Define an objective function to be minimized"""
if len(args) == 0:
(x, y0) = self.update(indiv)
x, y0 = self.update(indiv)
elif len(args) == 1:
raise ValueError("not enough values to unpack (expected 2, got 1)")
elif len(args) == 2:
(x, y0) = args
x, y0 = args
else:
raise ValueError("too many values to unpack (expected 2)")

Expand Down
4 changes: 2 additions & 2 deletions biomass/models/prolif_quies/problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ def _diff_sim_and_exp(sim_matrix, exp_dict, exp_timepoint, conditions, sim_norm_
def objective(self, indiv, *args):
"""Define an objective function to be minimized"""
if len(args) == 0:
(x, y0) = self.update(indiv)
x, y0 = self.update(indiv)
elif len(args) == 1:
raise ValueError("not enough values to unpack (expected 2, got 1)")
elif len(args) == 2:
(x, y0) = args
x, y0 = args
else:
raise ValueError("too many values to unpack (expected 2)")

Expand Down
4 changes: 2 additions & 2 deletions biomass/models/tgfb_smad/problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ def _diff_sim_and_exp(sim_matrix, exp_dict, exp_timepoint, conditions, sim_norm_
def objective(self, indiv, *args):
"""Define an objective function to be minimized"""
if len(args) == 0:
(x, y0) = self.update(indiv)
x, y0 = self.update(indiv)
elif len(args) == 1:
raise ValueError("not enough values to unpack (expected 2, got 1)")
elif len(args) == 2:
(x, y0) = args
x, y0 = args
else:
raise ValueError("too many values to unpack (expected 2)")

Expand Down
Loading