Skip to content

Commit

Permalink
..
Browse files Browse the repository at this point in the history
  • Loading branch information
dweindl committed Nov 12, 2024
1 parent af97a2f commit 1575ddb
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 42 deletions.
5 changes: 4 additions & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
from __future__ import annotations

import inspect

import sphinx

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

Expand Down Expand Up @@ -73,5 +76,5 @@ def autodoc_skip_member(app, what, name, obj, skip, options):
return None


def setup(app: "sphinx.application.Sphinx"):
def setup(app: sphinx.application.Sphinx):
app.connect("autodoc-skip-member", autodoc_skip_member, priority=0)
11 changes: 6 additions & 5 deletions petab_select/candidate_space.py
Original file line number Diff line number Diff line change
Expand Up @@ -690,8 +690,8 @@ def __init__(
if predecessor_model is None:
predecessor_model = VIRTUAL_INITIAL_MODEL
super().__init__(
method=Method.FORWARD if self.direction == 1 else Method.BACKWARD,
*args,
method=Method.FORWARD if self.direction == 1 else Method.BACKWARD,
predecessor_model=predecessor_model,
**kwargs,
)
Expand Down Expand Up @@ -976,8 +976,8 @@ def __init__(
]

super().__init__(
method=self.method,
*args,
method=self.method,
predecessor_model=predecessor_model,
**kwargs,
)
Expand All @@ -990,7 +990,8 @@ def __init__(
and (Method.LATERAL,) not in self.method_scheme
):
raise ValueError(
"Please provide a method to switch to after a lateral search, if not enabling the `consecutive_laterals` option."
"Please provide a method to switch to after a lateral search, "
"if not enabling the `consecutive_laterals` option."
)

if self.n_reattempts:
Expand Down Expand Up @@ -1401,8 +1402,8 @@ def __init__(
Maximal allowed number of swap moves. If 0 then there is no maximum.
"""
super().__init__(
method=Method.LATERAL,
*args,
method=Method.LATERAL,
predecessor_model=predecessor_model,
**kwargs,
)
Expand Down Expand Up @@ -1453,8 +1454,8 @@ def __init__(self, *args, **kwargs):
# 'brute force candidate space.'
# )
super().__init__(
method=Method.BRUTE_FORCE,
*args,
method=Method.BRUTE_FORCE,
**kwargs,
)

Expand Down
2 changes: 1 addition & 1 deletion petab_select/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -1001,7 +1001,7 @@ def hash_model_subspace_indices(model_subspace_indices: list[int]) -> str:
for index in model_subspace_indices
)
except KeyError:
return MODEL_SUBSPACE_INDICES_HAS_HASH_DELIMITER.join(
return MODEL_SUBSPACE_INDICES_HASH_DELIMITER.join(
str(i) for i in model_subspace_indices
)

Expand Down
69 changes: 35 additions & 34 deletions petab_select/model_subspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -923,41 +923,42 @@ def get_estimated(
The parameter IDs.
"""
raise NotImplementedError
parameters = []
for parameter_id, parameter_value in self.parameters_all.items():
if additional_parameters.get(parameter_id, None) == ESTIMATE:
parameters.append(parameter_id)
continue

if parameter_id in additional_parameters:
# Presumably not estimated.
continue

old_estimated_all = {
parameter_id
for parameter_id, parameter_values in self.parameters_all.items()
if
(
# Predecessor model sets the parameter to be estimated
(
candidate_space.predecessor_model.parameters.get(
parameter_id, None
)
== ESTIMATE
)
or (
# Predecessor model takes the default PEtab parameter
parameter_id
not in candidate_space.predecessor_model.parameters
and
# And the default PEtab parameter is estimated
# The PEtab problem of this subspace and the
# `candidate_space` is the same, as verified earlier with
# `self.check_compatibility_stepwise_method`.
self.petab_parameters[parameter_id] == [ESTIMATE]
)
)
}
# parameters = []
# for parameter_id, parameter_value in self.parameters_all.items():
# if additional_parameters.get(parameter_id, None) == ESTIMATE:
# parameters.append(parameter_id)
# continue
#
# if parameter_id in additional_parameters:
# # Presumably not estimated.
# continue
#
# old_estimated_all = {
# parameter_id
# for parameter_id, parameter_values in self.parameters_all.items()
# if
# (
# # Predecessor model sets the parameter to be estimated
# (
# candidate_space.predecessor_model.parameters.get(
# parameter_id, None
# )
# == ESTIMATE
# )
# or (
# # Predecessor model takes the default PEtab parameter
# parameter_id
# not in candidate_space.predecessor_model.parameters
# and
# # And the default PEtab parameter is estimated
# # The PEtab problem of this subspace and the
# # `candidate_space` is the same, as verified earlier with
# # `self.check_compatibility_stepwise_method`.
# self.petab_parameters[parameter_id] == [ESTIMATE]
# )
# )
# }

def __len__(self) -> int:
"""Get the number of models in this subspace."""
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ lint.ignore = [
"S301", # pickle module used
"S102", # Use of exec detected
"S307", # Use of possibly insecure function
"B026", # Star-arg unpacking after a keyword argument
"B006",
"E722",
"B904",
Expand Down

0 comments on commit 1575ddb

Please sign in to comment.