@@ -54,14 +54,13 @@ def __init__(
54
54
}
55
55
)
56
56
self ._config_full : dict = config_input .data
57
- config_intermediate , _ = walk_key_path (self ._config_full , key_path or [])
58
- self ._platform = config_intermediate .get ("platform" )
57
+ self ._config_intermediate , _ = walk_key_path (self ._config_full , key_path or [])
59
58
try :
60
- self ._config : dict = config_intermediate [self .driver_name ]
59
+ self ._config : dict = self . _config_intermediate [self .driver_name ]
61
60
except KeyError as e :
62
61
raise UWConfigError ("Required '%s' block missing in config" % self .driver_name ) from e
63
62
if controller :
64
- self ._config [STR .rundir ] = config_intermediate [controller ][STR .rundir ]
63
+ self ._config [STR .rundir ] = self . _config_intermediate [controller ][STR .rundir ]
65
64
self ._validate (schema_file )
66
65
dryrun (enable = dry_run )
67
66
@@ -200,10 +199,10 @@ def _validate(self, schema_file: Optional[Path] = None) -> None:
200
199
:raises: UWConfigError if config fails validation.
201
200
"""
202
201
if schema_file :
203
- validate_external (schema_file = schema_file , config = self .config_full )
202
+ validate_external (schema_file = schema_file , config = self ._config_intermediate )
204
203
else :
205
204
validate_internal (
206
- schema_name = self .driver_name .replace ("_" , "-" ), config = self .config_full
205
+ schema_name = self .driver_name .replace ("_" , "-" ), config = self ._config_intermediate
207
206
)
208
207
209
208
@@ -390,13 +389,13 @@ def _run_resources(self) -> dict[str, Any]:
390
389
"""
391
390
Returns platform configuration data.
392
391
"""
393
- if not self ._platform :
392
+ if not ( platform := self ._config_intermediate . get ( "platform" )) :
394
393
raise UWConfigError ("Required 'platform' block missing in config" )
395
394
threads = self .config .get (STR .execution , {}).get (STR .threads )
396
395
return {
397
- STR .account : self . _platform [STR .account ],
396
+ STR .account : platform [STR .account ],
398
397
STR .rundir : self .rundir ,
399
- STR .scheduler : self . _platform [STR .scheduler ],
398
+ STR .scheduler : platform [STR .scheduler ],
400
399
STR .stdout : "%s.out" % self ._runscript_path .name , # config may override
401
400
** ({STR .threads : threads } if threads else {}),
402
401
** self .config .get (STR .execution , {}).get (STR .batchargs , {}),
@@ -481,10 +480,10 @@ def _validate(self, schema_file: Optional[Path] = None) -> None:
481
480
:raises: UWConfigError if config fails validation.
482
481
"""
483
482
if schema_file :
484
- validate_external (schema_file = schema_file , config = self .config_full )
483
+ validate_external (schema_file = schema_file , config = self ._config_intermediate )
485
484
else :
486
485
validate_internal (
487
- schema_name = self .driver_name .replace ("_" , "-" ), config = self .config_full
486
+ schema_name = self .driver_name .replace ("_" , "-" ), config = self ._config_intermediate
488
487
)
489
488
validate_internal (schema_name = STR .platform , config = self .config_full )
490
489
0 commit comments