Skip to content

Commit 7d0363d

Browse files
authored
Merge branch 'main' into validate_modelid
2 parents 9567492 + a78fa0a commit 7d0363d

File tree

6 files changed

+14
-5
lines changed

6 files changed

+14
-5
lines changed

doc/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
"numpy": ("https://numpy.org/devdocs/", None),
5353
"sympy": ("https://docs.sympy.org/latest/", None),
5454
"python": ("https://docs.python.org/3", None),
55+
"pydantic": ("https://docs.pydantic.dev/latest/", None),
5556
}
5657

5758
# Add any paths that contain templates here, relative to this directory.

petab/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def __getattr__(name):
3636
return getattr(importlib.import_module("petab.v1"), name)
3737

3838

39-
def v1getattr(name, module):
39+
def _v1getattr(name, module):
4040
if name not in ("__path__", "__all__"):
4141
warn(
4242
f"Accessing `petab.{name}` is deprecated and will be removed in "
@@ -67,7 +67,7 @@ def v1getattr(name, module):
6767
real_module = importlib.import_module(
6868
f"petab.v1.{'.'.join(v1_object_parts)}"
6969
)
70-
real_module.__getattr__ = partial(v1getattr, module=real_module)
70+
real_module.__getattr__ = partial(_v1getattr, module=real_module)
7171
sys.modules[module_name] = real_module
7272
except ModuleNotFoundError:
7373
pass

petab/v1/sbml.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ def write_sbml(sbml_doc: libsbml.SBMLDocument, filename: Path | str) -> None:
169169
sbml_doc: SBML document containing the SBML model
170170
filename: Destination file name
171171
"""
172+
Path(filename).parent.mkdir(parents=True, exist_ok=True)
172173
sbml_writer = libsbml.SBMLWriter()
173174
ret = sbml_writer.writeSBMLToFile(sbml_doc, str(filename))
174175
if not ret:

petab/v2/core.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2035,9 +2035,10 @@ def add_parameter(
20352035
def add_measurement(
20362036
self,
20372037
obs_id: str,
2038-
experiment_id: str,
2038+
*,
20392039
time: float,
20402040
measurement: float,
2041+
experiment_id: str | None = None,
20412042
observable_parameters: Sequence[str | float] | str | float = None,
20422043
noise_parameters: Sequence[str | float] | str | float = None,
20432044
):

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ doc = [
6565
# https://github.com/spatialaudio/nbsphinx/issues/687#issuecomment-1339271312
6666
"ipython>=7.21.0, !=8.7.0",
6767
"pysb",
68-
"antimony>=2.14.0"
68+
"antimony>=2.14.0",
69+
"sbmlmath>=0.4.0",
6970
]
7071
vis = [
7172
"matplotlib>=3.6.0",

tests/v2/test_core.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,12 @@ def test_problem_from_yaml_multiple_files():
389389
problem.experiment_df, Path(tmpdir, f"experiments{i}.tsv")
390390
)
391391

392-
problem.add_measurement(f"observable{i}", f"experiment{i}", 1, 1)
392+
problem.add_measurement(
393+
f"observable{i}",
394+
experiment_id=f"experiment{i}",
395+
time=1,
396+
measurement=1,
397+
)
393398
petab.write_measurement_df(
394399
problem.measurement_df, Path(tmpdir, f"measurements{i}.tsv")
395400
)

0 commit comments

Comments
 (0)