Skip to content

Commit

Permalink
style: fix pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaiejj committed Sep 3, 2024
1 parent 1699d45 commit 6f2f365
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ max-spelling-suggestions=4

# Spelling dictionary name. Available dictionaries: en_AU (hunspell), en_CA
# (hunspell), en_GB (hunspell), en_US (hunspell), en_ZA (hunspell).
; spelling-dict=en_US
spelling-dict=en_US

# List of comma separated words that should be considered directives if they
# appear at the beginning of a comment and should not be checked.
Expand Down
4 changes: 2 additions & 2 deletions omnisafe/common/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,10 @@ def __init__( # pylint: disable=too-many-arguments,too-many-locals
config=config,
)
if config is not None:
wandb.config.update(config)
wandb.config.update(config) # type: ignore
if models is not None:
for model in models:
wandb.watch(model)
wandb.watch(model) # type: ignore

def log(self, msg: str, color: str = 'green', bold: bool = False) -> None:
"""Log the message to the console and the file.
Expand Down
2 changes: 1 addition & 1 deletion omnisafe/common/offline/data_collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def register_agent(self, save_dir: str, model_name: str, size: int) -> None:

model_path = os.path.join(save_dir, 'torch_save', model_name)
try:
model_params = torch.load(model_path)
model_params = torch.load(model_path, weights_only=False)
except FileNotFoundError as error:
raise FileNotFoundError(f'Model {model_name} not found in {save_dir}') from error

Expand Down
2 changes: 1 addition & 1 deletion omnisafe/envs/classic_control/envs_from_crabs.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def _get_obs(self):
else:
return np.array([np.cos(th), np.sin(th), thdot], dtype=np.float32)

def reset(self):
def reset(self): # type: ignore
"""Reset the environment."""
self.state = self.init_state
self.last_u = None
Expand Down
2 changes: 1 addition & 1 deletion omnisafe/evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def __load_model_and_env(
# load the saved model
model_path = os.path.join(save_dir, 'torch_save', model_name)
try:
model_params = torch.load(model_path)
model_params = torch.load(model_path, weights_only=False)
except FileNotFoundError as error:
raise FileNotFoundError('The model is not found in the save directory.') from error

Expand Down

0 comments on commit 6f2f365

Please sign in to comment.