1313from python_toolbox import decorator_tools
1414from python_toolbox import caching
1515
16- from layout_rabbit import shy_math_tools
17- from layout_rabbit import shy_sequence_tools
18- from layout_rabbit import shy_cute_iter_tools
19- from layout_rabbit import shy_misc_tools
16+ from python_toolbox import math_tools
17+ from python_toolbox import sequence_tools
18+ from python_toolbox import cute_iter_tools
19+ from python_toolbox import misc_tools
2020
2121from . import misc
2222
2323
2424infinity = float ('inf' )
2525
26- class PermItems (shy_sequence_tools .CuteSequenceMixin , collections .Sequence ):
26+ class PermItems (sequence_tools .CuteSequenceMixin , collections .Sequence ):
2727 def __init__ (self , perm ):
2828 self .perm = perm
2929 def __getitem__ (self , i ):
3030 return (self .perm .domain [i ], self .perm ._perm_sequence [i ])
3131
3232
33- class PermAsDictoid (shy_sequence_tools .CuteSequenceMixin , collections .Mapping ):
33+ class PermAsDictoid (sequence_tools .CuteSequenceMixin , collections .Mapping ):
3434 def __init__ (self , perm ):
3535 self .perm = perm
3636 def __getitem__ (self , key ):
@@ -48,7 +48,7 @@ def __call__(cls, item, perm_space=None):
4848
4949
5050@functools .total_ordering
51- class Perm (shy_sequence_tools .CuteSequenceMixin , collections .Sequence ,
51+ class Perm (sequence_tools .CuteSequenceMixin , collections .Sequence ,
5252 metaclass = PermType ):
5353
5454 @classmethod
@@ -70,7 +70,7 @@ def __init__(self, number_or_perm_sequence, perm_space=None):
7070 perm_space = None if perm_space is None \
7171 else PermSpace .coerce (perm_space )
7272 if isinstance (number_or_perm_sequence , collections .Iterable ):
73- number_or_perm_sequence = shy_sequence_tools . \
73+ number_or_perm_sequence = sequence_tools . \
7474 ensure_iterable_is_immutable_sequence (number_or_perm_sequence )
7575 assert isinstance (number_or_perm_sequence , (int , collections .Sequence ))
7676
@@ -111,7 +111,7 @@ def __init__(self, number_or_perm_sequence, perm_space=None):
111111 self .number = number_or_perm_sequence
112112 else :
113113 assert isinstance (number_or_perm_sequence , collections .Iterable )
114- self ._perm_sequence = shy_sequence_tools . \
114+ self ._perm_sequence = sequence_tools . \
115115 ensure_iterable_is_immutable_sequence (number_or_perm_sequence )
116116
117117 assert self .is_combination == isinstance (self , Comb )
@@ -188,7 +188,7 @@ def number(self):
188188 index_of_current_number = unused_numbers .index (number )
189189 factoradic_number .append (index_of_current_number )
190190 del unused_numbers [index_of_current_number ]
191- return shy_math_tools .from_factoradic (
191+ return math_tools .from_factoradic (
192192 factoradic_number +
193193 [0 ] * self .just_dapplied_rapplied_perm_space .n_unused_elements
194194 ) // math .factorial (
@@ -200,7 +200,7 @@ def number(self):
200200 def _perm_sequence (self ):
201201 assert (0 <= self .number <
202202 self .just_dapplied_rapplied_perm_space .length )
203- factoradic_number = shy_math_tools .to_factoradic (
203+ factoradic_number = math_tools .to_factoradic (
204204 self .number * math .factorial (
205205 self .just_dapplied_rapplied_perm_space .n_unused_elements ),
206206 n_digits_pad = self .just_dapplied_rapplied_perm_space .sequence_length
@@ -282,7 +282,7 @@ def rapply(self, sequence, result_type=None):
282282 raise TypeError ("Can't rapply an rapplied permutation, try "
283283 "`perm.unrapplied`." )
284284 sequence = \
285- shy_sequence_tools .ensure_iterable_is_immutable_sequence (sequence )
285+ sequence_tools .ensure_iterable_is_immutable_sequence (sequence )
286286 if len (sequence ) < len (self ):
287287 raise Exception ("Can't rapply permutation on sequence of "
288288 "shorter length." )
0 commit comments