Skip to content

Commit

Permalink
Cleanup imports (#59)
Browse files Browse the repository at this point in the history
Unused imports / isort / black
  • Loading branch information
dweindl authored Nov 7, 2023
1 parent e87fcb6 commit 2be0f1b
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 56 deletions.
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
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

0 comments on commit 2be0f1b

Please sign in to comment.