Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Feb 5, 2024
1 parent d1f14cd commit a292a1b
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 13 deletions.
5 changes: 3 additions & 2 deletions adaptive/learner/average_learner1D.py
Expand Up @@ -79,8 +79,9 @@ def __init__(
self,
function: Callable[[tuple[int, Real]], Real],
bounds: tuple[Real, Real],
loss_per_interval: None
| (Callable[[Sequence[Real], Sequence[Real]], float]) = None,
loss_per_interval: None | (
Callable[[Sequence[Real], Sequence[Real]], float]
) = None,
delta: float = 0.2,
alpha: float = 0.005,
neighbor_sampling: float = 0.3,
Expand Down
1 change: 0 additions & 1 deletion adaptive/learner/integrator_learner.py
Expand Up @@ -71,7 +71,6 @@ class DivergentIntegralError(ValueError):


class _Interval:

"""
Attributes
----------
Expand Down
10 changes: 6 additions & 4 deletions adaptive/learner/learner1D.py
Expand Up @@ -633,10 +633,12 @@ def tell_pending(self, x: float) -> None:
def tell_many(
self,
xs: Sequence[Float] | np.ndarray,
ys: Sequence[Float]
| Sequence[Sequence[Float]]
| Sequence[np.ndarray]
| np.ndarray,
ys: (
Sequence[Float]
| Sequence[Sequence[Float]]
| Sequence[np.ndarray]
| np.ndarray
),
*,
force: bool = False,
) -> None:
Expand Down
8 changes: 5 additions & 3 deletions adaptive/learner/learnerND.py
Expand Up @@ -987,9 +987,11 @@ def plot_slice(self, cut_mapping, n=None):
xs = ys = np.linspace(0, 1, n)
xys = [xs[:, None], ys[None, :]]
values = [
cut_mapping[i]
if i in cut_mapping
else xys.pop(0) * (b[1] - b[0]) + b[0]
(
cut_mapping[i]
if i in cut_mapping
else xys.pop(0) * (b[1] - b[0]) + b[0]
)
for i, b in enumerate(self._bbox)
]

Expand Down
6 changes: 3 additions & 3 deletions adaptive/runner.py
Expand Up @@ -470,7 +470,7 @@ def __init__(
npoints_goal: int | None = None,
end_time_goal: datetime | None = None,
duration_goal: timedelta | int | float | None = None,
executor: (ExecutorTypes | None) = None,
executor: ExecutorTypes | None = None,
ntasks: int | None = None,
log: bool = False,
shutdown_executor: bool = False,
Expand Down Expand Up @@ -629,7 +629,7 @@ def __init__(
npoints_goal: int | None = None,
end_time_goal: datetime | None = None,
duration_goal: timedelta | int | float | None = None,
executor: (ExecutorTypes | None) = None,
executor: ExecutorTypes | None = None,
ntasks: int | None = None,
log: bool = False,
shutdown_executor: bool = False,
Expand Down Expand Up @@ -956,7 +956,7 @@ def _ensure_executor(executor: ExecutorTypes | None) -> concurrent.Executor:


def _get_ncores(
ex: (ExecutorTypes),
ex: ExecutorTypes,
) -> int:
"""Return the maximum number of cores that an executor can use."""
if with_ipyparallel:
Expand Down

0 comments on commit a292a1b

Please sign in to comment.