Skip to content

Commit 600760f

Browse files
author
Vincent Moens
committed
[BE] Add trailing spaces when necessary
ghstack-source-id: 198b5b5 Pull Request resolved: #2581
1 parent 7829bd3 commit 600760f

File tree

10 files changed

+15
-15
lines changed

10 files changed

+15
-15
lines changed

torchrl/collectors/collectors.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,7 @@ def __init__(
726726
warnings.warn(
727727
f"frames_per_batch ({frames_per_batch}) is not exactly divisible by the number of batched environments ({self.n_env}), "
728728
f" this results in more frames_per_batch per iteration that requested"
729-
f" ({-(-frames_per_batch // self.n_env) * self.n_env})."
729+
f" ({-(-frames_per_batch // self.n_env) * self.n_env}). "
730730
"To silence this message, set the environment variable RL_WARNINGS to False."
731731
)
732732
self.requested_frames_per_batch = int(frames_per_batch)
@@ -1645,8 +1645,8 @@ def __init__(
16451645
remainder = total_frames % frames_per_batch
16461646
if remainder != 0 and RL_WARNINGS:
16471647
warnings.warn(
1648-
f"total_frames ({total_frames}) is not exactly divisible by frames_per_batch ({frames_per_batch})."
1649-
f"This means {frames_per_batch - remainder} additional frames will be collected."
1648+
f"total_frames ({total_frames}) is not exactly divisible by frames_per_batch ({frames_per_batch}). "
1649+
f"This means {frames_per_batch - remainder} additional frames will be collected. "
16501650
"To silence this message, set the environment variable RL_WARNINGS to False."
16511651
)
16521652
self.total_frames = (

torchrl/envs/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3202,7 +3202,7 @@ def __init__(
32023202
)
32033203
if len(args):
32043204
raise ValueError(
3205-
"`_EnvWrapper.__init__` received a non-empty args list of arguments."
3205+
"`_EnvWrapper.__init__` received a non-empty args list of arguments. "
32063206
"Make sure only keywords arguments are used when calling `super().__init__`."
32073207
)
32083208

torchrl/envs/libs/gym.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -905,7 +905,7 @@ def _build_env(
905905
)
906906
if isinstance(env, PixelObservationWrapper):
907907
raise TypeError(
908-
"PixelObservationWrapper cannot be used to wrap an environment"
908+
"PixelObservationWrapper cannot be used to wrap an environment "
909909
"that is already a PixelObservationWrapper instance."
910910
)
911911
except ModuleNotFoundError:

torchrl/envs/libs/meltingpot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ def _init_env(self):
344344

345345
def _set_seed(self, seed: int | None):
346346
raise NotImplementedError(
347-
"It is currently unclear how to set a seed in Meltingpot"
347+
"It is currently unclear how to set a seed in Meltingpot. "
348348
"see https://github.com/google-deepmind/meltingpot/issues/129 to track the issue."
349349
)
350350

torchrl/modules/tensordict_module/actors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1131,7 +1131,7 @@ def __init__(
11311131
):
11321132
if isinstance(action_space, TensorSpec):
11331133
raise RuntimeError(
1134-
"Using specs in action_space is deprecated."
1134+
"Using specs in action_space is deprecated. "
11351135
"Please use the 'spec' argument if you want to provide an action spec"
11361136
)
11371137
action_space, spec = _process_action_space_spec(action_space, spec)

torchrl/objectives/dqn.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,8 @@ def __init__(
223223
)
224224
if action_space is None:
225225
warnings.warn(
226-
"action_space was not specified. DQNLoss will default to 'one-hot'."
227-
"This behavior will be deprecated soon and a space will have to be passed."
226+
"action_space was not specified. DQNLoss will default to 'one-hot'. "
227+
"This behavior will be deprecated soon and a space will have to be passed. "
228228
"Check the DQNLoss documentation to see how to pass the action space. "
229229
)
230230
action_space = "one-hot"

torchrl/objectives/iql.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -764,8 +764,8 @@ def __init__(
764764
)
765765
if action_space is None:
766766
warnings.warn(
767-
"action_space was not specified. DiscreteIQLLoss will default to 'one-hot'."
768-
"This behavior will be deprecated soon and a space will have to be passed."
767+
"action_space was not specified. DiscreteIQLLoss will default to 'one-hot'. "
768+
"This behavior will be deprecated soon and a space will have to be passed. "
769769
"Check the DiscreteIQLLoss documentation to see how to pass the action space. "
770770
)
771771
action_space = "one-hot"

torchrl/objectives/sac.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1092,7 +1092,7 @@ def __init__(
10921092

10931093
if action_space is None:
10941094
warnings.warn(
1095-
"action_space was not specified. DiscreteSACLoss will default to 'one-hot'."
1095+
"action_space was not specified. DiscreteSACLoss will default to 'one-hot'. "
10961096
"This behavior will be deprecated soon and a space will have to be passed. "
10971097
"Check the DiscreteSACLoss documentation to see how to pass the action space. "
10981098
)

torchrl/record/recorder.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ def _apply_transform(self, observation: torch.Tensor) -> torch.Tensor:
199199
if self.center_crop:
200200
if not _has_tv:
201201
raise ImportError(
202-
"Could not import torchvision, `center_crop` not available."
202+
"Could not import torchvision, `center_crop` not available. "
203203
"Make sure torchvision is installed in your environment."
204204
)
205205
from torchvision.transforms.functional import (
@@ -212,7 +212,7 @@ def _apply_transform(self, observation: torch.Tensor) -> torch.Tensor:
212212
if self.make_grid and observation_trsf.ndimension() >= 4:
213213
if not _has_tv:
214214
raise ImportError(
215-
"Could not import torchvision, `make_grid` not available."
215+
"Could not import torchvision, `make_grid` not available. "
216216
"Make sure torchvision is installed in your environment."
217217
)
218218
from torchvision.utils import make_grid

torchrl/trainers/helpers/envs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def make_env_transforms(
116116
if from_pixels:
117117
if not cfg.catframes:
118118
raise RuntimeError(
119-
"this env builder currently only accepts positive catframes values"
119+
"this env builder currently only accepts positive catframes values "
120120
"when pixels are being used."
121121
)
122122
env.append_transform(ToTensorImage())

0 commit comments

Comments
 (0)