regina 7.4.1__cp314-cp314-macosx_10_13_x86_64.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.
Files changed (186) hide show
  1. regina/.dylibs/libgmp.10.dylib +0 -0
  2. regina/.dylibs/libgmpxx.4.dylib +0 -0
  3. regina/__init__.py +192 -0
  4. regina/engine.cpython-314-darwin.so +0 -0
  5. regina/plainCompleter.py +221 -0
  6. regina/pyCensus/__init__.py +14 -0
  7. regina/pyCensus/christy-knots-links.tdb +0 -0
  8. regina/pyCensus/closed-hyp-census-full.tdb +0 -0
  9. regina/pyCensus/closed-nor-census-11.tdb +0 -0
  10. regina/pyCensus/closed-or-census-11.tdb +0 -0
  11. regina/pyCensus/cusped-hyp-nor-census-9.tdb +0 -0
  12. regina/pyCensus/cusped-hyp-or-census-9.tdb +0 -0
  13. regina/sageRegina/__init__.py +2 -0
  14. regina/sageRegina/config.py +9 -0
  15. regina/sageRegina/test.py +131 -0
  16. regina/sageRegina/testsuite/CMakeLists.txt +64 -0
  17. regina/sageRegina/testsuite/O2_1.rga +15 -0
  18. regina/sageRegina/testsuite/O2_1.tri +28 -0
  19. regina/sageRegina/testsuite/README.txt +21 -0
  20. regina/sageRegina/testsuite/alltypes-exc.out +698 -0
  21. regina/sageRegina/testsuite/alltypes-exc.test +92 -0
  22. regina/sageRegina/testsuite/alltypes-noexc.out +698 -0
  23. regina/sageRegina/testsuite/alltypes-noexc.test +85 -0
  24. regina/sageRegina/testsuite/alltypes.out +698 -0
  25. regina/sageRegina/testsuite/alltypes.test +85 -0
  26. regina/sageRegina/testsuite/angles.out +102 -0
  27. regina/sageRegina/testsuite/angles.test +70 -0
  28. regina/sageRegina/testsuite/arrow.out +86 -0
  29. regina/sageRegina/testsuite/arrow.test +224 -0
  30. regina/sageRegina/testsuite/base64.out +2 -0
  31. regina/sageRegina/testsuite/base64.test +37 -0
  32. regina/sageRegina/testsuite/basic_callback.out +124 -0
  33. regina/sageRegina/testsuite/basic_sub.out +7 -0
  34. regina/sageRegina/testsuite/binom.out +14 -0
  35. regina/sageRegina/testsuite/binom.test +69 -0
  36. regina/sageRegina/testsuite/bool.out +6 -0
  37. regina/sageRegina/testsuite/bool.test +62 -0
  38. regina/sageRegina/testsuite/bytes.out +17 -0
  39. regina/sageRegina/testsuite/bytes.test +76 -0
  40. regina/sageRegina/testsuite/callbacks.out +515 -0
  41. regina/sageRegina/testsuite/callbacks.test +279 -0
  42. regina/sageRegina/testsuite/census.out +120 -0
  43. regina/sageRegina/testsuite/census.test +156 -0
  44. regina/sageRegina/testsuite/clone.out +18 -0
  45. regina/sageRegina/testsuite/clone.test +99 -0
  46. regina/sageRegina/testsuite/comparison.out +41 -0
  47. regina/sageRegina/testsuite/comparison.test +47 -0
  48. regina/sageRegina/testsuite/construction.out +120 -0
  49. regina/sageRegina/testsuite/construction.test +63 -0
  50. regina/sageRegina/testsuite/constructors.out +14 -0
  51. regina/sageRegina/testsuite/constructors.test +95 -0
  52. regina/sageRegina/testsuite/cube.orb +87 -0
  53. regina/sageRegina/testsuite/discs.out +3 -0
  54. regina/sageRegina/testsuite/discs.test +38 -0
  55. regina/sageRegina/testsuite/docstrings.filter +22 -0
  56. regina/sageRegina/testsuite/docstrings.out +802 -0
  57. regina/sageRegina/testsuite/docstrings.out.v2 +799 -0
  58. regina/sageRegina/testsuite/docstrings.test +55 -0
  59. regina/sageRegina/testsuite/dodec.orb +309 -0
  60. regina/sageRegina/testsuite/embeddings.out +23 -0
  61. regina/sageRegina/testsuite/embeddings.test +87 -0
  62. regina/sageRegina/testsuite/enumerate.out +62 -0
  63. regina/sageRegina/testsuite/enumerate.test +80 -0
  64. regina/sageRegina/testsuite/equality.out +112 -0
  65. regina/sageRegina/testsuite/equality.test +308 -0
  66. regina/sageRegina/testsuite/euler.out +15 -0
  67. regina/sageRegina/testsuite/euler.test +93 -0
  68. regina/sageRegina/testsuite/exception.out +7 -0
  69. regina/sageRegina/testsuite/exception.test +98 -0
  70. regina/sageRegina/testsuite/facenumbering.out +546 -0
  71. regina/sageRegina/testsuite/facenumbering.test +72 -0
  72. regina/sageRegina/testsuite/faces.out +40 -0
  73. regina/sageRegina/testsuite/faces.test +70 -0
  74. regina/sageRegina/testsuite/file.out +1229 -0
  75. regina/sageRegina/testsuite/file.test +68 -0
  76. regina/sageRegina/testsuite/file1.rga +0 -0
  77. regina/sageRegina/testsuite/file2.rga +0 -0
  78. regina/sageRegina/testsuite/file3.rga +119 -0
  79. regina/sageRegina/testsuite/flags.out +38 -0
  80. regina/sageRegina/testsuite/flags.out.v2 +38 -0
  81. regina/sageRegina/testsuite/flags.test +81 -0
  82. regina/sageRegina/testsuite/flype.out +37 -0
  83. regina/sageRegina/testsuite/flype.test +48 -0
  84. regina/sageRegina/testsuite/generic.out +116 -0
  85. regina/sageRegina/testsuite/generic.test +74 -0
  86. regina/sageRegina/testsuite/groups.out +70 -0
  87. regina/sageRegina/testsuite/groups.test +115 -0
  88. regina/sageRegina/testsuite/hash.out +66 -0
  89. regina/sageRegina/testsuite/hash.test +84 -0
  90. regina/sageRegina/testsuite/hypersurfaces.out +681 -0
  91. regina/sageRegina/testsuite/hypersurfaces.test +89 -0
  92. regina/sageRegina/testsuite/i18n-latin1.rga +8 -0
  93. regina/sageRegina/testsuite/i18n-utf8.rga +8 -0
  94. regina/sageRegina/testsuite/i18n.out +6 -0
  95. regina/sageRegina/testsuite/i18n.test +89 -0
  96. regina/sageRegina/testsuite/id.out +2 -0
  97. regina/sageRegina/testsuite/id.test +45 -0
  98. regina/sageRegina/testsuite/index.out +2 -0
  99. regina/sageRegina/testsuite/index.test +41 -0
  100. regina/sageRegina/testsuite/integer.out +74 -0
  101. regina/sageRegina/testsuite/integer.test +54 -0
  102. regina/sageRegina/testsuite/italian.orb +90 -0
  103. regina/sageRegina/testsuite/iterators.out +118 -0
  104. regina/sageRegina/testsuite/iterators.test +126 -0
  105. regina/sageRegina/testsuite/knotted-Y.orb +47 -0
  106. regina/sageRegina/testsuite/listener.out +43 -0
  107. regina/sageRegina/testsuite/listener.test +99 -0
  108. regina/sageRegina/testsuite/listview.out +416 -0
  109. regina/sageRegina/testsuite/listview.test +251 -0
  110. regina/sageRegina/testsuite/lookup.out +13 -0
  111. regina/sageRegina/testsuite/lookup.test +42 -0
  112. regina/sageRegina/testsuite/lst.out +844 -0
  113. regina/sageRegina/testsuite/lst.test +195 -0
  114. regina/sageRegina/testsuite/memory1.out +62 -0
  115. regina/sageRegina/testsuite/memory1.test +152 -0
  116. regina/sageRegina/testsuite/memory2.out +62 -0
  117. regina/sageRegina/testsuite/memory2.test +122 -0
  118. regina/sageRegina/testsuite/memory3.out +92 -0
  119. regina/sageRegina/testsuite/memory3.test +214 -0
  120. regina/sageRegina/testsuite/misc.out +7 -0
  121. regina/sageRegina/testsuite/misc.test +54 -0
  122. regina/sageRegina/testsuite/operators.out +129 -0
  123. regina/sageRegina/testsuite/operators.test +59 -0
  124. regina/sageRegina/testsuite/orb.out +441 -0
  125. regina/sageRegina/testsuite/orb.test +47 -0
  126. regina/sageRegina/testsuite/pdf.out +4 -0
  127. regina/sageRegina/testsuite/pdf.test +47 -0
  128. regina/sageRegina/testsuite/perm.out +36 -0
  129. regina/sageRegina/testsuite/perm.test +74 -0
  130. regina/sageRegina/testsuite/plantri.out +12 -0
  131. regina/sageRegina/testsuite/plantri.test +58 -0
  132. regina/sageRegina/testsuite/poincare.tri +55 -0
  133. regina/sageRegina/testsuite/presentations.out +11 -0
  134. regina/sageRegina/testsuite/presentations.test +59 -0
  135. regina/sageRegina/testsuite/refs.out +51 -0
  136. regina/sageRegina/testsuite/refs.test +126 -0
  137. regina/sageRegina/testsuite/repr.out +951 -0
  138. regina/sageRegina/testsuite/repr.out.v2 +951 -0
  139. regina/sageRegina/testsuite/repr.test +546 -0
  140. regina/sageRegina/testsuite/runbasic.in +75 -0
  141. regina/sageRegina/testsuite/safeheldtype_basic.out +17 -0
  142. regina/sageRegina/testsuite/safeheldtype_basic.test +111 -0
  143. regina/sageRegina/testsuite/safeheldtype_packet.out +58 -0
  144. regina/sageRegina/testsuite/safeheldtype_packet.test +179 -0
  145. regina/sageRegina/testsuite/sample.pdf +0 -0
  146. regina/sageRegina/testsuite/sets.out +7 -0
  147. regina/sageRegina/testsuite/sets.test +42 -0
  148. regina/sageRegina/testsuite/skeleton.out +308 -0
  149. regina/sageRegina/testsuite/skeleton.test +52 -0
  150. regina/sageRegina/testsuite/snappea.out +90 -0
  151. regina/sageRegina/testsuite/snappea.test +133 -0
  152. regina/sageRegina/testsuite/snapshot.out +15 -0
  153. regina/sageRegina/testsuite/snapshot.test +76 -0
  154. regina/sageRegina/testsuite/sort.out +78 -0
  155. regina/sageRegina/testsuite/sort.test +58 -0
  156. regina/sageRegina/testsuite/special.out +4 -0
  157. regina/sageRegina/testsuite/special.test +45 -0
  158. regina/sageRegina/testsuite/standardtri.out +12101 -0
  159. regina/sageRegina/testsuite/standardtri.test +453 -0
  160. regina/sageRegina/testsuite/surfaces.out +2133 -0
  161. regina/sageRegina/testsuite/surfaces.test +112 -0
  162. regina/sageRegina/testsuite/swapping.out +25 -0
  163. regina/sageRegina/testsuite/swapping.test +86 -0
  164. regina/sageRegina/testsuite/testall.in +174 -0
  165. regina/sageRegina/testsuite/testbasic.in +277 -0
  166. regina/sageRegina/testsuite/testcallback.in +148 -0
  167. regina/sageRegina/testsuite/testsub.in +148 -0
  168. regina/sageRegina/testsuite/theta_in_solid_torus.orb +65 -0
  169. regina/sageRegina/testsuite/tightencode.out +40 -0
  170. regina/sageRegina/testsuite/tightencode.test +106 -0
  171. regina/sageRegina/testsuite/treedecomp.out +135 -0
  172. regina/sageRegina/testsuite/treedecomp.test +64 -0
  173. regina/sageRegina/testsuite/treetraversal.out +52 -0
  174. regina/sageRegina/testsuite/treetraversal.test +188 -0
  175. regina/sageRegina/testsuite/trigeneral.out +1251 -0
  176. regina/sageRegina/testsuite/trigeneral.test +153 -0
  177. regina/sageRegina/testsuite/utf8.out +42 -0
  178. regina/sageRegina/testsuite/utf8.test +92 -0
  179. regina/sageRegina/testsuite/whitehead.tri +47 -0
  180. regina/sageRegina/version.py +5 -0
  181. regina/sageSetup.py +41 -0
  182. regina/test.py +6 -0
  183. regina-7.4.1.dist-info/METADATA +109 -0
  184. regina-7.4.1.dist-info/RECORD +186 -0
  185. regina-7.4.1.dist-info/WHEEL +6 -0
  186. regina-7.4.1.dist-info/top_level.txt +4 -0
@@ -0,0 +1,195 @@
1
+ # Regina - A Normal Surface Theory Calculator
2
+ # Python Test Suite Component
3
+ #
4
+ # Copyright (c) 2013-2025, Ben Burton
5
+ # For further details contact Ben Burton (bab@debian.org).
6
+ #
7
+ # Tests the construction of layered solid tori.
8
+ #
9
+ # This file is a single component of Regina's python test suite. To run
10
+ # the python test suite, move to the main python directory in the source
11
+ # tree and run "make check".
12
+ #
13
+ # This program is free software; you can redistribute it and/or
14
+ # modify it under the terms of the GNU General Public License as
15
+ # published by the Free Software Foundation; either version 2 of the
16
+ # License, or (at your option) any later version.
17
+ #
18
+ # As an exception, when this program is distributed through (i) the
19
+ # App Store by Apple Inc.; (ii) the Mac App Store by Apple Inc.; or
20
+ # (iii) Google Play by Google Inc., then that store may impose any
21
+ # digital rights management, device limits and/or redistribution
22
+ # restrictions that are required by its terms of service.
23
+ #
24
+ # This program is distributed in the hope that it will be useful, but
25
+ # WITHOUT ANY WARRANTY; without even the implied warranty of
26
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
27
+ # General Public License for more details.
28
+ #
29
+ # You should have received a copy of the GNU General Public License
30
+ # along with this program. If not, see <https://www.gnu.org/licenses/>.
31
+
32
+ print(Example3.lst(0,1).detail())
33
+ print(Example3.lst(1,1).detail())
34
+ print(Example3.lst(1,2).detail())
35
+ print(Example3.lst(1,3).detail())
36
+ print(Example3.lst(1,4).detail())
37
+ print(Example3.lst(2,3).detail())
38
+ print(Example3.lst(2,5).detail())
39
+ print(Example3.lst(2,7).detail())
40
+ print(Example3.lst(3,4).detail())
41
+ print(Example3.lst(3,5).detail())
42
+ print(Example3.lst(3,7).detail())
43
+
44
+ t = Example3.poincare()
45
+ print(t.detail())
46
+
47
+ try:
48
+ t.insertLayeredSolidTorus(0,0)
49
+ except regina.InvalidArgument:
50
+ print('Caught exception!')
51
+
52
+ try:
53
+ t.insertLayeredSolidTorus(0,2)
54
+ except regina.InvalidArgument:
55
+ print('Caught exception!')
56
+
57
+ try:
58
+ t.insertLayeredSolidTorus(2,2)
59
+ except regina.InvalidArgument:
60
+ print('Caught exception!')
61
+
62
+ try:
63
+ t.insertLayeredSolidTorus(0,3)
64
+ except regina.InvalidArgument:
65
+ print('Caught exception!')
66
+
67
+ try:
68
+ t.insertLayeredSolidTorus(0,4)
69
+ except regina.InvalidArgument:
70
+ print('Caught exception!')
71
+
72
+ try:
73
+ t.insertLayeredSolidTorus(2,4)
74
+ except regina.InvalidArgument:
75
+ print('Caught exception!')
76
+
77
+ try:
78
+ t.insertLayeredSolidTorus(2,6)
79
+ except regina.InvalidArgument:
80
+ print('Caught exception!')
81
+
82
+ try:
83
+ t.insertLayeredSolidTorus(9,12)
84
+ except regina.InvalidArgument:
85
+ print('Caught exception!')
86
+
87
+ try:
88
+ t.insertLayeredSolidTorus(20,35)
89
+ except regina.InvalidArgument:
90
+ print('Caught exception!')
91
+
92
+ try:
93
+ t.insertLayeredSolidTorus(2,1)
94
+ except regina.InvalidArgument:
95
+ print('Caught exception!')
96
+
97
+ # Check that t is unchanged.
98
+ print(t.detail())
99
+
100
+ print(Example3.lens(0,1).detail())
101
+ print(Example3.lens(1,0).detail())
102
+ print(Example3.lens(2,1).detail())
103
+ print(Example3.lens(3,1).detail())
104
+ print(Example3.lens(3,2).detail())
105
+ print(Example3.lens(4,1).detail())
106
+ print(Example3.lens(4,3).detail())
107
+
108
+ try:
109
+ print(Example3.lens(0,0).detail())
110
+ except regina.InvalidArgument:
111
+ print('Caught exception!')
112
+
113
+ try:
114
+ print(Example3.lens(0,2).detail())
115
+ except regina.InvalidArgument:
116
+ print('Caught exception!')
117
+
118
+ try:
119
+ print(Example3.lens(1,1).detail())
120
+ except regina.InvalidArgument:
121
+ print('Caught exception!')
122
+
123
+ try:
124
+ print(Example3.lens(1,2).detail())
125
+ except regina.InvalidArgument:
126
+ print('Caught exception!')
127
+
128
+ try:
129
+ print(Example3.lens(2,0).detail())
130
+ except regina.InvalidArgument:
131
+ print('Caught exception!')
132
+
133
+ try:
134
+ print(Example3.lens(2,2).detail())
135
+ except regina.InvalidArgument:
136
+ print('Caught exception!')
137
+
138
+ try:
139
+ print(Example3.lens(2,3).detail())
140
+ except regina.InvalidArgument:
141
+ print('Caught exception!')
142
+
143
+ try:
144
+ print(Example3.lens(3,0).detail())
145
+ except regina.InvalidArgument:
146
+ print('Caught exception!')
147
+
148
+ try:
149
+ print(Example3.lens(3,3).detail())
150
+ except regina.InvalidArgument:
151
+ print('Caught exception!')
152
+
153
+ try:
154
+ print(Example3.lens(3,4).detail())
155
+ except regina.InvalidArgument:
156
+ print('Caught exception!')
157
+
158
+ try:
159
+ print(Example3.lens(4,0).detail())
160
+ except regina.InvalidArgument:
161
+ print('Caught exception!')
162
+
163
+ try:
164
+ print(Example3.lens(4,2).detail())
165
+ except regina.InvalidArgument:
166
+ print('Caught exception!')
167
+
168
+ try:
169
+ print(Example3.lens(4,4).detail())
170
+ except regina.InvalidArgument:
171
+ print('Caught exception!')
172
+
173
+ try:
174
+ print(Example3.lens(4,6).detail())
175
+ except regina.InvalidArgument:
176
+ print('Caught exception!')
177
+
178
+ print(Example3.augTriSolidTorus(1,0, 0,-1, 1,-1).detail())
179
+ print(Example3.augTriSolidTorus(2,-1, 1,1, 1,-2).detail())
180
+ print(Example3.augTriSolidTorus(3,-1, 1,2, 2,-3).detail())
181
+
182
+ try:
183
+ print(Example3.augTriSolidTorus(3,-1, 1,2, 0,0).detail())
184
+ except regina.InvalidArgument:
185
+ print('Caught exception!')
186
+
187
+ try:
188
+ print(Example3.augTriSolidTorus(3,-1, 2,2, 1,2).detail())
189
+ except regina.InvalidArgument:
190
+ print('Caught exception!')
191
+
192
+ try:
193
+ print(Example3.augTriSolidTorus(4,-6, 3,-1, 1,2).detail())
194
+ except regina.InvalidArgument:
195
+ print('Caught exception!')
@@ -0,0 +1,62 @@
1
+ Insertion case
2
+ Step 1
3
+ Step 2
4
+ Step 3
5
+ Step 4
6
+ Step 5
7
+ Destroying: t
8
+ Destroying: c
9
+ Step 6
10
+ Root destruction case
11
+ Step 1
12
+ Step 2
13
+ Step 3
14
+ Step 4
15
+ Destroying: a
16
+ Step 5
17
+ b
18
+ None
19
+ Orphan case
20
+ Step 1
21
+ Step 2
22
+ Step 3
23
+ Step 4
24
+ Step 5
25
+ Destroying: p
26
+ Step 6
27
+ Destroying: q
28
+ Step 7
29
+ Multiple orphan case
30
+ Step 1
31
+ Step 2
32
+ Step 3
33
+ Step 4
34
+ Destroying: x
35
+ Step 5
36
+ Destroying: y
37
+ Step 6
38
+ Many references case
39
+ Step 1
40
+ Step 2
41
+ Step 3
42
+ Step 4
43
+ Step 5
44
+ Destroying: f
45
+ Step 6
46
+ Step 7
47
+ Destroying: g
48
+ Destroying: g
49
+ Step 8
50
+ Empty 3-D triangulation
51
+ b
52
+ Deep reference case
53
+ Step 1
54
+ Step 2
55
+ Step 3
56
+ Destroying: z2
57
+ Destroying: x
58
+ Step 4
59
+ Destroying: z1
60
+ Step 5
61
+ Destroying: y
62
+ Step 6
@@ -0,0 +1,152 @@
1
+ # Regina - A Normal Surface Theory Calculator
2
+ # Python Test Suite Component
3
+ #
4
+ # Copyright (c) 2015-2025, Ben Burton
5
+ # For further details contact Ben Burton (bab@debian.org).
6
+ #
7
+ # Tests the lifetime management of packets.
8
+ #
9
+ # This file is a single component of Regina's python test suite. To run
10
+ # the python test suite, move to the main python directory in the source
11
+ # tree and run "make check".
12
+ #
13
+ # This program is free software; you can redistribute it and/or
14
+ # modify it under the terms of the GNU General Public License as
15
+ # published by the Free Software Foundation; either version 2 of the
16
+ # License, or (at your option) any later version.
17
+ #
18
+ # As an exception, when this program is distributed through (i) the
19
+ # App Store by Apple Inc.; (ii) the Mac App Store by Apple Inc.; or
20
+ # (iii) Google Play by Google Inc., then that store may impose any
21
+ # digital rights management, device limits and/or redistribution
22
+ # restrictions that are required by its terms of service.
23
+ #
24
+ # This program is distributed in the hope that it will be useful, but
25
+ # WITHOUT ANY WARRANTY; without even the implied warranty of
26
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
27
+ # General Public License for more details.
28
+ #
29
+ # You should have received a copy of the GNU General Public License
30
+ # along with this program. If not, see <https://www.gnu.org/licenses/>.
31
+
32
+ # Fetch the python/testsuite path in the source tree, since we will need
33
+ # to access external files.
34
+ import sys
35
+ if (len(sys.argv) > 1):
36
+ testpath = sys.argv[1]
37
+ else:
38
+ testpath = '.'
39
+
40
+ class Watcher(PacketListener):
41
+ def __init__(self, packet):
42
+ PacketListener.__init__(self)
43
+ packet.listen(self)
44
+ def packetBeingDestroyed(self, packet):
45
+ print('Destroying: ' + packet.label())
46
+
47
+
48
+ print('Insertion case')
49
+ print('Step 1')
50
+ c = Container(); cw = Watcher(c); c.setLabel('c')
51
+ print('Step 2')
52
+ t = PacketOfTriangulation3(); t.newTetrahedron(); tw = Watcher(t); t.setLabel('t')
53
+ print('Step 3')
54
+ c.append(t)
55
+ print('Step 4')
56
+ t = None
57
+ print('Step 5')
58
+ c = None # Should destroy both c and t
59
+ print('Step 6')
60
+
61
+ print('Root destruction case')
62
+ print('Step 1')
63
+ a = Container(); aw = Watcher(a); a.setLabel('a')
64
+ print('Step 2')
65
+ b = PacketOfTriangulation3(); bw = Watcher(b); b.setLabel('b')
66
+ print('Step 3')
67
+ a.append(b)
68
+ print('Step 4')
69
+ a = None # Should destroy a only, since we are holding a reference to b
70
+ print('Step 5')
71
+ # b remains alive but orphaned
72
+ print(b.label())
73
+ print(b.parent())
74
+
75
+ print('Orphan case')
76
+ print('Step 1')
77
+ p = Container(); pw = Watcher(p); p.setLabel('p')
78
+ print('Step 2')
79
+ q = PacketOfTriangulation3(); qw = Watcher(q); q.setLabel('q')
80
+ print('Step 3')
81
+ p.append(q)
82
+ print('Step 4')
83
+ q.makeOrphan()
84
+ print('Step 5')
85
+ p = None # Should destroy p
86
+ print('Step 6')
87
+ q = None # Should destroy q
88
+ print('Step 7')
89
+
90
+ # An example of makeOrphan where we never held the reference to the
91
+ # child in the first place.
92
+ print('Multiple orphan case')
93
+ print('Step 1')
94
+ x = regina.open(testpath + '/file1.rga'); xw = Watcher(x); x.setLabel('x')
95
+ print('Step 2')
96
+ y = x.lastChild(); yw = Watcher(y); y.setLabel('y')
97
+ print('Step 3')
98
+ y.makeOrphan()
99
+ print('Step 4')
100
+ x = None # Should destroy x
101
+ print('Step 5')
102
+ y = None # Should destroy y
103
+ print('Step 6')
104
+
105
+ # An example like above, but where we hold many references to the same
106
+ # child packet.
107
+ print('Many references case')
108
+ print('Step 1')
109
+ f = regina.open(testpath + '/file2.rga'); fw = Watcher(f); f.setLabel('f')
110
+ print('Step 2')
111
+ g = f.lastChild(); gw = Watcher(g); g.setLabel('g')
112
+ print('Step 3')
113
+ h = f.lastChild(); hw = Watcher(h) # h is the same packet as g
114
+ print('Step 4')
115
+ g.makeOrphan()
116
+ print('Step 5')
117
+ f = None # Should destroy f
118
+ print('Step 6')
119
+ g = None
120
+ print('Step 7')
121
+ h = None # Should destroy g (and there are two watchers now)
122
+ print('Step 8')
123
+
124
+ # b should still be alive at this point.
125
+ print(b)
126
+ print(b.label())
127
+
128
+ # Destroy b's watcher now, so it does not try to call print() as the
129
+ # entire python system is shutting down
130
+ bw = None
131
+
132
+ # An example where we drop the root of a tree but hang on to references
133
+ # deeper within the tree.
134
+ print('Deep reference case')
135
+ x = Container(); x.setLabel('x'); xw = Watcher(x);
136
+ y = Container(); y.setLabel('y'); yw = Watcher(y);
137
+ z1 = Container(); z1.setLabel('z1'); z1w = Watcher(z1);
138
+ z2 = Container(); z2.setLabel('z2'); z2w = Watcher(z2);
139
+ print('Step 1')
140
+ x.append(z1)
141
+ x.append(z2)
142
+ z1.append(y)
143
+ print('Step 2')
144
+ z2 = None
145
+ print('Step 3')
146
+ x = None # Should delete x and z2, with the child z2 going first
147
+ print('Step 4')
148
+ z1 = None # Should delete z1
149
+ print('Step 5')
150
+ y = None # Should delete y
151
+ print('Step 6')
152
+
@@ -0,0 +1,62 @@
1
+ Script variables #1
2
+ Step 1
3
+ Step 2
4
+ Step 3
5
+ Step 4
6
+ Step 5
7
+ Step 6
8
+ Step 7
9
+ Step 8
10
+ Destroying: a1
11
+ Step 9
12
+ Bounded orientable 3-D triangulation, f = ( 4 6 4 1 )
13
+ b1
14
+ None
15
+ Empty script, foo = <b1>
16
+ c1
17
+ None
18
+ Script variables #2
19
+ Step 1
20
+ Step 2
21
+ Step 3
22
+ Destroying: c1
23
+ Step 4
24
+ Step 5
25
+ Step 6
26
+ Step 7
27
+ Destroying: b1
28
+ Step 8
29
+ Step 9
30
+ Destroying: a2
31
+ Step 10
32
+ Bounded orientable 3-D triangulation, f = ( 4 6 4 1 )
33
+ b2
34
+ None
35
+ Empty script, foo = (null)
36
+ c2
37
+ None
38
+ Example triangulation
39
+ Step 1
40
+ Step 2
41
+ Destroying: f
42
+ Step 3
43
+ Vertex link #1
44
+ Step 1
45
+ Step 2
46
+ Step 3
47
+ Destroying: t1
48
+ Step 4
49
+ qvLLMvvMQegfhlnpopaabcbcaeb
50
+ Vertex link #2
51
+ Step 1
52
+ Step 2
53
+ Step 3
54
+ Destroying: t2
55
+ Step 4
56
+ Step 5
57
+ Bounded orientable 3-D triangulation, f = ( 4 6 4 1 )
58
+ b2
59
+ None
60
+ Empty script, foo = (null)
61
+ c2
62
+ None
@@ -0,0 +1,122 @@
1
+ # Regina - A Normal Surface Theory Calculator
2
+ # Python Test Suite Component
3
+ #
4
+ # Copyright (c) 2015-2025, Ben Burton
5
+ # For further details contact Ben Burton (bab@debian.org).
6
+ #
7
+ # Tests the independence and lifespans of engine-generated packets.
8
+ #
9
+ # This file is a single component of Regina's python test suite. To run
10
+ # the python test suite, move to the main python directory in the source
11
+ # tree and run "make check".
12
+ #
13
+ # This program is free software; you can redistribute it and/or
14
+ # modify it under the terms of the GNU General Public License as
15
+ # published by the Free Software Foundation; either version 2 of the
16
+ # License, or (at your option) any later version.
17
+ #
18
+ # As an exception, when this program is distributed through (i) the
19
+ # App Store by Apple Inc.; (ii) the Mac App Store by Apple Inc.; or
20
+ # (iii) Google Play by Google Inc., then that store may impose any
21
+ # digital rights management, device limits and/or redistribution
22
+ # restrictions that are required by its terms of service.
23
+ #
24
+ # This program is distributed in the hope that it will be useful, but
25
+ # WITHOUT ANY WARRANTY; without even the implied warranty of
26
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
27
+ # General Public License for more details.
28
+ #
29
+ # You should have received a copy of the GNU General Public License
30
+ # along with this program. If not, see <https://www.gnu.org/licenses/>.
31
+
32
+ class Watcher(PacketListener):
33
+ def __init__(self, packet, label):
34
+ PacketListener.__init__(self)
35
+ packet.setLabel(label)
36
+ packet.listen(self)
37
+ def packetBeingDestroyed(self, packet):
38
+ print('Destroying: ' + packet.label())
39
+
40
+
41
+ print('Script variables #1')
42
+ print('Step 1')
43
+ a = Container(); aw1 = Watcher(a, 'a1')
44
+ print('Step 2')
45
+ b = PacketOfTriangulation3(); dummy = b.newSimplex(); bw1 = Watcher(b, 'b1')
46
+ print('Step 3')
47
+ c = Script(); cw1 = Watcher(c, 'c1')
48
+ print('Step 4')
49
+ a.append(b)
50
+ print('Step 5')
51
+ a.append(c)
52
+ print('Step 6')
53
+ dummy = c.addVariable('foo', b)
54
+ print('Step 7')
55
+ val = c.variableValue('foo')
56
+ print('Step 8')
57
+ a = None # destroys a1
58
+ print('Step 9')
59
+ # (b1 == val) and c1 are orphaned but alive
60
+ print(b); print(b.label()); print(b.parent())
61
+ print(c); print(c.label()); print(c.parent())
62
+
63
+ print('Script variables #2')
64
+ print('Step 1')
65
+ a = Container(); aw2 = Watcher(a, 'a2')
66
+ print('Step 2')
67
+ b = PacketOfTriangulation3(); dummy = b.newSimplex(); bw2 = Watcher(b, 'b2')
68
+ print('Step 3')
69
+ c = Script(); cw2 = Watcher(c, 'c2') # destroys c1
70
+ print('Step 4')
71
+ a.append(b)
72
+ print('Step 5')
73
+ a.append(c)
74
+ print('Step 6')
75
+ dummy = c.addVariable('foo', a)
76
+ print('Step 7')
77
+ val = c.variableValue('foo') # destroys b1
78
+ print('Step 8')
79
+ a = None
80
+ print('Step 9')
81
+ val = None # destroys a
82
+ print('Step 10')
83
+ # b2 and c2 are orphaned but alive
84
+ print(b); print(b.label()); print(b.parent())
85
+ print(c); print(c.label()); print(c.parent())
86
+
87
+ print('Example triangulation')
88
+ print('Step 1')
89
+ f = PacketOfSnapPeaTriangulation(ExampleSnapPea.figureEight()); fw = Watcher(f, 'f')
90
+ print('Step 2')
91
+ f = None # destroys f
92
+ print('Step 3')
93
+
94
+ print('Vertex link #1')
95
+ print('Step 1')
96
+ t = PacketOfTriangulation3(Example3.lens(7,1)); tw = Watcher(t, 't1')
97
+ print('Step 2')
98
+ v = t.vertex(0).buildLink()
99
+ print('Step 3')
100
+ t = None # destroys t1 but not v1
101
+ print('Step 4')
102
+ print(v.isoSig())
103
+
104
+ print('Vertex link #2')
105
+ print('Step 1')
106
+ t = PacketOfTriangulation3(Example3.lens(7,1)); tw = Watcher(t, 't2')
107
+ print('Step 2')
108
+ v = t.vertex(0).buildLink() # destroys v1
109
+ print('Step 3')
110
+ t = None # destroys t2
111
+ print('Step 4')
112
+ v = None # destroys v2
113
+ print('Step 5')
114
+
115
+ # b2 and c2 are still alive at this point
116
+ print(b); print(b.label()); print(b.parent())
117
+ print(c); print(c.label()); print(c.parent())
118
+
119
+ # Destroy their watchers now, so they do not try to call print() as the
120
+ # entire python system is shutting down
121
+ bw2 = None
122
+ cw2 = None
@@ -0,0 +1,92 @@
1
+ Vertices of triangulation: vertices()
2
+ Step 1
3
+ Step 2
4
+ Step 3
5
+ Step 4
6
+ Destroying: t
7
+ Step 5
8
+ Vertices of triangulation: edges()
9
+ Step 1
10
+ Step 2
11
+ Step 3
12
+ Step 4
13
+ Destroying: t
14
+ Step 5
15
+ Vertices of triangulation: vertex()
16
+ Step 1
17
+ Step 2
18
+ Step 3
19
+ Step 4
20
+ Destroying: t
21
+ Step 5
22
+ Vertices of triangulation: edge()
23
+ Step 1
24
+ Step 2
25
+ Step 3
26
+ Step 4
27
+ Destroying: t
28
+ Step 5
29
+ Vertices of triangulation: faces<0>()
30
+ Step 1
31
+ Step 2
32
+ Step 3
33
+ Step 4
34
+ Destroying: t
35
+ Step 5
36
+ Vertices of triangulation: faces<1>()
37
+ Step 1
38
+ Step 2
39
+ Step 3
40
+ Step 4
41
+ Destroying: t
42
+ Step 5
43
+ Vertices of triangulation: face<0>()
44
+ Step 1
45
+ Step 2
46
+ Step 3
47
+ Step 4
48
+ Destroying: t
49
+ Step 5
50
+ Vertices of triangulation: face<1>()
51
+ Step 1
52
+ Step 2
53
+ Step 3
54
+ Step 4
55
+ Destroying: t
56
+ Step 5
57
+ Vertices of simplex
58
+ Step 1
59
+ Step 2
60
+ Step 3
61
+ Step 4
62
+ Step 5
63
+ Destroying: t
64
+ Step 6
65
+ Step 7
66
+ Vertices of face
67
+ Step 1
68
+ Step 2
69
+ Step 3
70
+ Step 4
71
+ Step 5
72
+ Destroying: t
73
+ Step 6
74
+ Step 7
75
+ Vertices of component
76
+ Step 1
77
+ Step 2
78
+ Step 3
79
+ Step 4
80
+ Step 5
81
+ Destroying: t
82
+ Step 6
83
+ Step 7
84
+ Vertices of boundary component
85
+ Step 1
86
+ Step 2
87
+ Step 3
88
+ Step 4
89
+ Step 5
90
+ Destroying: t
91
+ Step 6
92
+ Step 7