Skip to content

Commit 41f3fd1

Browse files
authored
update_values() -> update_from() (#578)
1 parent 1365b39 commit 41f3fd1

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

src/uwtools/config/formats/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,10 +234,10 @@ def parse_include(self, ref_dict: Optional[dict] = None) -> None:
234234
elif isinstance(value, str):
235235
if m := re.match(r"^\s*%s\s+(.*)" % INCLUDE_TAG, value):
236236
filepaths = yaml.safe_load(m[1])
237-
self.update_values(self._load_paths(filepaths))
237+
self.update_from(self._load_paths(filepaths))
238238
del ref_dict[key]
239239

240-
def update_values(self, src: Union[dict, Config]) -> None:
240+
def update_from(self, src: Union[dict, Config]) -> None:
241241
"""
242242
Updates a config.
243243

src/uwtools/config/tools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ def _realize_config_update(
246246
log.debug("Initial input config depth: %s", input_obj.depth)
247247
log.debug("Update config depth: %s", update_obj.depth)
248248
config_check_depths_update(update_obj, input_obj.get_format())
249-
input_obj.update_values(update_obj)
249+
input_obj.update_from(update_obj)
250250
log.debug("Final input config depth: %s", input_obj.depth)
251251
return input_obj
252252

src/uwtools/drivers/driver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ def _create_user_updated_config(
139139
user_values = config_values.get(STR.updatevalues, {})
140140
if base_file := config_values.get(STR.basefile):
141141
cfgobj = config_class(base_file)
142-
cfgobj.update_values(user_values)
142+
cfgobj.update_from(user_values)
143143
cfgobj.dereference()
144144
config = cfgobj.data
145145
dump = partial(cfgobj.dump, path)

src/uwtools/tests/config/formats/test_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ def test_parse_include(config):
201201
assert len(config["config"]) == 2
202202

203203

204-
def test_update_values(config):
204+
def test_update_from(config):
205205
"""
206206
Test that a config object can be updated.
207207
"""

src/uwtools/tests/config/test_tools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def help_realize_config_fmt2fmt(input_file, input_format, update_file, update_fo
7474
)
7575
cfgclass = tools.format_to_config(input_format)
7676
cfgobj = cfgclass(input_file)
77-
cfgobj.update_values(cfgclass(update_file))
77+
cfgobj.update_from(cfgclass(update_file))
7878
reference = tmpdir / f"expected{ext}"
7979
cfgobj.dump(reference)
8080
assert compare_files(reference, output_file)

0 commit comments

Comments
 (0)