ess.reduce.nexus.merge.MergeRules#

class ess.reduce.nexus.merge.MergeRules(*, rules=(), ignore=())[source]#

Which differences between runs prevent merging them.

__init__(*, rules=(), ignore=())#

Methods

__init__(*[, rules, ignore])

from_toml(path)

Rules from a TOML file.

ignores(path)

Whether path or a group that contains it is ignored.

rule_for(path)

Attributes

ignore

Glob patterns on absolute paths of groups and datasets whose values, attributes, and contents may differ between runs.

rules

Checks of NXlogs; the first rule that matches a log applies.

classmethod from_toml(path)[source]#

Rules from a TOML file.

A tolerance is a string with a unit, such as '0.5 K', converted to the unit of the log’s values. A number is dimensionless, except that 0 requires identical values in any unit:

ignore = ["/entry/experiment_description"]

[[rule]]
paths = ["/entry/instrument/*/target_value"]
error = 0

[[rule]]
paths = ["/entry/sample/temperature"]
warn = "0.1 K"
error = "0.5 K"
Parameters:

path (Path | str) – The TOML file.

Returns:

MergeRules – The rules in the file.

ignore: tuple[str, ...] = ()#

Glob patterns on absolute paths of groups and datasets whose values, attributes, and contents may differ between runs. The merged file has those of the first run. Extendable datasets in them are appended all the same.

ignores(path)[source]#

Whether path or a group that contains it is ignored.

Return type:

bool

rules: tuple[Rule, ...] = ()#

Checks of NXlogs; the first rule that matches a log applies. Logs that no rule matches are not checked.