Skip to content

Commit e987033

Browse files
committed
-
1 parent 911c6a4 commit e987033

File tree

12 files changed

+96
-96
lines changed

12 files changed

+96
-96
lines changed

source_py3/python_toolbox/combi/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import math
2-
from layout_rabbit import shy_cute_iter_tools
2+
from python_toolbox import cute_iter_tools
33
from python_toolbox import cute_testing
44
from python_toolbox.math_tools import binomial # Making it easy to find
55

source_py3/python_toolbox/combi/chain_space.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@
1010
from python_toolbox import nifty_collections
1111
from python_toolbox import caching
1212

13-
from layout_rabbit import shy_math_tools
14-
from layout_rabbit import shy_sequence_tools
15-
from layout_rabbit import shy_cute_iter_tools
16-
from layout_rabbit import shy_nifty_collections
13+
from python_toolbox import math_tools
14+
from python_toolbox import sequence_tools
15+
from python_toolbox import cute_iter_tools
16+
from python_toolbox import nifty_collections
1717

1818
from . import misc
19-
from layout_rabbit import shy_misc_tools
19+
from python_toolbox import misc_tools
2020

2121
infinity = float('inf')
2222

2323

2424

25-
class ChainSpace(shy_sequence_tools.CuteSequenceMixin, collections.Sequence):
25+
class ChainSpace(sequence_tools.CuteSequenceMixin, collections.Sequence):
2626
'''
2727
A space of sequences chained together.
2828
@@ -32,7 +32,7 @@ class ChainSpace(shy_sequence_tools.CuteSequenceMixin, collections.Sequence):
3232
def __init__(self, sequences):
3333

3434
self.sequences = nifty_collections.LazyTuple(
35-
(shy_sequence_tools.ensure_iterable_is_immutable_sequence(
35+
(sequence_tools.ensure_iterable_is_immutable_sequence(
3636
sequence, default_type=nifty_collections.LazyTuple)
3737
for sequence in sequences)
3838
)
@@ -50,7 +50,7 @@ def accumulated_lengths(self):
5050
total = 0
5151
yield 0
5252
for sequence in self.sequences:
53-
total += shy_sequence_tools.get_length(sequence)
53+
total += sequence_tools.get_length(sequence)
5454
yield total
5555

5656

source_py3/python_toolbox/combi/comb.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from layout_rabbit import shy_math_tools
1+
from python_toolbox import math_tools
22
from python_toolbox import caching
33

44
from .perm import Perm
@@ -22,7 +22,7 @@ def _perm_sequence(self):
2222
0, -1):
2323
for j in range(self.just_dapplied_rapplied_perm_space.
2424
sequence_length, i - 2, -1):
25-
candidate = shy_math_tools.binomial(j, i)
25+
candidate = math_tools.binomial(j, i)
2626
if candidate <= wip_number:
2727
wip_perm_sequence.append(
2828
self.just_dapplied_rapplied_perm_space.sequence[-(j+1)]
@@ -52,7 +52,7 @@ def number(self):
5252
item for item in self._perm_sequence[::-1]
5353
)
5454
return self.just_dapplied_rapplied_perm_space.length - 1 - sum(
55-
(shy_math_tools.binomial(item, i) for i, item in
55+
(math_tools.binomial(item, i) for i, item in
5656
enumerate(processed_perm_sequence, start=1)),
5757
0
5858
)

source_py3/python_toolbox/combi/map_space.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,31 @@
1010
from python_toolbox import nifty_collections
1111
from python_toolbox import caching
1212

13-
from layout_rabbit import shy_math_tools
14-
from layout_rabbit import shy_sequence_tools
15-
from layout_rabbit import shy_cute_iter_tools
16-
from layout_rabbit import shy_nifty_collections
17-
from layout_rabbit import shy_misc_tools
13+
from python_toolbox import math_tools
14+
from python_toolbox import sequence_tools
15+
from python_toolbox import cute_iter_tools
16+
from python_toolbox import nifty_collections
17+
from python_toolbox import misc_tools
1818

1919
from . import misc
2020

2121
infinity = float('inf')
2222

2323

2424

25-
class MapSpace(shy_sequence_tools.CuteSequenceMixin, collections.Sequence):
25+
class MapSpace(sequence_tools.CuteSequenceMixin, collections.Sequence):
2626
def __init__(self, function, sequence):
2727

2828
self.function = function
29-
self.sequence = shy_sequence_tools. \
29+
self.sequence = sequence_tools. \
3030
ensure_iterable_is_immutable_sequence(
3131
sequence,
3232
default_type=nifty_collections.LazyTuple
3333
)
3434

3535

3636
length = caching.CachedProperty(
37-
lambda self: shy_sequence_tools.get_length(self.sequence)
37+
lambda self: sequence_tools.get_length(self.sequence)
3838
)
3939

4040
def __repr__(self):

source_py3/python_toolbox/combi/misc.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
from python_toolbox import nifty_collections
99
from python_toolbox import caching
1010

11-
from layout_rabbit import shy_math_tools
12-
from layout_rabbit import shy_sequence_tools
13-
from layout_rabbit import shy_cute_iter_tools
11+
from python_toolbox import math_tools
12+
from python_toolbox import sequence_tools
13+
from python_toolbox import cute_iter_tools
1414

1515
infinity = float('inf')
1616

@@ -19,7 +19,7 @@
1919

2020
def get_short_factorial_string(number, minus_one=False):
2121
assert number >= 0 and \
22-
isinstance(number, shy_math_tools.PossiblyInfiniteIntegral)
22+
isinstance(number, math_tools.PossiblyInfiniteIntegral)
2323
if number == infinity:
2424
return "float('inf')"
2525
elif number <= 10:

source_py3/python_toolbox/combi/perm.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,24 @@
1313
from python_toolbox import decorator_tools
1414
from 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

2121
from . import misc
2222

2323

2424
infinity = 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

Comments
 (0)