Skip to content

Commit 03a99a7

Browse files
pre-commit-ci[bot]basnijholt
authored andcommitted
[pre-commit.ci] pre-commit autoupdate (#398)
* [pre-commit.ci] pre-commit autoupdate updates: - [github.com/psf/black: 22.12.0 → 23.1.0](psf/black@22.12.0...23.1.0) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent fbfa191 commit 03a99a7

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ repos:
99
- id: debug-statements
1010
- id: check-ast
1111
- repo: https://github.com/psf/black
12-
rev: 22.12.0
12+
rev: 23.1.0
1313
hooks:
1414
- id: black
1515
- repo: https://github.com/asottile/pyupgrade

adaptive/learner/learner1D.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,8 @@ def vdim(self) -> int:
342342

343343
def to_numpy(self):
344344
"""Data as NumPy array of size ``(npoints, 2)`` if ``learner.function`` returns a scalar
345-
and ``(npoints, 1+vdim)`` if ``learner.function`` returns a vector of length ``vdim``."""
345+
and ``(npoints, 1+vdim)`` if ``learner.function`` returns a vector of length ``vdim``.
346+
"""
346347
return np.array([(x, *np.atleast_1d(y)) for x, y in sorted(self.data.items())])
347348

348349
def to_dataframe(

adaptive/learner/learner2D.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,8 @@ def xy_scale(self) -> np.ndarray:
407407

408408
def to_numpy(self):
409409
"""Data as NumPy array of size ``(npoints, 3)`` if ``learner.function`` returns a scalar
410-
and ``(npoints, 2+vdim)`` if ``learner.function`` returns a vector of length ``vdim``."""
410+
and ``(npoints, 2+vdim)`` if ``learner.function`` returns a vector of length ``vdim``.
411+
"""
411412
return np.array(
412413
[(x, y, *np.atleast_1d(z)) for (x, y), z in sorted(self.data.items())]
413414
)

adaptive/runner.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,6 @@ def __init__(
190190
raise_if_retries_exceeded: bool = True,
191191
allow_running_forever: bool = False,
192192
):
193-
194193
self.executor = _ensure_executor(executor)
195194
self.goal = _goal(
196195
learner,
@@ -638,7 +637,6 @@ def __init__(
638637
retries: int = 0,
639638
raise_if_retries_exceeded: bool = True,
640639
) -> None:
641-
642640
if (
643641
executor is None
644642
and _default_executor is concurrent.ProcessPoolExecutor
@@ -977,6 +975,7 @@ def _get_ncores(
977975

978976
# --- Useful runner goals
979977

978+
980979
# TODO: deprecate
981980
def stop_after(*, seconds=0, minutes=0, hours=0) -> Callable[[BaseLearner], bool]:
982981
"""Stop a runner after a specified time.

adaptive/tests/test_learner1d.py

-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ def f(x):
128128

129129

130130
def test_termination_on_discontinuities():
131-
132131
learner = _run_on_discontinuity(0, (-1, 1))
133132
smallest_interval = min(abs(a - b) for a, b in learner.losses.keys())
134133
assert smallest_interval >= np.finfo(float).eps

0 commit comments

Comments
 (0)