diff --git a/HISTORY.md b/HISTORY.md index f2828d76b..865404e17 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -23,6 +23,7 @@ - Switch from std to var in arm tutorial ({pr}`486`) - Fix documentation conf for readthedocs deprecations ({pr}`485`) - Add novelty search with CMA-ES to sphere example ({pr}`478`, {pr}`482`) +- Clarify errors in scheduler docstrings ({pr}`488`) #### Improvements diff --git a/ribs/schedulers/_bandit_scheduler.py b/ribs/schedulers/_bandit_scheduler.py index b35d18584..ac27f92b6 100644 --- a/ribs/schedulers/_bandit_scheduler.py +++ b/ribs/schedulers/_bandit_scheduler.py @@ -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 " + @@ -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. """ diff --git a/ribs/schedulers/_scheduler.py b/ribs/schedulers/_scheduler.py index b973d114c..bc5cec373 100644 --- a/ribs/schedulers/_scheduler.py +++ b/ribs/schedulers/_scheduler.py @@ -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 " + @@ -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 " + @@ -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": @@ -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. """