Skip to content

Commit 6f11ad6

Browse files
committed
rename datetime_goal to end_time_goal
1 parent ae6ab64 commit 6f11ad6

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

adaptive/runner.py

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ class BaseRunner(metaclass=abc.ABCMeta):
8484
Convenience argument, use instead of ``goal``. The end condition for the
8585
calculation. Stop when the number of points is larger or
8686
equal than this value.
87-
datetime_goal : datetime, optional
87+
end_time_goal : datetime, optional
8888
Convenience argument, use instead of ``goal``. The end condition for the
8989
calculation. Stop when the current time is larger or equal than this
9090
value.
@@ -147,7 +147,7 @@ def __init__(
147147
*,
148148
loss_goal: float | None = None,
149149
npoints_goal: int | None = None,
150-
datetime_goal: datetime | None = None,
150+
end_time_goal: datetime | None = None,
151151
duration_goal: timedelta | None = None,
152152
executor=None,
153153
ntasks=None,
@@ -164,7 +164,7 @@ def __init__(
164164
goal,
165165
loss_goal,
166166
npoints_goal,
167-
datetime_goal,
167+
end_time_goal,
168168
duration_goal,
169169
allow_running_forever,
170170
)
@@ -422,7 +422,7 @@ def __init__(
422422
*,
423423
loss_goal: float | None = None,
424424
npoints_goal: int | None = None,
425-
datetime_goal: datetime | None = None,
425+
end_time_goal: datetime | None = None,
426426
duration_goal: timedelta | None = None,
427427
executor=None,
428428
ntasks=None,
@@ -438,7 +438,7 @@ def __init__(
438438
goal=goal,
439439
loss_goal=loss_goal,
440440
npoints_goal=npoints_goal,
441-
datetime_goal=datetime_goal,
441+
end_time_goal=end_time_goal,
442442
duration_goal=duration_goal,
443443
executor=executor,
444444
ntasks=ntasks,
@@ -503,7 +503,7 @@ class AsyncRunner(BaseRunner):
503503
Convenience argument, use instead of ``goal``. The end condition for the
504504
calculation. Stop when the number of points is larger or
505505
equal than this value.
506-
datetime_goal : datetime, optional
506+
end_time_goal : datetime, optional
507507
Convenience argument, use instead of ``goal``. The end condition for the
508508
calculation. Stop when the current time is larger or equal than this
509509
value.
@@ -580,7 +580,7 @@ def __init__(
580580
*,
581581
loss_goal: float | None = None,
582582
npoints_goal: int | None = None,
583-
datetime_goal: datetime | None = None,
583+
end_time_goal: datetime | None = None,
584584
duration_goal: timedelta | None = None,
585585
executor=None,
586586
ntasks=None,
@@ -612,7 +612,7 @@ def __init__(
612612
goal=goal,
613613
loss_goal=loss_goal,
614614
npoints_goal=npoints_goal,
615-
datetime_goal=datetime_goal,
615+
end_time_goal=end_time_goal,
616616
duration_goal=duration_goal,
617617
executor=executor,
618618
ntasks=ntasks,
@@ -799,7 +799,7 @@ def simple(
799799
*,
800800
loss_goal: float | None = None,
801801
npoints_goal: int | None = None,
802-
datetime_goal: datetime | None = None,
802+
end_time_goal: datetime | None = None,
803803
duration_goal: timedelta | None = None,
804804
):
805805
"""Run the learner until the goal is reached.
@@ -827,7 +827,7 @@ def simple(
827827
Convenience argument, use instead of ``goal``. The end condition for the
828828
calculation. Stop when the number of points is larger or
829829
equal than this value.
830-
datetime_goal : datetime, optional
830+
end_time_goal : datetime, optional
831831
Convenience argument, use instead of ``goal``. The end condition for the
832832
calculation. Stop when the current time is larger or equal than this
833833
value.
@@ -841,7 +841,7 @@ def simple(
841841
goal,
842842
loss_goal,
843843
npoints_goal,
844-
datetime_goal,
844+
end_time_goal,
845845
duration_goal,
846846
allow_running_forever=False,
847847
)
@@ -990,7 +990,7 @@ def auto_goal(
990990
*,
991991
loss: float | None = None,
992992
npoints: int | None = None,
993-
datetime: datetime | None = None,
993+
end_time: datetime | None = None,
994994
duration: timedelta | int | None = None,
995995
learner: BaseLearner | None = None,
996996
allow_running_forever: bool = True,
@@ -1003,7 +1003,7 @@ def auto_goal(
10031003
TODO
10041004
npoints
10051005
TODO
1006-
datetime
1006+
end_time
10071007
TODO
10081008
duration
10091009
TODO
@@ -1020,14 +1020,14 @@ def auto_goal(
10201020
kw = dict(
10211021
loss=loss,
10221022
npoints=npoints,
1023-
datetime=datetime,
1023+
end_time=end_time,
10241024
duration=duration,
10251025
allow_running_forever=allow_running_forever,
10261026
)
1027-
opts = (loss, npoints, datetime, duration) # all are mutually exclusive
1027+
opts = (loss, npoints, end_time, duration) # all are mutually exclusive
10281028
if sum(v is not None for v in opts) > 1:
10291029
raise ValueError(
1030-
"Only one of loss, npoints, datetime, duration can be specified."
1030+
"Only one of loss, npoints, end_time, duration can be specified."
10311031
)
10321032

10331033
if loss is not None:
@@ -1040,8 +1040,8 @@ def auto_goal(
10401040
return lambda learner: all(goal(l) for l, goal in zip(learner.learners, goals))
10411041
if npoints is not None:
10421042
return lambda learner: learner.npoints >= npoints
1043-
if datetime is not None:
1044-
return _TimeGoal(datetime)
1043+
if end_time is not None:
1044+
return _TimeGoal(end_time)
10451045
if duration is not None:
10461046
return _TimeGoal(duration)
10471047
if isinstance(learner, DataSaver):
@@ -1066,7 +1066,7 @@ def _goal(
10661066
goal: Callable[[BaseLearner], bool] | None,
10671067
loss_goal: float | None,
10681068
npoints_goal: int | None,
1069-
datetime_goal: datetime | None,
1069+
end_time_goal: datetime | None,
10701070
duration_goal: timedelta | None,
10711071
allow_running_forever: bool,
10721072
):
@@ -1076,18 +1076,18 @@ def _goal(
10761076
if goal is not None and (
10771077
loss_goal is not None
10781078
or npoints_goal is not None
1079-
or datetime_goal is not None
1079+
or end_time_goal is not None
10801080
or duration_goal is not None
10811081
):
10821082
raise ValueError(
1083-
"Either goal, loss_goal, npoints_goal, datetime_goal or"
1083+
"Either goal, loss_goal, npoints_goal, end_time_goal or"
10841084
" duration_goal can be specified, not multiple."
10851085
)
10861086
return auto_goal(
10871087
learner=learner,
10881088
loss=loss_goal,
10891089
npoints=npoints_goal,
1090-
datetime=datetime_goal,
1090+
end_time=end_time_goal,
10911091
duration=duration_goal,
10921092
allow_running_forever=allow_running_forever,
10931093
)

0 commit comments

Comments
 (0)