Skip to content

Commit

Permalink
docs: update API docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaiejj committed Aug 10, 2023
1 parent 5dcd9d1 commit 5db0586
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 9 deletions.
4 changes: 4 additions & 0 deletions omnisafe/adapter/offline_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ def reset(
) -> tuple[torch.Tensor, dict[str, Any]]:
"""Reset the environment and returns an initial observation.
Args:
seed (int, optional): The random seed. Defaults to None.
options (dict[str, Any], optional): The options for the environment. Defaults to None.
Returns:
observation: The initial observation of the space.
info: Some information logged by the environment.
Expand Down
4 changes: 4 additions & 0 deletions omnisafe/adapter/online_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,10 @@ def reset(
) -> tuple[torch.Tensor, dict[str, Any]]:
"""Reset the environment and returns an initial observation.
Args:
seed (int, optional): The random seed. Defaults to None.
options (dict[str, Any], optional): The options for the environment. Defaults to None.
Returns:
observation: The initial observation of the space.
info: Some information logged by the environment.
Expand Down
4 changes: 4 additions & 0 deletions omnisafe/adapter/saute_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ def reset(
.. note::
Additionally, the safety observation will be reset.
Args:
seed (int, optional): The random seed. Defaults to None.
options (dict[str, Any], optional): The options for the environment. Defaults to None.
Returns:
observation: The initial observation of the space.
info: Some information logged by the environment.
Expand Down
4 changes: 4 additions & 0 deletions omnisafe/adapter/simmer_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ def reset(
Additionally, the safety observation will be reset. And the safety budget will be reset
to the value of current ``rel_safety_budget``.
Args:
seed (int, optional): The random seed. Defaults to None.
options (dict[str, Any], optional): The options for the environment. Defaults to None.
Returns:
observation: The initial observation of the space.
info: Some information logged by the environment.
Expand Down
7 changes: 5 additions & 2 deletions omnisafe/envs/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ def reset(
"""Reset the environment and returns an initial observation.
Args:
seed (int or None): Seed for the environment. Defaults to None.
seed (int, optional): The random seed. Defaults to None.
options (dict[str, Any], optional): The options for the environment. Defaults to None.
Returns:
observation: The initial observation of the space.
Expand Down Expand Up @@ -249,7 +250,9 @@ def reset(
"""Reset the environment and returns an initial observation.
Args:
seed (int or None): Seed for the environment. Defaults to None.
seed (int, optional): The random seed. Defaults to None.
options (dict[str, Any], optional): The options for the environment. Defaults to None.
Returns:
observation: The initial observation of the space.
Expand Down
3 changes: 2 additions & 1 deletion omnisafe/envs/mujoco_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ def reset(
"""Reset the environment.
Args:
seed (int, optional): Seed to reset the environment. Defaults to None.
seed (int, optional): The random seed. Defaults to None.
options (dict[str, Any], optional): The options for the environment. Defaults to None.
Returns:
observation: Agent's observation of the current environment.
Expand Down
5 changes: 3 additions & 2 deletions omnisafe/envs/safety_gymnasium_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,9 @@ def reset(
"""Reset the environment.
Args:
seed (int or None, optional): Seed to reset the environment.
Defaults to None.
seed (int, optional): The random seed. Defaults to None.
options (dict[str, Any], optional): The options for the environment. Defaults to None.
Returns:
observation: Agent's observation of the current environment.
Expand Down
4 changes: 3 additions & 1 deletion omnisafe/envs/safety_gymnasium_modelbased.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,9 @@ def reset(
"""Reset the environment.
Args:
seed (int, optional): Seed to reset the environment. Defaults to None.
seed (int, optional): The random seed. Defaults to None.
options (dict[str, Any], optional): The options for the environment. Defaults to None.
Returns:
observation: The initial observation of the space.
Expand Down
9 changes: 6 additions & 3 deletions omnisafe/envs/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ def reset(
Additionally, the time step will be reset to 0.
Args:
seed (int or None, optional): The seed for the environment. Defaults to None.
seed (int, optional): The random seed. Defaults to None.
options (dict[str, Any], optional): The options for the environment. Defaults to None.
Returns:
observation: The initial observation of the space.
Expand Down Expand Up @@ -247,7 +248,8 @@ def reset(
"""Reset the environment and returns an initial observation.
Args:
seed (int or None, optional): Seed for the environment. Defaults to None.
seed (int, optional): The random seed. Defaults to None.
options (dict[str, Any], optional): The options for the environment. Defaults to None.
Returns:
observation: The initial observation of the space.
Expand Down Expand Up @@ -633,7 +635,8 @@ def reset(
The vector information will be unsqueezed to (1, dim) for agent training.
Args:
seed (int or None, optional): Set the seed for the environment. Defaults to None.
seed (int, optional): The random seed. Defaults to None.
options (dict[str, Any], optional): The options for the environment. Defaults to None.
Returns:
observation: The initial observation of the space.
Expand Down

0 comments on commit 5db0586

Please sign in to comment.