7.7.2.11. Module axivion.style.metric¶
Classes¶
|
|
Accessor for an attribute of an element of an RFG. |
MetricBase¶
- class axivion.style.metric.MetricBase(rulename, *, rule_config=None, **kwargs)¶
Bases:
BasicRFGMetricBase,ABC- Parameters:
rulename (
str)rule_config (
typing.Optional[axivion.analysis.RuleConfiguration])kwargs (
typing.Any)
-
propagate:
bool= True¶ Propagate and aggregate the metric values (leaf values) up through the hierarchy view.
-
report_propagated_values:
bauhaus.style.metric_conf.ReportPropagatedMetricValues= 'root'¶ Report propagated metric values. ‘no’: Don’t report (only store in RFG). ‘root’: Report value at hierarchy root node. ‘all’: Report all propagated values.
-
hierarchy_view_name:
typing.Optional[str] = None¶ Name of the hierarchy view used to propagate the metric values. If None, a view is chosen based on the base_view and the available views in the rfg.
-
hierarchy_edge_name:
str= 'Belongs_To'¶ Name of the edge used to traverse the hierarchy view.
- get_hierarchy_edge_name()¶
- Return type:
str
- is_propagate()¶
Return True if propagation is enabled for this metric.
- Return type:
bool
- get_report_propagated_values()¶
Get the report level for propagated metric values.
‘no’: Don’t report (only store in RFG). ‘root’: Report value at hierarchy root node. ‘all’: Report all propagated values.
- Return type:
axivion.style.metric_conf.ReportPropagatedMetricValues
- create_propagation_strategies()¶
- Return type:
typing.Iterable[axivion.style.propagation_strategy.AbstractPropagationStrategy]
RfgMetricStore¶
- class axivion.style.metric.RfgMetricStore(rfg_node: Node, rfg_metric_desc: NodeAttribute)¶
- class axivion.style.metric.RfgMetricStore(rfg_node: Edge, rfg_metric_desc: EdgeAttribute)
- class axivion.style.metric.RfgMetricStore(rfg_node: View, rfg_metric_desc: ViewAttribute)
- class axivion.style.metric.RfgMetricStore(rfg_node: Graph, rfg_metric_desc: GraphAttribute)
Bases:
objectAccessor for an attribute of an element of an RFG. It contains an RFG element and an attribute. So the value of the attribute can be accessed easily with this store.
- get_value()¶
- Return type:
typing.Union[float,int,str,bool]
- set_value(new_value)¶
- Parameters:
new_value (
typing.Union[float,int,str,bool])- Return type:
None
- has_value()¶
- Return type:
bool