larch.DataTree.replace_datasets
larch.DataTree.replace_datasets¶
- DataTree.replace_datasets(other=None, validate=True, redigitize=True, **kwargs)[source]¶
Replace one or more datasets in the nodes of this tree.
- Parameters
other (Mapping[str,Dataset]) – A dictionary of replacement datasets.
validate (bool, default True) – Raise an error when replacing downstream datasets that are referenced by position, unless the replacement is identically sized. If validation is deactivated, and an incompatible dataset is placed in this tree, flows that rely on that relationship will give erroneous results or crash with a segfault.
redigitize (bool, default True) – Automatically re-digitize relationships that are label-based and were previously digitized.
**kwargs (Mapping[str,Dataset]) – Alternative format to other.
- Returns
DataTree – A new DataTree with data replacements completed.