Skip to content

Commit

Permalink
Fix get_required_parameters_for_parameter_table (#340)
Browse files Browse the repository at this point in the history
The previous check did not make any sense. See discussion at #339 (comment).

Also fix a missing import.
  • Loading branch information
dweindl authored Dec 11, 2024
1 parent 8456635 commit b83e345
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
5 changes: 2 additions & 3 deletions petab/v1/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,9 +332,8 @@ def append_overrides(overrides):
if not model.has_entity_with_id(p):
parameter_ids[p] = None

# remove parameters that occur in the condition table and are overridden
# for ALL conditions
for p in condition_df.columns[~condition_df.isnull().any()]:
# parameters that are overridden via the condition table are not allowed
for p in condition_df.columns:
try:
del parameter_ids[p]
except KeyError:
Expand Down
7 changes: 2 additions & 5 deletions petab/v2/lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -621,11 +621,8 @@ def append_overrides(overrides):
if not problem.model.has_entity_with_id(p)
)

# remove parameters that occur in the condition table and are overridden
# for ALL conditions
for p in problem.condition_df.columns[
~problem.condition_df.isnull().any()
]:
# parameters that are overridden via the condition table are not allowed
for p in problem.condition_df.columns:
try:
parameter_ids.remove(p)
except KeyError:
Expand Down
8 changes: 6 additions & 2 deletions petab/v2/problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
from . import experiments

if TYPE_CHECKING:
from ..v2.lint import ValidationIssue, ValidationResultList, ValidationTask
from ..v2.lint import ValidationResultList, ValidationTask


__all__ = ["Problem"]
Expand Down Expand Up @@ -722,7 +722,11 @@ def validate(
Returns:
A list of validation results.
"""
from ..v2.lint import ValidationIssueSeverity, ValidationResultList
from ..v2.lint import (
ValidationIssue,
ValidationIssueSeverity,
ValidationResultList,
)

validation_results = ValidationResultList()
if self.extensions_config:
Expand Down

0 comments on commit b83e345

Please sign in to comment.