@@ -107,28 +107,6 @@ class LeafArrayDescriptor(AbstractInputDescriptor):
107107
108108# {{{ utilities
109109
110- def _ary_container_key_stringifier (keys : Tuple [Any , ...]) -> str :
111- """
112- Helper for :meth:`BaseLazilyCompilingFunctionCaller.__call__`. Stringifies an
113- array-container's component's key. Goals of this routine:
114-
115- * No two different keys should have the same stringification
116- * Stringified key must a valid identifier according to :meth:`str.isidentifier`
117- * (informal) Shorter identifiers are preferred
118- """
119- def _rec_str (key : Any ) -> str :
120- if isinstance (key , (str , int )):
121- return str (key )
122- elif isinstance (key , tuple ):
123- # t in '_actx_t': stands for tuple
124- return "_actx_t" + "_" .join (_rec_str (k ) for k in key ) + "_actx_endt"
125- else :
126- raise NotImplementedError ("Key-stringication unimplemented for "
127- f"'{ type (key ).__name__ } '." )
128-
129- return "_" .join (_rec_str (key ) for key in keys )
130-
131-
132110def _get_arg_id_to_arg_and_arg_id_to_descr (args : Tuple [Any , ...],
133111 kwargs : Mapping [str , Any ]
134112 ) -> "Tuple[PMap[Tuple[Any, ...],\
@@ -318,6 +296,7 @@ def __call__(self, *args: Any, **kwargs: Any) -> Any:
318296 :attr:`~BaseLazilyCompilingFunctionCaller.f` with *args* in a lazy-sense.
319297 The intermediary pytato DAG for *args* is memoized in *self*.
320298 """
299+ from arraycontext .impl .pytato .utils import _ary_container_key_stringifier
321300 arg_id_to_arg , arg_id_to_descr = _get_arg_id_to_arg_and_arg_id_to_descr (
322301 args , kwargs )
323302
0 commit comments