Skip to content

Commit

Permalink
[Test] check petab develop compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
dweindl committed Jul 2, 2024
1 parent ba84aa6 commit 611d3fd
Show file tree
Hide file tree
Showing 31 changed files with 62 additions and 50 deletions.
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 2
updates:

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-patch", "version-update:semver-minor"]
target-branch: "develop"
4 changes: 2 additions & 2 deletions pypesto/hierarchical/base_problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

try:
import amici
import petab
from petab.C import OBSERVABLE_ID, TIME
import petab.v1 as petab
from petab.v1.C import OBSERVABLE_ID, TIME
except ImportError:
pass

Expand Down
2 changes: 1 addition & 1 deletion pypesto/hierarchical/inner_calculator_collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@

try:
import amici
import petab
import petab.v1 as petab
from amici.petab.parameter_mapping import ParameterMapping
except ImportError:
petab = None
Expand Down
4 changes: 2 additions & 2 deletions pypesto/hierarchical/ordinal/problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@

try:
import amici
import petab
from petab.C import OBSERVABLE_ID, PARAMETER_SEPARATOR
import petab.v1 as petab
from petab.v1.C import OBSERVABLE_ID, PARAMETER_SEPARATOR
except ImportError:
pass

Expand Down
10 changes: 5 additions & 5 deletions pypesto/hierarchical/petab.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
from typing import Literal

import pandas as pd
import petab
import petab.v1 as petab
import sympy as sp
from more_itertools import one
from petab.C import (
from petab.v1.C import (
ESTIMATE,
LIN,
NOISE_PARAMETERS,
Expand All @@ -15,9 +15,9 @@
OBSERVABLE_TRANSFORMATION,
PARAMETER_SEPARATOR,
)
from petab.C import LOWER_BOUND as PETAB_LOWER_BOUND
from petab.C import UPPER_BOUND as PETAB_UPPER_BOUND
from petab.observables import get_formula_placeholders
from petab.v1.C import LOWER_BOUND as PETAB_LOWER_BOUND
from petab.v1.C import UPPER_BOUND as PETAB_UPPER_BOUND
from petab.v1.observables import get_formula_placeholders

from ..C import (
CENSORING_BOUNDS,
Expand Down
4 changes: 2 additions & 2 deletions pypesto/hierarchical/relative/problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

try:
import amici
import petab
from petab.C import (
import petab.v1 as petab
from petab.v1.C import (
ESTIMATE,
LOWER_BOUND,
NOISE_PARAMETERS,
Expand Down
4 changes: 2 additions & 2 deletions pypesto/hierarchical/semiquantitative/problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@

try:
import amici
import petab
from petab.C import (
import petab.v1 as petab
from petab.v1.C import (
ESTIMATE,
LOWER_BOUND,
NOISE_PARAMETERS,
Expand Down
8 changes: 4 additions & 4 deletions pypesto/objective/roadrunner/petab_importer_roadrunner.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
from typing import Any

import libsbml
import petab
import petab.v1
import roadrunner
from petab.C import (
from petab.v1.C import (
OBSERVABLE_FORMULA,
PREEQUILIBRATION_CONDITION_ID,
SIMULATION_CONDITION_ID,
)
from petab.models.sbml_model import SbmlModel
from petab.parameter_mapping import ParMappingDictQuadruple
from petab.v1.models.sbml_model import SbmlModel
from petab.v1.parameter_mapping import ParMappingDictQuadruple

import pypesto.C

Expand Down
4 changes: 2 additions & 2 deletions pypesto/objective/roadrunner/road_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

import numpy as np
import roadrunner
from petab import Problem as PetabProblem
from petab.parameter_mapping import ParMappingDictQuadruple
from petab.v1 import Problem as PetabProblem
from petab.v1.parameter_mapping import ParMappingDictQuadruple

from ...C import MODE_FUN, MODE_RES, ROADRUNNER_INSTANCE, X_NAMES, ModeType
from ..base import ObjectiveBase
Expand Down
4 changes: 2 additions & 2 deletions pypesto/objective/roadrunner/roadrunner_calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
from typing import Optional

import numpy as np
import petab
import petab.v1 as petab
import roadrunner
from petab.parameter_mapping import ParMappingDictQuadruple
from petab.v1.parameter_mapping import ParMappingDictQuadruple

from ...C import (
FVAL,
Expand Down
4 changes: 2 additions & 2 deletions pypesto/objective/roadrunner/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

import numpy as np
import pandas as pd
import petab
import petab.v1 as petab
import roadrunner
from petab.C import (
from petab.v1.C import (
LIN,
MEASUREMENT,
NOISE_DISTRIBUTION,
Expand Down
6 changes: 3 additions & 3 deletions pypesto/petab/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@

import numpy as np
import pandas as pd
import petab
from petab.C import (
import petab.v1 as petab
from petab.v1.C import (
ESTIMATE,
NOISE_PARAMETERS,
OBSERVABLE_ID,
PREEQUILIBRATION_CONDITION_ID,
SIMULATION_CONDITION_ID,
)
from petab.models import MODEL_TYPE_SBML
from petab.v1.models import MODEL_TYPE_SBML

from ..C import (
CENSORED,
Expand Down
4 changes: 2 additions & 2 deletions pypesto/select/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
from collections.abc import Iterable

import pandas as pd
import petab
import petab.v1 as petab
import petab_select.ui
from petab.C import ESTIMATE, NOMINAL_VALUE
from petab.v1.C import ESTIMATE, NOMINAL_VALUE
from petab_select import Model, parameter_string_to_value
from petab_select.constants import PETAB_PROBLEM

Expand Down
2 changes: 1 addition & 1 deletion pypesto/testing/examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def get_Boehm_JProteomeRes2014_hierarchical_petab() -> (
Creates a modified version of the Boehm_JProteomeRes2014 benchmark problem,
suitable for hierarchical optimization.
"""
import petab
import petab.v1 as petab
from benchmark_models_petab import get_problem

from pypesto.C import PARAMETER_TYPE
Expand Down
4 changes: 2 additions & 2 deletions pypesto/visualize/model_fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
import matplotlib.axes
import matplotlib.pyplot as plt
import numpy as np
import petab
import petab.v1 as petab
from amici.petab.conditions import fill_in_parameters
from amici.petab.simulations import rdatas_to_simulation_df
from petab.visualize import plot_problem
from petab.v1.visualize import plot_problem

from ..C import CENSORED, ORDINAL, RDATAS, SEMIQUANTITATIVE
from ..objective import (
Expand Down
2 changes: 1 addition & 1 deletion pypesto/visualize/ordinal_categories.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
try:
import amici
from amici.petab.conditions import fill_in_parameters
from petab.C import OBSERVABLE_ID
from petab.v1.C import OBSERVABLE_ID

from ..hierarchical.ordinal.calculator import OrdinalCalculator
from ..hierarchical.ordinal.parameter import OrdinalParameter
Expand Down
2 changes: 1 addition & 1 deletion pypesto/visualize/sampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,7 @@ def sampling_prediction_trajectories(
# Handle data
grouped_measurements = {}
if measurement_df is not None:
import petab
import petab.v1 as petab

for condition_id in condition_ids:
if petab.PARAMETER_SEPARATOR in condition_id:
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ amici =
roadrunner =
libroadrunner >= 2.6.0
petab =
petab >= 0.2.0
petab >= 0.4.0
ipopt =
cyipopt >= 1.3.0
dlib =
Expand Down
2 changes: 1 addition & 1 deletion test/base/test_roadrunner.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import os

import benchmark_models_petab as models
import petab
import petab.v1 as petab
import petabtests
import pytest

Expand Down
2 changes: 1 addition & 1 deletion test/hierarchical/test_censored.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from pathlib import Path

import numpy as np
import petab
import petab.v1 as petab

import pypesto
import pypesto.logging
Expand Down
2 changes: 1 addition & 1 deletion test/hierarchical/test_hierarchical.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import amici
import numpy as np
import pandas as pd
import petab
import petab.v1 as petab

import pypesto
from pypesto.C import (
Expand Down
2 changes: 1 addition & 1 deletion test/hierarchical/test_ordinal.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from pathlib import Path

import numpy as np
import petab
import petab.v1 as petab
import pytest

import pypesto
Expand Down
2 changes: 1 addition & 1 deletion test/hierarchical/test_spline.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from pathlib import Path

import numpy as np
import petab
import petab.v1 as petab
import pytest

import pypesto
Expand Down
2 changes: 1 addition & 1 deletion test/petab/test_amici_objective.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import amici
import benchmark_models_petab as models
import numpy as np
import petab
import petab.v1 as petab
import pytest

import pypesto
Expand Down
2 changes: 1 addition & 1 deletion test/petab/test_amici_predictor.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import libsbml
import numpy as np
import pandas as pd
import petab
import petab.v1 as petab
import pytest

import pypesto
Expand Down
2 changes: 1 addition & 1 deletion test/petab/test_petab_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import amici
import benchmark_models_petab as models
import numpy as np
import petab
import petab.v1 as petab
import petabtests
import pytest

Expand Down
2 changes: 1 addition & 1 deletion test/petab/test_petab_suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import logging

import amici.petab.simulations
import petab
import petab.v1 as petab
import petabtests
import pytest

Expand Down
2 changes: 1 addition & 1 deletion test/sample/test_sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def rosenbrock_problem():


def create_petab_problem():
import petab
import petab.v1 as petab

import pypesto.petab

Expand Down
4 changes: 2 additions & 2 deletions test/select/test_select.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

import numpy as np
import pandas as pd
import petab
import petab.v1 as petab
import petab_select
import pytest
from more_itertools import one
from petab.C import NOMINAL_VALUE
from petab.v1.C import NOMINAL_VALUE
from petab_select import (
ESTIMATE,
PETAB_PROBLEM,
Expand Down
2 changes: 1 addition & 1 deletion test/visualize/test_visualize.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import matplotlib.pyplot as plt
import numpy as np
import petab
import petab.v1 as petab
import pytest
import scipy.optimize as so

Expand Down
5 changes: 3 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,12 @@ description =
extras = test,amici,petab,pyswarm,roadrunner
deps =
git+https://github.com/Benchmarking-Initiative/Benchmark-Models-PEtab.git@master\#subdirectory=src/python
git+https://github.com/PEtab-dev/petab_test_suite@main
git+https://github.com/FFroehlich/pysb@fix_pattern_matching
git+https://github.com/AMICI-dev/amici.git@develop\#egg=amici&subdirectory=python/sdist

commands =
python3 -m pip install git+https://github.com/PEtab-dev/petab_test_suite@main
python3 -m pip install git+https://github.com/FFroehlich/pysb@fix_pattern_matching
python3 -m pip install -U sympy
pytest --cov=pypesto --cov-report=xml --cov-append \
test/petab
description =
Expand Down

0 comments on commit 611d3fd

Please sign in to comment.