Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into fix_typehints
Browse files Browse the repository at this point in the history
  • Loading branch information
dweindl committed Nov 7, 2023
2 parents 4430ba4 + 2be0f1b commit 2f51e07
Show file tree
Hide file tree
Showing 15 changed files with 23 additions and 62 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ name: CI
# trigger
on:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
# run Tuesday and Friday at 02:00 UTC
- cron: '00 2 * * TUE,FRI'
workflow_dispatch:
merge_group:

jobs:
base:
Expand Down
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

repos:
- repo: https://github.com/psf/black
rev: 22.6.0
rev: 23.10.0
hooks:
- id: black
description: The uncompromising code formatter
- repo: https://github.com/pycqa/isort
rev: 5.10.1
rev: 5.12.0
hooks:
- id: isort
name: isort (python)
Expand All @@ -21,14 +21,14 @@ repos:
name: isort (pyi)
types: [pyi]
- repo: https://github.com/nbQA-dev/nbQA
rev: 1.3.1
rev: 1.7.0
hooks:
- id: nbqa-black
- id: nbqa-pyupgrade
args: [--py36-plus]
- id: nbqa-isort
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v4.5.0
hooks:
- id: check-yaml
description: Check yaml files for parseable syntax
Expand Down
2 changes: 0 additions & 2 deletions petab_select/candidate_space.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import copy
import csv
import logging
import os.path
import warnings
from pathlib import Path
from typing import Any, Callable, Dict, List, Optional, Union, Type
Expand All @@ -27,7 +26,6 @@
Method,
)
from .handlers import TYPE_LIMIT, LimitHandler
from .misc import snake_case_to_camel_case
from .model import Model, default_compare


Expand Down
6 changes: 2 additions & 4 deletions petab_select/cli.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
"""The PEtab Select command-line interface."""
import warnings
from pathlib import Path
from typing import Any, Dict, List

import click
import dill
import numpy as np
import pandas as pd
import yaml
from more_itertools import one

from . import ui
from .candidate_space import CandidateSpace, method_to_candidate_space_class
from .constants import INITIAL_MODEL_METHODS, PETAB_YAML
from .candidate_space import CandidateSpace
from .constants import PETAB_YAML
from .model import Model, models_from_yaml_list, models_to_yaml_list
from .problem import Problem

Expand Down
8 changes: 2 additions & 6 deletions petab_select/criteria.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,9 @@
import math

import petab
from petab.C import OBJECTIVE, OBJECTIVE_PRIOR_PARAMETERS, OBJECTIVE_PRIOR_TYPE
from petab.C import OBJECTIVE_PRIOR_PARAMETERS, OBJECTIVE_PRIOR_TYPE

from .constants import ( # LH,; LLH,; NLLH,
PETAB_PROBLEM,
TYPE_CRITERION,
Criterion,
)
from .constants import PETAB_PROBLEM, Criterion # LH,; LLH,; NLLH,

# from .model import Model

Expand Down
5 changes: 1 addition & 4 deletions petab_select/handlers.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
from pathlib import Path
from typing import Any, Callable, List, Optional, Union

import numpy as np
from typing import Callable, Union

# `float` for `np.inf`
TYPE_LIMIT = Union[float, int]
Expand Down
2 changes: 1 addition & 1 deletion petab_select/misc.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import hashlib

# import json
from typing import Any, Dict, List, Union
from typing import Any, List, Union

from .constants import ( # TYPE_PARAMETER_OPTIONS_DICT,
ESTIMATE,
Expand Down
2 changes: 0 additions & 2 deletions petab_select/model.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
"""The `Model` class."""
import abc
import warnings
from os.path import relpath
from pathlib import Path
from typing import Any, Dict, List, Optional, Tuple, Union

import numpy as np
import petab
import yaml
from more_itertools import one
Expand Down
17 changes: 1 addition & 16 deletions petab_select/model_space.py
Original file line number Diff line number Diff line change
@@ -1,35 +1,20 @@
"""The `ModelSpace` class and related methods."""
import abc
import itertools
import logging
from pathlib import Path
from tempfile import NamedTemporaryFile
from typing import (
Any,
Callable,
Iterable,
List,
Optional,
TextIO,
Union,
get_args,
)
from typing import Any, Iterable, List, Optional, TextIO, Union, get_args

import numpy as np
import pandas as pd
from more_itertools import nth

from .candidate_space import CandidateSpace
from .constants import (
ESTIMATE,
HEADER_ROW,
MODEL_ID,
MODEL_ID_COLUMN,
MODEL_SPACE_FILE_NON_PARAMETER_COLUMNS,
MODEL_SUBSPACE_ID,
PARAMETER_DEFINITIONS_START,
PARAMETER_VALUE_DELIMITER,
PETAB_YAML,
PETAB_YAML_COLUMN,
TYPE_PATH,
)
Expand Down
11 changes: 2 additions & 9 deletions petab_select/model_subspace.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,20 @@
import math
import warnings
from itertools import chain, product
from itertools import product
from pathlib import Path
from typing import Any, Dict, Iterable, Iterator, List, Optional, Union

import numpy as np
import pandas as pd
import petab
from more_itertools import one, powerset
from petab.C import NOMINAL_VALUE
from more_itertools import powerset

from .candidate_space import CandidateSpace
from .constants import (
CODE_DELIMITER,
ESTIMATE,
MODEL_SPACE_FILE_NON_PARAMETER_COLUMNS,
MODEL_SUBSPACE_ID,
PARAMETER_VALUE_DELIMITER,
PETAB_ESTIMATE_FALSE,
PETAB_ESTIMATE_TRUE,
PETAB_YAML,
STEPWISE_METHODS,
TYPE_PARAMETER,
TYPE_PARAMETER_DICT,
TYPE_PARAMETER_OPTIONS,
TYPE_PARAMETER_OPTIONS_DICT,
Expand Down
1 change: 1 addition & 0 deletions petab_select/petab.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from typing import List, Optional

import petab
from more_itertools import one
from petab.C import ESTIMATE, NOMINAL_VALUE

from .constants import PETAB_ESTIMATE_FALSE, TYPE_PARAMETER_DICT, TYPE_PATH
Expand Down
3 changes: 1 addition & 2 deletions petab_select/problem.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
"""The model selection problem class."""
import abc
from functools import partial
from itertools import chain
from pathlib import Path
from typing import Any, Callable, Dict, Iterable, Optional, Union

import yaml

from .candidate_space import CandidateSpace, method_to_candidate_space_class
from .candidate_space import method_to_candidate_space_class
from .constants import (
CANDIDATE_SPACE_ARGUMENTS,
CRITERION,
Expand Down
12 changes: 2 additions & 10 deletions petab_select/ui.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
import csv
import os.path
from pathlib import Path
from typing import Any, Dict, List, Optional, Tuple, Union
from typing import Dict, List, Optional, Union

import numpy as np
import petab

from .candidate_space import CandidateSpace
from .constants import (
ESTIMATE,
INITIAL_MODEL_METHODS,
TYPE_PATH,
Criterion,
Method,
)
from .constants import INITIAL_MODEL_METHODS, TYPE_PATH, Criterion, Method
from .model import Model, default_compare
from .problem import Problem

Expand Down
1 change: 1 addition & 0 deletions test/candidate_space/test_famos.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ def expected_progress_list():
]


@pytest.mark.skip(reason="FIXME")
def test_famos(
petab_select_problem,
expected_criterion_values,
Expand Down
1 change: 1 addition & 0 deletions test/pypesto/test_pypesto.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def objective_customizer(obj):
obj.amici_solver.setRelativeTolerance(1e-12)


@pytest.mark.skip(reason="FIXME")
def test_pypesto():
for test_case_path in test_cases_path.glob('*'):
if test_cases and test_case_path.stem not in test_cases:
Expand Down

0 comments on commit 2f51e07

Please sign in to comment.