Skip to content

Commit

Permalink
misc: minor update on docstring (#69)
Browse files Browse the repository at this point in the history
The docstring on WorldCommunicator class is misleading. The docstring
was revised.
  • Loading branch information
myungjin authored Aug 8, 2024
1 parent 53dbf84 commit 626df78
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions multiworld/world_communicator.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,7 @@ def __str__(self):


class WorldCommunicator:
"""
Class to manage communication between different worlds.
NOTE: If using WorldCommunicationManager, use the API provided
by the WorldCommunicator to create and manage worlds along with
their communication links. Do not use the WorldManager API directly.
"""
"""Class to manage communication for different worlds."""

def __init__(self, world_manager: WorldManager):
"""Initialize a class instance."""
Expand All @@ -77,11 +71,19 @@ def __del__(self):
del self._broken_world

def add_world(self, world_name) -> None:
"""Add a new world to the world comm manager."""
"""Add a new world to the world communicator.
This method shouldn't be called directly by a user program.
WorldManager will use this method.
"""
self._broken_world[world_name] = False

def remove_world(self, world_name) -> None:
"""Remove a world from the world comm manager."""
"""Remove a world from the world communicator.
This method shouldn't be called directly by a user program.
WorldManager will use this method.
"""
logger.debug(f"remove world {world_name}")
try:
self._broken_world[world_name] = True
Expand Down

0 comments on commit 626df78

Please sign in to comment.