verify.renames¶
The expected renames and differences of a comparison of two dumps.
MetadataRenames
¶
Bases: TypedDict
The expected changes of the metadata of the fit mappings.
Renames
¶
Bases: TypedDict
The expected renames and differences between two dumps.
Expected
¶
The expected differences of a renames file and which of them occurred.
Create the expected differences.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
patterns
|
Mapping[str, Sequence[str]]
|
the patterns of the keys per part of the dump. |
required |
load_renames
¶
Load the expected renames from a json file.
Raises:
| Type | Description |
|---|---|
ValueError
|
for a part which is not known. |
rename_mapping
¶
Apply the expected renames to the metadata of a mapping description.
rename_ids
¶
Rename the ids of the tasks, datasets, figures and fit mappings of a dump.
Returns:
| Type | Description |
|---|---|
Dump
|
A new dump; the given one is not changed. |
Raises:
| Type | Description |
|---|---|
ValueError
|
if two ids of a part have the same new id, or a mapping description cannot be renamed. |
drop_figure_fields
¶
Leave out keys of the specifications of the figures, of the figure only.
A key is left out at the level of the figure, not inside its plots, curves
or axes: a plot has a width and a height of its own.
Returns:
| Type | Description |
|---|---|
Dump
|
A new dump; the given one is not changed. |
apply_renames
¶
Apply the expected renames to a dump, the old one of a comparison.
The strings first, then the ids (ids, sids), then the metadata.
Returns:
| Type | Description |
|---|---|
Dump
|
A new dump; the given one is not changed. |
Raises:
| Type | Description |
|---|---|
ValueError
|
if two keys or ids get the same new key or id, or a mapping description cannot be renamed. |