Skip to content

Commit 30cce79

Browse files
committed
observable
1 parent 91f6923 commit 30cce79

File tree

3 files changed

+13
-14
lines changed

3 files changed

+13
-14
lines changed

petab/v2/core.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import tempfile
99
import traceback
1010
from abc import abstractmethod
11-
from collections import OrderedDict
1211
from collections.abc import Sequence
1312
from enum import Enum
1413
from itertools import chain
@@ -2280,14 +2279,14 @@ def get_measurements_for_experiment(
22802279
]
22812280

22822281
def get_output_parameters(
2283-
self, observables: bool = True, noise: bool = True
2282+
self, observable: bool = True, noise: bool = True
22842283
) -> list[str]:
22852284
"""Get output parameters.
22862285
22872286
Returns IDs of symbols used in observable and noise formulas that are
22882287
not observables and that are not defined in the model.
22892288
2290-
:param observables:
2289+
:param observable:
22912290
Include parameters from observableFormulas
22922291
:param noise:
22932292
Include parameters from noiseFormulas
@@ -2297,7 +2296,7 @@ def get_output_parameters(
22972296
# collect free symbols from observable and noise formulas,
22982297
# skipping observable IDs
22992298
candidates = set()
2300-
if observables:
2299+
if observable:
23012300
candidates |= {
23022301
str_sym
23032302
for o in self.observables

petab/v2/lint.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -996,15 +996,15 @@ def append_overrides(overrides):
996996
for formula_type, placeholder_sources in (
997997
(
998998
# Observable formulae
999-
{"observables": True, "noise": False},
999+
{"observable": True, "noise": False},
10001000
# can only contain observable placeholders
1001-
{"noise": False, "observables": True},
1001+
{"noise": False, "observable": True},
10021002
),
10031003
(
10041004
# Noise formulae
1005-
{"observables": False, "noise": True},
1005+
{"observable": False, "noise": True},
10061006
# can contain noise and observable placeholders
1007-
{"noise": True, "observables": True},
1007+
{"noise": True, "observable": True},
10081008
),
10091009
):
10101010
output_parameters = problem.get_output_parameters(
@@ -1035,15 +1035,15 @@ def append_overrides(overrides):
10351035

10361036
def get_placeholders(
10371037
problem: Problem,
1038-
observables: bool = True,
1038+
observable: bool = True,
10391039
noise: bool = True,
10401040
) -> list[str]:
10411041
"""Get all placeholder parameters from observable table observableFormulas
10421042
and noiseFormulas.
10431043
10441044
Arguments:
10451045
problem: The PEtab problem
1046-
observables: Include parameters from observableFormulas
1046+
observable: Include parameters from observableFormulas
10471047
noise: Include parameters from noiseFormulas
10481048
10491049
Returns:
@@ -1054,7 +1054,7 @@ def get_placeholders(
10541054
# {observable,noise}Parameters
10551055
placeholders = []
10561056
for o in problem.observables:
1057-
if observables:
1057+
if observable:
10581058
placeholders.extend(map(str, o.observable_placeholders))
10591059
if noise:
10601060
placeholders.extend(map(str, o.noise_placeholders))

tests/v2/test_core.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -804,12 +804,12 @@ def test_get_output_parameters():
804804
)
805805
assert (
806806
petab_problem.get_output_parameters()
807-
== petab_problem.get_output_parameters(observables=True, noise=True)
807+
== petab_problem.get_output_parameters(observable=True, noise=True)
808808
== ["p1", "p3", "p4", "p5"]
809809
)
810810
assert petab_problem.get_output_parameters(
811-
observables=True, noise=False
811+
observable=True, noise=False
812812
) == ["p1", "p3", "p4"]
813813
assert petab_problem.get_output_parameters(
814-
observables=False, noise=True
814+
observable=False, noise=True
815815
) == ["p1", "p3", "p5"]

0 commit comments

Comments
 (0)