esets-lib 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
esets/__init__.py ADDED
@@ -0,0 +1,100 @@
1
+ """esets: lazy, index-addressable enumerated sets, including a full
2
+ combinatorics family (permutations, combinations, arrangements,
3
+ subsets, integer partitions, set partitions, derangements, and
4
+ Cartesian products), all randomly-accessible by index with no
5
+ enumeration of what comes before.
6
+
7
+ See README.md, COMBINATORICS.md, FLOAT64S.md, and POKER.md for the
8
+ full tour; this module just re-exports the public API in one place.
9
+ """
10
+
11
+ from .eset import BEset, Eset, EMap, EABCMixinFactory
12
+ from .besets import BEvens, BWholesSHA256s
13
+
14
+ from .numeric import (
15
+ Evens,
16
+ Multiples,
17
+ Negatives,
18
+ Integers,
19
+ Squares,
20
+ Wholes,
21
+ Float64_tpls,
22
+ Float64s,
23
+ Float64sMixin,
24
+ IntArithProg,
25
+ )
26
+
27
+ from .cesets import (
28
+ Natural_Permutator,
29
+ Distinct_Permutator,
30
+ Natural_Multiset_Permutator,
31
+ Permutator,
32
+ Natural_Combinator,
33
+ Distinct_Combinator,
34
+ Natural_Multiset_Combinator,
35
+ Combinator,
36
+ Natural_Arranger,
37
+ Distinct_Arranger,
38
+ Natural_Multiset_Arranger,
39
+ Arranger,
40
+ Natural_Powerset,
41
+ Distinct_Powerset,
42
+ Natural_Multiset_Powerset,
43
+ Powerset,
44
+ Partitioner,
45
+ Compositioner,
46
+ Natural_Set_Partitioner,
47
+ Set_Partitioner,
48
+ Natural_Derangement,
49
+ Distinct_Derangement,
50
+ Natural_Cartesian_Product,
51
+ Cartesian_Product,
52
+ )
53
+
54
+ from . import ecombinatorics
55
+
56
+ __version__ = "0.1.0"
57
+
58
+ __all__ = [
59
+ "BEset",
60
+ "Eset",
61
+ "EMap",
62
+ "EABCMixinFactory",
63
+ "BEvens",
64
+ "BWholesSHA256s",
65
+ "Evens",
66
+ "Multiples",
67
+ "Negatives",
68
+ "Integers",
69
+ "Squares",
70
+ "Wholes",
71
+ "Float64_tpls",
72
+ "Float64s",
73
+ "Float64sMixin",
74
+ "IntArithProg",
75
+ "Natural_Permutator",
76
+ "Distinct_Permutator",
77
+ "Natural_Multiset_Permutator",
78
+ "Permutator",
79
+ "Natural_Combinator",
80
+ "Distinct_Combinator",
81
+ "Natural_Multiset_Combinator",
82
+ "Combinator",
83
+ "Natural_Arranger",
84
+ "Distinct_Arranger",
85
+ "Natural_Multiset_Arranger",
86
+ "Arranger",
87
+ "Natural_Powerset",
88
+ "Distinct_Powerset",
89
+ "Natural_Multiset_Powerset",
90
+ "Powerset",
91
+ "Partitioner",
92
+ "Compositioner",
93
+ "Natural_Set_Partitioner",
94
+ "Set_Partitioner",
95
+ "Natural_Derangement",
96
+ "Distinct_Derangement",
97
+ "Natural_Cartesian_Product",
98
+ "Cartesian_Product",
99
+ "ecombinatorics",
100
+ ]
esets/besets.py ADDED
@@ -0,0 +1,29 @@
1
+ from .eset import BEset
2
+ import hashlib
3
+
4
+
5
+ class BEvens(BEset):
6
+ """A blind eset for evens"""
7
+
8
+ def __init__(self, *args, **kwargs):
9
+ super().__init__(*args, **kwargs)
10
+ self.VALUE = 2
11
+
12
+ def direct_function(self, i):
13
+ return i * self.VALUE
14
+
15
+ def stop_init(self):
16
+ return None
17
+
18
+
19
+ class BWholesSHA256s(BEset):
20
+ """A blind eset of SHA256s of the Whole numbers. It uses ascii
21
+ encoding since only decimal numbers are expected.
22
+
23
+ """
24
+
25
+ def direct_function(self, i):
26
+ return hashlib.sha256(str(i).encode('ascii')).hexdigest()
27
+
28
+ def stop_init(self):
29
+ return None