Skip to content

Commit

Permalink
Clarify errors in scheduler docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
btjanaka committed Nov 30, 2024
1 parent 0bc3372 commit c72ec85
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions ribs/schedulers/_bandit_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,8 @@ def ask(self):
(batch_size, dim) array: An array of n solutions to evaluate. Each
row contains a single solution.
Raises:
RuntimeError: This method was called without first calling
:meth:`tell`.
RuntimeError: This method was called immediately after calling an
ask method.
"""
if self._last_called == "ask":
raise RuntimeError("ask cannot be called immediately after " +
Expand Down Expand Up @@ -331,7 +331,7 @@ def tell(self, objective, measures, **fields):
argument should be an array with batch_size as the first
dimension.
Raises:
RuntimeError: This method is called without first calling
RuntimeError: This method was called without first calling
:meth:`ask`.
ValueError: One of the inputs has the wrong shape.
"""
Expand Down
14 changes: 7 additions & 7 deletions ribs/schedulers/_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ def ask_dqd(self):
(batch_size, dim) array: An array of n solutions to evaluate. Each
row contains a single solution.
Raises:
RuntimeError: This method was called without first calling
:meth:`tell`.
RuntimeError: This method was called immediately after calling an
ask method.
"""
if self._last_called in ["ask", "ask_dqd"]:
raise RuntimeError("ask_dqd cannot be called immediately after " +
Expand Down Expand Up @@ -185,8 +185,8 @@ def ask(self):
(batch_size, dim) array: An array of n solutions to evaluate. Each
row contains a single solution.
Raises:
RuntimeError: This method was called without first calling
:meth:`tell`.
RuntimeError: This method was called immediately after calling an
ask method.
"""
if self._last_called in ["ask", "ask_dqd"]:
raise RuntimeError("ask cannot be called immediately after " +
Expand Down Expand Up @@ -307,8 +307,8 @@ def tell_dqd(self, objective, measures, jacobian, **fields):
argument should be an array with batch_size as the first
dimension.
Raises:
RuntimeError: This method is called without first calling
:meth:`ask`.
RuntimeError: This method was called without first calling
:meth:`ask_dqd`.
ValueError: One of the inputs has the wrong shape.
"""
if self._last_called != "ask_dqd":
Expand Down Expand Up @@ -362,7 +362,7 @@ def tell(self, objective, measures, **fields):
argument should be an array with batch_size as the first
dimension.
Raises:
RuntimeError: This method is called without first calling
RuntimeError: This method was called without first calling
:meth:`ask`.
ValueError: One of the inputs has the wrong shape.
"""
Expand Down

0 comments on commit c72ec85

Please sign in to comment.