MCPcopy Create free account
hub / github.com/Project-MONAI/MONAI / read_config

Method read_config

monai/bundle/config_parser.py:514–528  ·  view source on GitHub ↗

Read the config from specified JSON/YAML file or a dictionary and override the config content in the `self.config` dictionary. Args: f: filepath of the config file, the content must be a dictionary, if providing a list of files, wil merge the con

(self, f: PathLike | Sequence[PathLike] | dict, **kwargs: Any)

Source from the content-addressed store, hash-verified

512 self.set(self.load_config_files(f, **kwargs), self.meta_key)
513
514 def read_config(self, f: PathLike | Sequence[PathLike] | dict, **kwargs: Any) -> None:
515 """
516 Read the config from specified JSON/YAML file or a dictionary and
517 override the config content in the `self.config` dictionary.
518
519 Args:
520 f: filepath of the config file, the content must be a dictionary,
521 if providing a list of files, wil merge the content of them.
522 if providing a dictionary directly, use it as config.
523 kwargs: other arguments for ``json.load`` or ``yaml.safe_load``, depends on the file format.
524
525 """
526 content = {self.meta_key: self.get(self.meta_key, {})}
527 content.update(self.load_config_files(f, **kwargs))
528 self.set(config=content)
529
530 def _do_resolve(self, config: Any, id: str = "") -> Any:
531 """

Callers 15

initializeMethod · 0.95
get_scoreMethod · 0.95
verify_net_in_outFunction · 0.95
onnx_exportFunction · 0.95
ckpt_exportFunction · 0.95
trt_exportFunction · 0.95
download_large_filesFunction · 0.95
load_bundle_configFunction · 0.95
test_transformsMethod · 0.95
test_onnx_exportMethod · 0.95
test_trainMethod · 0.95
test_evaluateMethod · 0.95

Calls 4

getMethod · 0.95
load_config_filesMethod · 0.95
setMethod · 0.95
updateMethod · 0.45

Tested by 10

test_transformsMethod · 0.76
test_onnx_exportMethod · 0.76
test_trainMethod · 0.76
test_evaluateMethod · 0.76
test_trt_exportMethod · 0.76
test_onnx_trt_exportMethod · 0.76
test_parse_json_raiseMethod · 0.76
test_parse_json_warnMethod · 0.76
test_exportMethod · 0.76
test_default_valueMethod · 0.76