rule_classes.Rule

rule_classes.Rule(self, rule)

A rule class

Attributes

Name Type Description
rule str The name of the rule
conditions list[Condition, …] A list of conditions
output str The rewrite output

Methods

Name Description
apply_rule Apply a single rile
validate_rule Validate the rule wellformedness

apply_rule

rule_classes.Rule.apply_rule(obj)

Apply a single rile

Parameters

Name Type Description Default
obj SequenceInterval The interval potentially being relabelled required

Raises

Type Description
Exception Any errors in checking the conditions

Returns

Type Description
bool True if the rule applied

validate_rule

rule_classes.Rule.validate_rule(rule)

Validate the rule wellformedness

Parameters

Name Type Description Default
rule dict The rule dictionary required

Raises

Type Description
Exception Any errors from the validator