Skip to content

Commit

Permalink
flake8 linting
Browse files Browse the repository at this point in the history
  • Loading branch information
llegregam committed Jun 13, 2024
1 parent e2c0d82 commit 118d48e
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 11 deletions.
8 changes: 7 additions & 1 deletion physiofit/base/fitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,9 +413,15 @@ def monte_carlo_analysis(self):
logger.debug(f"New matrix:\n{noisy_matrix}\n")
logger.debug(f"Sd matrix:\n{self.sd}\n")
logger.debug(f"time vector:\n{self.model.time_vector}\n")
sim_mat = self.model.simulate(
opt_res.x,
noisy_matrix,
self.model.time_vector,
self.model.args
)
logger.debug(
"simulated matrix:"
f"{self.model.simulate(opt_res.x, noisy_matrix, self.model.time_vector, self.model.args)}\n"
f"{sim_mat}\n"
)
# We optimise the parameters using the noisy matrix as input

Expand Down
6 changes: 3 additions & 3 deletions physiofit/models/model_3.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ def simulate(
m_0 = parameters[i * 2 + 1]
k = fixed_params[i - 1]
exp_k_t = np.exp(-k * time_vector)
simulated_matrix[:, i] = q * (x_0 / (mu + k)) \
* (exp_mu_t - exp_k_t) \
+ m_0 * exp_k_t
simulated_matrix[:, i] = (q * (x_0 / (mu + k)) * (exp_mu_t
- exp_k_t) +
m_0 * exp_k_t)

return simulated_matrix
1 change: 1 addition & 0 deletions physiofit/tests/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ def test_wrong_entry_for_model_data(base_test_data):
"Steady-state batch model",
"Hello world this is an error"
)
return model


def test_optimization_process(base_test_data):
Expand Down
8 changes: 4 additions & 4 deletions physiofit/tests/test_model_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ def test_model_1_estimation(
data=model_1_data
)
model.get_params()
model.args = {"Degradation constants":
{"Glucose": 0, "Acetate": 0, "Glutamine": 1}
model.args = {"Degradation constants": {"Glucose": 0, "Acetate": 0,
"Glutamine": 1}
}
fitter = io.initialize_fitter(
data=model.data,
Expand Down Expand Up @@ -124,8 +124,8 @@ def test_model_1_simulation(
)
model.get_params()
model.parameters.update(parameters)
model.args = {"Degradation constants":
{"Glucose": 0, "Acetate": 0, "Glutamine": 1}
model.args = {"Degradation constants": {"Glucose": 0, "Acetate": 0,
"Glutamine": 1}
}
sim_data = model.simulate(
list(model.parameters.values()),
Expand Down
4 changes: 2 additions & 2 deletions physiofit/tests/test_model_3.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ def test_model_3_simulation(
)
model.get_params()
model.parameters.update(parameters)
model.args = {"Degradation constants":
{"Glucose": 0, "Acetate": 0, "Glutamine": 1}
model.args = {"Degradation constants": {"Glucose": 0, "Acetate": 0,
"Glutamine": 1}
}
sim_data = model.simulate(
list(model.parameters.values()),
Expand Down
1 change: 0 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,3 @@ commands = flake8
deps = flake8



0 comments on commit 118d48e

Please sign in to comment.