diff --git a/src/uwtools/config/formats/base.py b/src/uwtools/config/formats/base.py index 854449e11..dd22d9880 100644 --- a/src/uwtools/config/formats/base.py +++ b/src/uwtools/config/formats/base.py @@ -234,10 +234,10 @@ def parse_include(self, ref_dict: Optional[dict] = None) -> None: elif isinstance(value, str): if m := re.match(r"^\s*%s\s+(.*)" % INCLUDE_TAG, value): filepaths = yaml.safe_load(m[1]) - self.update_values(self._load_paths(filepaths)) + self.update_from(self._load_paths(filepaths)) del ref_dict[key] - def update_values(self, src: Union[dict, Config]) -> None: + def update_from(self, src: Union[dict, Config]) -> None: """ Updates a config. diff --git a/src/uwtools/config/tools.py b/src/uwtools/config/tools.py index dfda5b7cb..963b15313 100644 --- a/src/uwtools/config/tools.py +++ b/src/uwtools/config/tools.py @@ -246,7 +246,7 @@ def _realize_config_update( log.debug("Initial input config depth: %s", input_obj.depth) log.debug("Update config depth: %s", update_obj.depth) config_check_depths_update(update_obj, input_obj.get_format()) - input_obj.update_values(update_obj) + input_obj.update_from(update_obj) log.debug("Final input config depth: %s", input_obj.depth) return input_obj diff --git a/src/uwtools/drivers/driver.py b/src/uwtools/drivers/driver.py index c84abb088..8ef4d8774 100644 --- a/src/uwtools/drivers/driver.py +++ b/src/uwtools/drivers/driver.py @@ -139,7 +139,7 @@ def _create_user_updated_config( user_values = config_values.get(STR.updatevalues, {}) if base_file := config_values.get(STR.basefile): cfgobj = config_class(base_file) - cfgobj.update_values(user_values) + cfgobj.update_from(user_values) cfgobj.dereference() config = cfgobj.data dump = partial(cfgobj.dump, path) diff --git a/src/uwtools/tests/config/formats/test_base.py b/src/uwtools/tests/config/formats/test_base.py index fa2039b09..5d8bd2e14 100644 --- a/src/uwtools/tests/config/formats/test_base.py +++ b/src/uwtools/tests/config/formats/test_base.py @@ -201,7 +201,7 @@ def test_parse_include(config): assert len(config["config"]) == 2 -def test_update_values(config): +def test_update_from(config): """ Test that a config object can be updated. """ diff --git a/src/uwtools/tests/config/test_tools.py b/src/uwtools/tests/config/test_tools.py index 2964dbe30..c80be3d6d 100644 --- a/src/uwtools/tests/config/test_tools.py +++ b/src/uwtools/tests/config/test_tools.py @@ -74,7 +74,7 @@ def help_realize_config_fmt2fmt(input_file, input_format, update_file, update_fo ) cfgclass = tools.format_to_config(input_format) cfgobj = cfgclass(input_file) - cfgobj.update_values(cfgclass(update_file)) + cfgobj.update_from(cfgclass(update_file)) reference = tmpdir / f"expected{ext}" cfgobj.dump(reference) assert compare_files(reference, output_file)