Skip to content

Commit

Permalink
[Doc] Fix broken references in Ray Core documentation
Browse files Browse the repository at this point in the history
Signed-off-by: pdmurray <[email protected]>
  • Loading branch information
peytondmurray committed Jun 3, 2024
1 parent 18acf02 commit b7ff3cd
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 68 deletions.
4 changes: 4 additions & 0 deletions doc/source/ray-core/api/utility.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ Utility
ray.cluster_resources
ray.available_resources

.. Other docs have references to these
ray.util.queue.Empty
ray.util.queue.Full

.. _custom-metric-api-ref:

Custom Metrics
Expand Down
2 changes: 1 addition & 1 deletion doc/source/ray-core/scheduling/placement-group.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ A **placement group** reserves the resources from the cluster. The reserved reso
Create a Placement Group (Reserve Resources)
--------------------------------------------

You can create a placement group using :func:`ray.util.placement_group() <ray.util.placement_group.placement_group>`.
You can create a placement group using :func:`ray.util.placement_group`.
Placement groups take in a list of bundles and a :ref:`placement strategy <pgroup-strategy>`.
Note that each bundle must be able to fit on a single node on the Ray cluster.
For example, if you only have a 8 CPU node, and if you have a bundle that requires ``{"CPU": 9}``,
Expand Down
26 changes: 14 additions & 12 deletions doc/source/ray-more-libs/dask-on-ray.rst
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,7 @@ The following Ray-specific callbacks are provided:
6. :code:`ray_finish(result)`: Run after all Ray tasks have finished
executing and the final result has been returned.

See the docstring for
:meth:`RayDaskCallback.__init__() <ray.util.dask.callbacks.RayDaskCallback>.__init__`
See the docstring for :class:`~ray.util.dask.RayDaskCallback`
for further details about these callbacks, their arguments, and their return
values.

Expand Down Expand Up @@ -272,14 +271,17 @@ execution time exceeds some user-defined threshold:

This callback API is currently unstable and subject to change.

API
---

.. autosummary::
:nosignatures:
:toctree: doc/

ray.util.dask.callbacks.RayDaskCallback
ray.util.dask.callbacks.RayDaskCallback._ray_presubmit
ray.util.dask.callbacks.RayDaskCallback._ray_postsubmit
ray.util.dask.callbacks.RayDaskCallback._ray_pretask
ray.util.dask.callbacks.RayDaskCallback._ray_posttask
ray.util.dask.callbacks.RayDaskCallback._ray_postsubmit_all
ray.util.dask.callbacks.RayDaskCallback._ray_finish
:nosignatures:
:toctree: doc/

~ray.util.dask.RayDaskCallback
~ray.util.dask.callbacks.RayDaskCallback._ray_presubmit
~ray.util.dask.callbacks.RayDaskCallback._ray_postsubmit
~ray.util.dask.callbacks.RayDaskCallback._ray_pretask
~ray.util.dask.callbacks.RayDaskCallback._ray_posttask
~ray.util.dask.callbacks.RayDaskCallback._ray_postsubmit_all
~ray.util.dask.callbacks.RayDaskCallback._ray_finish
4 changes: 2 additions & 2 deletions doc/source/ray-references/glossary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -459,13 +459,13 @@ documentation, sorted alphabetically.
RolloutWorkers are used as ``@ray.remote`` actors to collect and return samples
from environments or offline files in parallel. An RLlib
:py:class:`~ray.rllib.algorithms.algorithm.Algorithm` usually has
``num_workers`` :py:class:`~ray.rllib.env.env_runner.EnvRunner`s plus a
``num_workers`` :py:class:`~ray.rllib.env.env_runner.EnvRunner` instances plus a
single "local" :py:class:`~ray.rllib.env.env_runner.EnvRunner` (not ``@ray.remote``) in
its :py:class:`~ray.rllib.env.env_runner_group.EnvRunnerGroup` under ``self.workers``.

Depending on its evaluation config settings, an additional
:py:class:`~ray.rllib.env.env_runner_group.EnvRunnerGroup` with
:py:class:`~ray.rllib.env.env_runner.EnvRunner`s for evaluation may be present in the
:py:class:`~ray.rllib.env.env_runner.EnvRunner` instances for evaluation may be present in the
:py:class:`~ray.rllib.algorithms.algorithm.Algorithm`
under ``self.evaluation_workers``.

Expand Down
12 changes: 6 additions & 6 deletions python/ray/_private/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -2708,14 +2708,14 @@ def put(
@PublicAPI
@client_mode_hook
def wait(
ray_waitables: List[Union["ObjectRef[R]", "ObjectRefGenerator[R]"]],
ray_waitables: Union[ObjectRef, ObjectRefGenerator],
*,
num_returns: int = 1,
timeout: Optional[float] = None,
fetch_local: bool = True,
) -> Tuple[
List[Union["ObjectRef[R]", "ObjectRefGenerator[R]"]],
List[Union["ObjectRef[R]", "ObjectRefGenerator[R]"]],
List[Union[ObjectRef, ObjectRefGenerator]],
List[Union[ObjectRef, ObjectRefGenerator]],
]:
"""Return a list of IDs that are ready and a list of IDs that are not.
Expand All @@ -2724,8 +2724,8 @@ def wait(
is not set, the function simply waits until that number of objects is ready
and returns that exact number of object refs.
`ray_waitables` is a list of :class:`~ObjectRef` and
:class:`~ObjectRefGenerator`.
`ray_waitables` is a list of :class:`~ray.ObjectRef` and
:class:`~ray.ObjectRefGenerator`.
The method returns two lists, ready and unready `ray_waitables`.
Expand Down Expand Up @@ -2873,7 +2873,7 @@ def get_actor(name: str, namespace: Optional[str] = None) -> "ray.actor.ActorHan
ActorHandle to the actor.
Raises:
ValueError if the named actor does not exist.
ValueError: if the named actor does not exist.
"""
if not name:
raise ValueError("Please supply a non-empty value to get_actor")
Expand Down
3 changes: 2 additions & 1 deletion python/ray/air/integrations/mlflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,8 @@ class MLflowLoggerCallback(LoggerCallback):
Keep in mind that the callback will open an MLflow session on the driver and
not on the trainable. Therefore, it is not possible to call MLflow functions
like ``mlflow.log_figure()`` inside the trainable as there is no MLflow session
on the trainable. For more fine grained control, use :func:`setup_mlflow`.
on the trainable. For more fine grained control, use
:func:`ray.air.integrations.mlflow.setup_mlflow`.
Args:
tracking_uri: The tracking URI for where to manage experiments
Expand Down
4 changes: 2 additions & 2 deletions python/ray/util/actor_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ def get_next(self, timeout=None, ignore_if_timedout=False):
The next result.
Raises:
TimeoutError if the timeout is reached.
TimeoutError: if the timeout is reached.
Examples:
.. testcode::
Expand Down Expand Up @@ -320,7 +320,7 @@ def get_next_unordered(self, timeout=None, ignore_if_timedout=False):
The next result.
Raises:
TimeoutError if the timeout is reached.
TimeoutError: if the timeout is reached.
Examples:
.. testcode::
Expand Down
6 changes: 3 additions & 3 deletions python/ray/util/placement_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,9 @@ def placement_group(
This currently only works with STRICT_PACK pg.
Raises:
ValueError if bundle type is not a list.
ValueError if empty bundle or empty resource bundles are given.
ValueError if the wrong lifetime arguments are given.
ValueError: if bundle type is not a list.
ValueError: if empty bundle or empty resource bundles are given.
ValueError: if the wrong lifetime arguments are given.
Return:
PlacementGroup: Placement group object.
Expand Down
62 changes: 21 additions & 41 deletions python/ray/util/state/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -569,8 +569,7 @@ def get_actor(
:class:`ActorState <ray.util.state.common.ActorState>`.
Raises:
Exceptions: :class:`RayStateApiException <ray.util.state.exception.RayStateApiException>` if the CLI
failed to query the data.
RayStateApiException: if the CLI failed to query the data.
""" # noqa: E501
return StateApiClient(address=address).get(
StateResource.ACTORS, id, GetApiOptions(timeout=timeout), _explain=_explain
Expand Down Expand Up @@ -599,8 +598,7 @@ def get_job(
:class:`JobState <ray.util.state.common.JobState>`.
Raises:
Exceptions: :class:`RayStateApiException <ray.util.state.exception.RayStateApiException>` if the CLI
failed to query the data.
RayStateApiException: if the CLI failed to query the data.
""" # noqa: E501
return StateApiClient(address=address).get(
StateResource.JOBS,
Expand Down Expand Up @@ -632,8 +630,7 @@ def get_placement_group(
:class:`~ray.util.state.common.PlacementGroupState`.
Raises:
Exceptions: :class:`RayStateApiException <ray.util.state.exception.RayStateApiException>` if the CLI
failed to query the data.
RayStateApiException: if the CLI failed to query the data.
""" # noqa: E501
return StateApiClient(address=address).get(
StateResource.PLACEMENT_GROUPS,
Expand Down Expand Up @@ -665,8 +662,7 @@ def get_node(
:class:`NodeState <ray.util.state.common.NodeState>`.
Raises:
Exceptions: :class:`RayStateApiException <ray.util.state.exception.RayStateApiException>`
if the CLI is failed to query the data.
RayStateApiException: if the CLI is failed to query the data.
""" # noqa: E501
return StateApiClient(address=address).get(
StateResource.NODES,
Expand Down Expand Up @@ -698,8 +694,7 @@ def get_worker(
:class:`WorkerState <ray.util.state.common.WorkerState>`.
Raises:
Exceptions: :class:`RayStateApiException <ray.util.state.exception.RayStateApiException>` if the CLI
failed to query the data.
RayStateApiException: if the CLI failed to query the data.
""" # noqa: E501
return StateApiClient(address=address).get(
StateResource.WORKERS,
Expand Down Expand Up @@ -732,8 +727,7 @@ def get_task(
from the task attempts.
Raises:
Exceptions: :class:`RayStateApiException <ray.util.state.exception.RayStateApiException>` if the CLI
failed to query the data.
RayStateApiException: if the CLI failed to query the data.
""" # noqa: E501
str_id: str
if isinstance(id, str):
Expand Down Expand Up @@ -773,8 +767,7 @@ def get_objects(
:class:`~ray.util.state.common.ObjectState`.
Raises:
Exceptions: :class:`RayStateApiException <ray.util.state.exception.RayStateApiException>` if the CLI
failed to query the data.
RayStateApiException: if the CLI failed to query the data.
""" # noqa: E501
return StateApiClient(address=address).get(
StateResource.OBJECTS,
Expand Down Expand Up @@ -817,8 +810,7 @@ def list_actors(
:class:`ActorState <ray.util.state.common.ActorState>`.
Raises:
Exceptions: :class:`RayStateApiException <ray.util.state.exception.RayStateApiException>` if the CLI
failed to query the data.
RayStateApiException: if the CLI failed to query the data.
""" # noqa: E501
return StateApiClient(address=address).list(
StateResource.ACTORS,
Expand Down Expand Up @@ -865,8 +857,7 @@ def list_placement_groups(
List of :class:`~ray.util.state.common.PlacementGroupState`.
Raises:
Exceptions: :class:`RayStateApiException <ray.util.state.exception.RayStateApiException>` if the CLI
failed to query the data.
RayStateApiException: if the CLI failed to query the data.
""" # noqa: E501
return StateApiClient(address=address).list(
StateResource.PLACEMENT_GROUPS,
Expand Down Expand Up @@ -911,8 +902,7 @@ def list_nodes(
:class:`NodeState <ray.util.state.common.NodeState>`.
Raises:
Exceptions: :class:`RayStateApiException <ray.util.state.exception.RayStateApiException>`
if the CLI failed to query the data.
RayStateApiException: if the CLI failed to query the data.
""" # noqa: E501
return StateApiClient(address=address).list(
StateResource.NODES,
Expand Down Expand Up @@ -957,8 +947,7 @@ def list_jobs(
:class:`JobState <ray.util.state.common.JobState>`.
Raises:
Exceptions: :class:`RayStateApiException <ray.util.state.exception.RayStateApiException>` if the CLI
failed to query the data.
RayStateApiException: if the CLI failed to query the data.
""" # noqa: E501
return StateApiClient(address=address).list(
StateResource.JOBS,
Expand Down Expand Up @@ -1003,8 +992,7 @@ def list_workers(
:class:`WorkerState <ray.util.state.common.WorkerState>`.
Raises:
Exceptions: :class:`RayStateApiException <ray.util.state.exception.RayStateApiException>` if the CLI
failed to query the data.
RayStateApiException: if the CLI failed to query the data.
""" # noqa: E501
return StateApiClient(address=address).list(
StateResource.WORKERS,
Expand Down Expand Up @@ -1049,8 +1037,7 @@ def list_tasks(
:class:`TaskState <ray.util.state.common.TaskState>`.
Raises:
Exceptions: :class:`RayStateApiException <ray.util.state.exception.RayStateApiException>` if the CLI
failed to query the data.
RayStateApiException: if the CLI failed to query the data.
""" # noqa: E501
return StateApiClient(address=address).list(
StateResource.TASKS,
Expand Down Expand Up @@ -1095,8 +1082,7 @@ def list_objects(
:class:`ObjectState <ray.util.state.common.ObjectState>`.
Raises:
Exceptions: :class:`RayStateApiException <ray.util.state.exception.RayStateApiException>` if the CLI
failed to query the data.
RayStateApiException: if the CLI failed to query the data.
""" # noqa: E501
return StateApiClient(address=address).list(
StateResource.OBJECTS,
Expand Down Expand Up @@ -1141,8 +1127,7 @@ def list_runtime_envs(
:class:`RuntimeEnvState <ray.util.state.common.RuntimeEnvState>`.
Raises:
Exceptions: :class:`RayStateApiException <ray.util.state.exception.RayStateApiException>`
if the CLI failed to query the data.
RayStateApiException: if the CLI failed to query the data.
""" # noqa: E501
return StateApiClient(address=address).list(
StateResource.RUNTIME_ENVS,
Expand Down Expand Up @@ -1260,8 +1245,7 @@ def get_log(
A Generator of log line, None for SendType and ReturnType.
Raises:
Exceptions: :class:`RayStateApiException <ray.util.state.exception.RayStateApiException>` if the CLI
failed to query the data.
RayStateApiException: if the CLI failed to query the data.
""" # noqa: E501

api_server_url = ray_address_to_api_server_url(address)
Expand Down Expand Up @@ -1336,9 +1320,8 @@ def list_logs(
values are list of log filenames.
Raises:
Exceptions: :class:`RayStateApiException <ray.util.state.exception.RayStateApiException>` if the CLI
failed to query the data, or ConnectionError if failed to resolve the
ray address.
RayStateApiException: if the CLI failed to query the data, or ConnectionError if
failed to resolve the ray address.
""" # noqa: E501
assert (
node_ip is not None or node_id is not None
Expand Down Expand Up @@ -1401,8 +1384,7 @@ def summarize_tasks(
:class:`~ray.util.state.common.TaskSummaries`
Raises:
Exceptions: :class:`RayStateApiException <ray.util.state.exception.RayStateApiException>`
if the CLI is failed to query the data.
RayStateApiException: if the CLI is failed to query the data.
""" # noqa: E501
return StateApiClient(address=address).summary(
SummaryResource.TASKS,
Expand Down Expand Up @@ -1435,8 +1417,7 @@ def summarize_actors(
:class:`~ray.util.state.common.ActorSummaries`
Raises:
Exceptions: :class:`RayStateApiException <ray.util.state.exception.RayStateApiException>` if the CLI
failed to query the data.
RayStateApiException: if the CLI failed to query the data.
""" # noqa: E501
return StateApiClient(address=address).summary(
SummaryResource.ACTORS,
Expand Down Expand Up @@ -1468,8 +1449,7 @@ def summarize_objects(
Dictionarified :class:`~ray.util.state.common.ObjectSummaries`
Raises:
Exceptions: :class:`RayStateApiException <ray.util.state.exception.RayStateApiException>` if the CLI
failed to query the data.
RayStateApiException: if the CLI failed to query the data.
""" # noqa: E501
return StateApiClient(address=address).summary(
SummaryResource.OBJECTS,
Expand Down

0 comments on commit b7ff3cd

Please sign in to comment.