Skip to content

Commit f6fce16

Browse files
committed
ruffed
1 parent 1353fb6 commit f6fce16

File tree

1 file changed

+7
-5
lines changed
  • packages/common/src/weathergen/common

1 file changed

+7
-5
lines changed

packages/common/src/weathergen/common/config.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def load_model_config(run_id: str, epoch: int | None, model_path: str | None) ->
8686
json_str = f.read()
8787

8888
config = OmegaConf.create(json.loads(json_str))
89-
89+
9090
return _backward_compatibility(config)
9191

9292

@@ -99,20 +99,22 @@ def _get_model_config_file_name(run_id: str, epoch: int | None):
9999
epoch_str = f"_epoch{epoch:05d}"
100100
return f"model_{run_id}{epoch_str}.json"
101101

102+
102103
def _backward_compatibility(config: Config):
103104
"""
104105
Guarantee temporary backward compatibiltiy for config.
105-
106+
106107
This method should act as a central hook to implement backward
107108
compatibility fixes. This is needed to run inference/continuing from
108-
"outdatet" run configurations. The fixes in this function should be
109+
"outdatet" run configurations. The fixes in this function should be
109110
eventually removed.
110111
"""
111-
if not config.log_intervals: # TODO remove this for next version
112+
if not config.log_intervals: # TODO remove this for next version
112113
config.log_intervals = OmegaConf.construct(
113-
{"checkpoint":250, "terminal":10, "metrics": config.train_log.log_interval}
114+
{"checkpoint": 250, "terminal": 10, "metrics": config.train_log.log_interval}
114115
)
115116

117+
116118
def load_config(
117119
private_home: Path | None,
118120
from_run_id: str | None,

0 commit comments

Comments
 (0)