Skip to content

Commit e930f44

Browse files
committed
-
1 parent 74dd097 commit e930f44

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

source_py3/python_toolbox/combi/_variation_adding_mixin.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ def get_rapplied(self, sequence):
2020
n_elements=self.n_elements, is_combination=self.is_combination
2121
)
2222

23-
# There's no `get_recurrented` because it wouldn't make sense :) You'd need
24-
# to use `get_rapplied` and set a recurrent sequence.
23+
# There's no `.get_recurrented` because we can't know which sequence you'd
24+
# want. If you want a recurrent perm space you need to use `.get_rapplied`
25+
# with a recurrent sequence.
2526

2627
def get_partialled(self, n_elements):
2728
'''Get a partialled version of this `PermSpace`.'''
@@ -92,6 +93,7 @@ def get_degreed(self, degrees):
9293
"`perm_space.unsliced.get_degreed(...)`.")
9394
if self.is_combination:
9495
raise Exception("Can't use degrees with combination spaces.")
96+
degrees = sequence_tools.to_tuple(degrees, item_type=int)
9597
if not degrees:
9698
return self
9799
degrees_to_use = \

source_py3/python_toolbox/combi/_variation_removing_mixin.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,8 @@ class _VariationRemovingMixin:
2222
),
2323
doc='''A version of this `PermSpace` without a custom range.'''
2424
)
25-
unreccurented = caching.CachedProperty(
26-
lambda self: 1 / 0, # blocktodo
27-
doc='''A non-recurrent version of this `PermSpace`.'''
28-
)
25+
# There's no `.unrecurrented`; if you want to make a perm space
26+
# non-recurrented, use `.unrapplied`.
2927

3028
@caching.CachedProperty
3129
def unpartialled(self):

source_py3/python_toolbox/combi/perm_space.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@
3030
infinity = float('inf')
3131

3232

33+
class UnsupportedVariationCombinationException(Exception):
34+
'''blocktodo use everywhere
35+
let it take variations
36+
make variation classes mostly for this and testing'''
37+
38+
3339
class PermSpaceType(abc.ABCMeta):
3440
'''
3541
Metaclass for `PermSpace` and `CombSpace`.
@@ -321,7 +327,7 @@ def __init__(self, iterable_or_length, domain=None, n_elements=None,
321327
self._unsliced_length = self._unsliced_undegreed_length
322328
else:
323329
self.is_degreed = True
324-
if self.is_combination or self.is_partial:
330+
if self.is_combination or self.is_partial or self.is_recurrent:
325331
raise NotImplementedError
326332
self.degrees = tuple(
327333
degree for degree in degrees if degree in all_degrees

0 commit comments

Comments
 (0)