Skip to content

Commit d6013f9

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 1541cf5 commit d6013f9

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

training/src/anemoi/training/train/tasks/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,7 @@ def _normalize_batch(self, batch: torch.Tensor) -> torch.Tensor:
748748
Normalized batch
749749
"""
750750
for dataset_name in batch:
751-
batch[dataset_name] = self.model.pre_processors[dataset_name](batch[dataset_name]) # normalized in-place
751+
batch[dataset_name] = self.model.pre_processors[dataset_name](batch[dataset_name]) # normalized in-place
752752
return batch
753753

754754
def _prepare_loss_scalers(self) -> None:

training/src/anemoi/training/train/train.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,14 @@ def instanciate_wrapper(config: Any, *args, **kwargs) -> Any:
5454
target = "<no _target_>"
5555
try:
5656
return hydra_instantiate(config, *args, **kwargs)
57-
except Exception as e: # noqa
57+
except Exception as e:
5858
config_keys = str(target) + "+" + config_keys
59+
5960
def show_if_dict(v):
60-
if hasattr(v, "keys"): # must be a dict
61+
if hasattr(v, "keys"): # must be a dict
6162
return v.__class__.__name__ + f"({'+'.join(v.keys())})"
62-
else:
63-
return v.__class__.__name__
63+
return v.__class__.__name__
64+
6465
_args = ",".join(show_if_dict(a) for a in args)
6566
_kwargs = ",".join(f"{k}={show_if_dict(v)}" for k, v in kwargs.items())
6667
e.add_note(f"This exception happend when doing instanciate for config: {config}")

0 commit comments

Comments
 (0)