11from __future__ import annotations
22
3+ from collections .abc import Callable
34from dataclasses import dataclass , field
45from datetime import timedelta
56
@@ -20,7 +21,7 @@ class RuleReport:
2021 num_matches : int
2122
2223 @classmethod
23- def from_bindings (cls , report : bindings .RuleReport ) -> RuleReport :
24+ def _from_bindings (cls , report : bindings .RuleReport ) -> RuleReport :
2425 return cls (
2526 plan = report .plan ,
2627 search_and_apply_time = report .search_and_apply_time ,
@@ -37,13 +38,13 @@ class RuleSetReport:
3738 _decls : Declarations = field (repr = False , default = None )
3839
3940 @classmethod
40- def from_bindings (
41- cls , report : bindings .RuleSetReport , translate_key : callable , decls : Declarations
41+ def _from_bindings (
42+ cls , report : bindings .RuleSetReport , translate_key : Callable [[ str ], CommandDecl ] , decls : Declarations
4243 ) -> RuleSetReport :
4344 return cls (
4445 changed = report .changed ,
4546 rule_reports = {
46- translate_key (k ): [RuleReport .from_bindings (rr ) for rr in v ] for k , v in report .rule_reports .items ()
47+ translate_key (k ): [RuleReport ._from_bindings (rr ) for rr in v ] for k , v in report .rule_reports .items ()
4748 },
4849 search_and_apply_time = report .search_and_apply_time ,
4950 merge_time = report .merge_time ,
@@ -66,11 +67,11 @@ class IterationReport:
6667 rebuild_time : timedelta
6768
6869 @classmethod
69- def from_bindings (
70- cls , report : bindings .IterationReport , translate_key : callable , decls : Declarations
70+ def _from_bindings (
71+ cls , report : bindings .IterationReport , translate_key : Callable [[ str ], CommandDecl ] , decls : Declarations
7172 ) -> IterationReport :
7273 return cls (
73- rule_set_report = RuleSetReport .from_bindings (report .rule_set_report , translate_key , decls ),
74+ rule_set_report = RuleSetReport ._from_bindings (report .rule_set_report , translate_key , decls ),
7475 rebuild_time = report .rebuild_time ,
7576 )
7677
@@ -102,10 +103,10 @@ def __repr__(self) -> str:
102103 )
103104
104105 @classmethod
105- def from_bindings (cls , report : bindings .RunReport , state : EGraphState ) -> RunReport :
106+ def _from_bindings (cls , report : bindings .RunReport , state : EGraphState ) -> RunReport :
106107 return cls (
107108 iterations = [
108- IterationReport .from_bindings (it , state .translate_rule_key , state .__egg_decls__ )
109+ IterationReport ._from_bindings (it , state .translate_rule_key , state .__egg_decls__ )
109110 for it in report .iterations
110111 ],
111112 updated = report .updated ,
0 commit comments