Skip to content

Commit

Permalink
consistent verb tenses for method docstrings (ray-project#38108)
Browse files Browse the repository at this point in the history
Signed-off-by: angelinalg <122562471+angelinalg@users.noreply.github.com>
Signed-off-by: e428265 <arvind.chandramouli@lmco.com>
  • Loading branch information
angelinalg authored and arvind-chandra committed Aug 31, 2023
1 parent 3ccedc8 commit a9aa320
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions python/ray/train/base_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ def _validate_attributes(self):

@classmethod
def _validate_scaling_config(cls, scaling_config: ScalingConfig) -> ScalingConfig:
"""Return scaling config dataclass after validating updated keys."""
"""Returns scaling config dataclass after validating updated keys."""
ensure_only_allowed_dataclass_keys_updated(
dataclass=scaling_config,
allowed_keys=cls._scaling_config_allowed_keys,
Expand All @@ -472,7 +472,7 @@ def _validate_scaling_config(cls, scaling_config: ScalingConfig) -> ScalingConfi

@classmethod
def _maybe_sync_down_trainer_state(cls, restore_path: str) -> Path:
"""Sync down trainer state from remote storage.
"""Syncs down trainer state from remote storage.
Returns:
str: Local directory containing the trainer state
Expand Down Expand Up @@ -682,7 +682,7 @@ def _extract_fields_for_tuner_param_space(self) -> Dict:
return result

def _generate_trainable_cls(self) -> Type["Trainable"]:
"""Generate the base Trainable class.
"""Generates the base Trainable class.
Returns:
A Trainable class to use for training.
Expand Down Expand Up @@ -732,7 +732,7 @@ def train_func(config):
dataset_context = None

class TrainTrainable(trainable_cls):
"""Add default resources to the Trainable."""
"""Adds default resources to the Trainable."""

_handles_checkpoint_freq = trainer_cls._handles_checkpoint_freq
_handles_checkpoint_at_end = trainer_cls._handles_checkpoint_at_end
Expand Down Expand Up @@ -826,7 +826,7 @@ def default_resource_request(cls, config):
return TrainTrainable

def as_trainable(self) -> Type["Trainable"]:
"""Convert self to a ``tune.Trainable`` class."""
"""Converts self to a ``tune.Trainable`` class."""
from ray import tune

base_config = self._param_dict
Expand Down
8 changes: 4 additions & 4 deletions python/ray/train/data_parallel_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ def training_loop(self) -> None:
)

def clear_lazy_checkpoint_marker():
"""Clear the stale lazy checkpointing marker on all worker nodes.
"""Clears the stale lazy checkpointing marker on all worker nodes.
After recovery, the trainer may be scheduled on another node.
We should delete the marker files created earlier on each node to
Expand Down Expand Up @@ -538,7 +538,7 @@ def clear_lazy_checkpoint_marker():
backend_executor.shutdown()

def get_dataset_config(self) -> DataConfig:
"""Return a copy of this Trainer's final dataset configs.
"""Returns a copy of this Trainer's final dataset configs.
Returns:
The merged default + user-supplied dataset config.
Expand All @@ -550,7 +550,7 @@ def get_dataset_config(self) -> DataConfig:

@repr_with_fallback(["ipywidgets", "8"])
def _repr_mimebundle_(self, **kwargs):
"""Return a mimebundle with an ipywidget repr and a simple text repr.
"""Returns a mimebundle with an ipywidget repr and a simple text repr.
Depending on the frontend where the data is being displayed,
different mimetypes will be used from this bundle.
Expand Down Expand Up @@ -656,7 +656,7 @@ def _datasets_repr_(self) -> str:
def _load_checkpoint_dict(
checkpoint: Checkpoint, trainer_name: str
) -> Tuple[Any, Optional["Preprocessor"]]:
"""Load a Ray Train Checkpoint (dict based).
"""Loads a Ray Train Checkpoint (dict based).
This is a private API.
Expand Down

0 comments on commit a9aa320

Please sign in to comment.