snappy 3.1.1__cp38-cp38-win_amd64.whl → 3.2__cp38-cp38-win_amd64.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 (476) hide show
  1. snappy/CyOpenGL.cp38-win_amd64.pyd +0 -0
  2. snappy/SnapPy.cp38-win_amd64.pyd +0 -0
  3. snappy/SnapPyHP.cp38-win_amd64.pyd +0 -0
  4. snappy/__init__.py +299 -402
  5. snappy/app.py +70 -20
  6. snappy/browser.py +18 -17
  7. snappy/canonical.py +249 -0
  8. snappy/{verify/cusp_shapes.py → cusps/__init__.py} +8 -18
  9. snappy/cusps/cusp_area_matrix.py +101 -0
  10. snappy/{verify/cusp_areas.py → cusps/cusp_areas_from_matrix.py} +23 -39
  11. snappy/cusps/maximal_cusp_area_matrix.py +136 -0
  12. snappy/cusps/test.py +21 -0
  13. snappy/cusps/trig_cusp_area_matrix.py +63 -0
  14. snappy/database.py +10 -9
  15. snappy/decorated_isosig.py +337 -114
  16. snappy/dev/extended_ptolemy/complexVolumesClosed.py +40 -7
  17. snappy/dev/extended_ptolemy/extended.py +3 -3
  18. snappy/dev/extended_ptolemy/phc_wrapper.py +10 -10
  19. snappy/dev/vericlosed/oneVertexTruncatedComplex.py +1 -1
  20. snappy/doc/_images/m004_paper_plane_on_systole.jpg +0 -0
  21. snappy/doc/_images/m125_paper_plane.jpg +0 -0
  22. snappy/doc/_images/o9_00000_systole_paper_plane.jpg +0 -0
  23. snappy/doc/_images/o9_00000_systole_paper_plane_closer.jpg +0 -0
  24. snappy/doc/_sources/additional_classes.rst.txt +40 -40
  25. snappy/doc/_sources/bugs.rst.txt +14 -14
  26. snappy/doc/_sources/censuses.rst.txt +51 -51
  27. snappy/doc/_sources/credits.rst.txt +75 -75
  28. snappy/doc/_sources/development.rst.txt +259 -239
  29. snappy/doc/_sources/index.rst.txt +182 -115
  30. snappy/doc/_sources/installing.rst.txt +247 -264
  31. snappy/doc/_sources/manifold.rst.txt +6 -6
  32. snappy/doc/_sources/manifoldhp.rst.txt +46 -46
  33. snappy/doc/_sources/news.rst.txt +355 -283
  34. snappy/doc/_sources/other.rst.txt +25 -25
  35. snappy/doc/_sources/platonic_census.rst.txt +20 -20
  36. snappy/doc/_sources/plink.rst.txt +102 -102
  37. snappy/doc/_sources/ptolemy.rst.txt +66 -66
  38. snappy/doc/_sources/ptolemy_classes.rst.txt +42 -42
  39. snappy/doc/_sources/ptolemy_examples1.rst.txt +298 -297
  40. snappy/doc/_sources/ptolemy_examples2.rst.txt +363 -363
  41. snappy/doc/_sources/ptolemy_examples3.rst.txt +301 -301
  42. snappy/doc/_sources/ptolemy_examples4.rst.txt +61 -61
  43. snappy/doc/_sources/ptolemy_prelim.rst.txt +105 -105
  44. snappy/doc/_sources/screenshots.rst.txt +21 -21
  45. snappy/doc/_sources/snap.rst.txt +87 -87
  46. snappy/doc/_sources/snappy.rst.txt +28 -28
  47. snappy/doc/_sources/spherogram.rst.txt +103 -103
  48. snappy/doc/_sources/todo.rst.txt +47 -47
  49. snappy/doc/_sources/triangulation.rst.txt +11 -11
  50. snappy/doc/_sources/tutorial.rst.txt +49 -49
  51. snappy/doc/_sources/verify.rst.txt +210 -150
  52. snappy/doc/_sources/verify_internals.rst.txt +79 -90
  53. snappy/doc/_static/basic.css +924 -902
  54. snappy/doc/_static/css/badge_only.css +1 -1
  55. snappy/doc/_static/css/theme.css +1 -1
  56. snappy/doc/_static/doctools.js +1 -1
  57. snappy/doc/_static/documentation_options.js +12 -13
  58. snappy/doc/_static/fonts/Lato/lato-bold.eot +0 -0
  59. snappy/doc/_static/fonts/Lato/lato-bold.ttf +0 -0
  60. snappy/doc/_static/fonts/Lato/lato-bold.woff +0 -0
  61. snappy/doc/_static/fonts/Lato/lato-bold.woff2 +0 -0
  62. snappy/doc/_static/fonts/Lato/lato-bolditalic.eot +0 -0
  63. snappy/doc/_static/fonts/Lato/lato-bolditalic.ttf +0 -0
  64. snappy/doc/_static/fonts/Lato/lato-bolditalic.woff +0 -0
  65. snappy/doc/_static/fonts/Lato/lato-bolditalic.woff2 +0 -0
  66. snappy/doc/_static/fonts/Lato/lato-italic.eot +0 -0
  67. snappy/doc/_static/fonts/Lato/lato-italic.ttf +0 -0
  68. snappy/doc/_static/fonts/Lato/lato-italic.woff +0 -0
  69. snappy/doc/_static/fonts/Lato/lato-italic.woff2 +0 -0
  70. snappy/doc/_static/fonts/Lato/lato-regular.eot +0 -0
  71. snappy/doc/_static/fonts/Lato/lato-regular.ttf +0 -0
  72. snappy/doc/_static/fonts/Lato/lato-regular.woff +0 -0
  73. snappy/doc/_static/fonts/Lato/lato-regular.woff2 +0 -0
  74. snappy/doc/_static/fonts/RobotoSlab/roboto-slab-v7-bold.eot +0 -0
  75. snappy/doc/_static/fonts/RobotoSlab/roboto-slab-v7-bold.ttf +0 -0
  76. snappy/doc/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff +0 -0
  77. snappy/doc/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff2 +0 -0
  78. snappy/doc/_static/fonts/RobotoSlab/roboto-slab-v7-regular.eot +0 -0
  79. snappy/doc/_static/fonts/RobotoSlab/roboto-slab-v7-regular.ttf +0 -0
  80. snappy/doc/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff +0 -0
  81. snappy/doc/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff2 +0 -0
  82. snappy/doc/_static/js/versions.js +228 -0
  83. snappy/doc/_static/language_data.js +199 -199
  84. snappy/doc/_static/pygments.css +74 -73
  85. snappy/doc/_static/searchtools.js +125 -71
  86. snappy/doc/_static/snappy_furo.css +33 -33
  87. snappy/doc/_static/snappy_sphinx_rtd_theme.css +42 -42
  88. snappy/doc/_static/sphinx_highlight.js +13 -3
  89. snappy/doc/additional_classes.html +1499 -1330
  90. snappy/doc/bugs.html +131 -134
  91. snappy/doc/censuses.html +426 -445
  92. snappy/doc/credits.html +180 -183
  93. snappy/doc/development.html +383 -363
  94. snappy/doc/genindex.html +1330 -1409
  95. snappy/doc/index.html +261 -206
  96. snappy/doc/installing.html +345 -363
  97. snappy/doc/manifold.html +3451 -2839
  98. snappy/doc/manifoldhp.html +179 -182
  99. snappy/doc/news.html +387 -329
  100. snappy/doc/objects.inv +0 -0
  101. snappy/doc/other.html +160 -162
  102. snappy/doc/platonic_census.html +374 -377
  103. snappy/doc/plink.html +209 -212
  104. snappy/doc/ptolemy.html +253 -255
  105. snappy/doc/ptolemy_classes.html +1143 -1146
  106. snappy/doc/ptolemy_examples1.html +408 -410
  107. snappy/doc/ptolemy_examples2.html +470 -473
  108. snappy/doc/ptolemy_examples3.html +413 -416
  109. snappy/doc/ptolemy_examples4.html +194 -197
  110. snappy/doc/ptolemy_prelim.html +247 -250
  111. snappy/doc/py-modindex.html +164 -167
  112. snappy/doc/screenshots.html +140 -142
  113. snappy/doc/search.html +134 -137
  114. snappy/doc/searchindex.js +1 -1
  115. snappy/doc/snap.html +201 -204
  116. snappy/doc/snappy.html +180 -182
  117. snappy/doc/spherogram.html +1210 -1213
  118. snappy/doc/todo.html +165 -168
  119. snappy/doc/triangulation.html +1583 -1474
  120. snappy/doc/tutorial.html +158 -161
  121. snappy/doc/verify.html +329 -275
  122. snappy/doc/verify_internals.html +1234 -1691
  123. snappy/drilling/__init__.py +153 -235
  124. snappy/drilling/barycentric.py +103 -0
  125. snappy/drilling/constants.py +0 -2
  126. snappy/drilling/crush.py +56 -130
  127. snappy/drilling/cusps.py +12 -6
  128. snappy/drilling/debug.py +2 -1
  129. snappy/drilling/exceptions.py +7 -40
  130. snappy/drilling/moves.py +302 -243
  131. snappy/drilling/perturb.py +63 -37
  132. snappy/drilling/shorten.py +36 -0
  133. snappy/drilling/subdivide.py +0 -5
  134. snappy/drilling/test.py +23 -0
  135. snappy/drilling/test_cases.py +126 -0
  136. snappy/drilling/tracing.py +9 -37
  137. snappy/exceptions.py +18 -5
  138. snappy/exterior_to_link/barycentric_geometry.py +2 -4
  139. snappy/exterior_to_link/main.py +8 -7
  140. snappy/exterior_to_link/mcomplex_with_link.py +2 -2
  141. snappy/exterior_to_link/rational_linear_algebra.py +1 -1
  142. snappy/exterior_to_link/rational_linear_algebra_wrapped.py +1 -1
  143. snappy/exterior_to_link/test.py +21 -33
  144. snappy/geometric_structure/__init__.py +212 -0
  145. snappy/geometric_structure/cusp_neighborhood/__init__.py +3 -0
  146. snappy/geometric_structure/cusp_neighborhood/complex_cusp_cross_section.py +697 -0
  147. snappy/geometric_structure/cusp_neighborhood/cusp_cross_section_base.py +484 -0
  148. snappy/geometric_structure/cusp_neighborhood/exceptions.py +42 -0
  149. snappy/geometric_structure/cusp_neighborhood/real_cusp_cross_section.py +298 -0
  150. snappy/geometric_structure/cusp_neighborhood/tiles_for_cusp_neighborhood.py +159 -0
  151. snappy/geometric_structure/cusp_neighborhood/vertices.py +32 -0
  152. snappy/geometric_structure/geodesic/__init__.py +0 -0
  153. snappy/geometric_structure/geodesic/add_core_curves.py +152 -0
  154. snappy/geometric_structure/geodesic/avoid_core_curves.py +369 -0
  155. snappy/geometric_structure/geodesic/canonical_keys.py +52 -0
  156. snappy/geometric_structure/geodesic/check_away_from_core_curve.py +60 -0
  157. snappy/geometric_structure/geodesic/constants.py +6 -0
  158. snappy/geometric_structure/geodesic/exceptions.py +22 -0
  159. snappy/{drilling → geometric_structure/geodesic}/fixed_points.py +34 -9
  160. snappy/{drilling/geodesic_info.py → geometric_structure/geodesic/geodesic_start_point_info.py} +139 -180
  161. snappy/geometric_structure/geodesic/graph_trace_helper.py +67 -0
  162. snappy/geometric_structure/geodesic/line.py +30 -0
  163. snappy/geometric_structure/geodesic/multiplicity.py +127 -0
  164. snappy/geometric_structure/geodesic/tiles_for_geodesic.py +101 -0
  165. snappy/geometric_structure/test.py +22 -0
  166. snappy/gui.py +23 -13
  167. snappy/horoviewer.py +7 -7
  168. snappy/hyperboloid/__init__.py +96 -31
  169. snappy/hyperboloid/distances.py +245 -0
  170. snappy/hyperboloid/horoball.py +19 -0
  171. snappy/hyperboloid/line.py +35 -0
  172. snappy/hyperboloid/point.py +9 -0
  173. snappy/hyperboloid/triangle.py +29 -0
  174. snappy/isometry_signature.py +382 -0
  175. snappy/len_spec/__init__.py +596 -0
  176. snappy/len_spec/geodesic_info.py +110 -0
  177. snappy/len_spec/geodesic_key_info_dict.py +117 -0
  178. snappy/len_spec/geodesic_piece.py +143 -0
  179. snappy/len_spec/geometric_structure.py +182 -0
  180. snappy/len_spec/geometry.py +80 -0
  181. snappy/len_spec/length_spectrum_geodesic_info.py +170 -0
  182. snappy/len_spec/spine.py +206 -0
  183. snappy/len_spec/test.py +24 -0
  184. snappy/len_spec/test_cases.py +69 -0
  185. snappy/len_spec/tile.py +275 -0
  186. snappy/len_spec/word.py +86 -0
  187. snappy/math_basics.py +39 -13
  188. snappy/matrix.py +52 -9
  189. snappy/number.py +12 -6
  190. snappy/numeric_output_checker.py +2 -3
  191. snappy/pari.py +8 -4
  192. snappy/phone_home.py +2 -1
  193. snappy/polyviewer.py +8 -8
  194. snappy/ptolemy/__init__.py +1 -1
  195. snappy/ptolemy/component.py +2 -2
  196. snappy/ptolemy/coordinates.py +25 -25
  197. snappy/ptolemy/findLoops.py +9 -9
  198. snappy/ptolemy/manifoldMethods.py +27 -29
  199. snappy/ptolemy/polynomial.py +50 -57
  200. snappy/ptolemy/processFileBase.py +60 -0
  201. snappy/ptolemy/ptolemyVariety.py +109 -41
  202. snappy/ptolemy/reginaWrapper.py +4 -4
  203. snappy/ptolemy/rur.py +1 -1
  204. snappy/ptolemy/solutionsToPrimeIdealGroebnerBasis.py +9 -9
  205. snappy/ptolemy/test.py +99 -54
  206. snappy/ptolemy/utilities.py +1 -1
  207. snappy/raytracing/__init__.py +64 -0
  208. snappy/raytracing/additional_horospheres.py +64 -0
  209. snappy/raytracing/additional_len_spec_choices.py +63 -0
  210. snappy/raytracing/cohomology_fractal.py +0 -3
  211. snappy/raytracing/eyeball.py +123 -0
  212. snappy/raytracing/finite_raytracing_data.py +17 -17
  213. snappy/raytracing/finite_viewer.py +15 -15
  214. snappy/raytracing/geodesic_tube_info.py +93 -63
  215. snappy/raytracing/geodesics.py +94 -64
  216. snappy/raytracing/geodesics_window.py +56 -34
  217. snappy/raytracing/gui_utilities.py +21 -6
  218. snappy/raytracing/hyperboloid_navigation.py +29 -4
  219. snappy/raytracing/hyperboloid_utilities.py +73 -73
  220. snappy/raytracing/ideal_raytracing_data.py +121 -91
  221. snappy/raytracing/inside_viewer.py +199 -66
  222. snappy/raytracing/pack.py +22 -0
  223. snappy/raytracing/raytracing_data.py +37 -25
  224. snappy/raytracing/raytracing_view.py +70 -65
  225. snappy/raytracing/shaders/Eye.png +0 -0
  226. snappy/raytracing/shaders/NonGeometric.png +0 -0
  227. snappy/raytracing/shaders/__init__.py +39 -3
  228. snappy/raytracing/shaders/fragment.glsl +451 -133
  229. snappy/raytracing/test.py +29 -0
  230. snappy/raytracing/tooltip.py +146 -0
  231. snappy/raytracing/upper_halfspace_utilities.py +42 -9
  232. snappy/sage_helper.py +67 -134
  233. snappy/settings.py +90 -77
  234. snappy/shell.py +2 -0
  235. snappy/snap/character_varieties.py +2 -2
  236. snappy/snap/find_field.py +4 -3
  237. snappy/snap/fundamental_polyhedron.py +2 -2
  238. snappy/snap/kernel_structures.py +5 -1
  239. snappy/snap/nsagetools.py +9 -8
  240. snappy/snap/peripheral/dual_cellulation.py +4 -3
  241. snappy/snap/peripheral/peripheral.py +2 -2
  242. snappy/snap/peripheral/surface.py +5 -5
  243. snappy/snap/peripheral/test.py +1 -1
  244. snappy/snap/polished_reps.py +8 -8
  245. snappy/snap/slice_obs_HKL.py +16 -14
  246. snappy/snap/t3mlite/arrow.py +3 -3
  247. snappy/snap/t3mlite/edge.py +3 -3
  248. snappy/snap/t3mlite/homology.py +2 -2
  249. snappy/snap/t3mlite/mcomplex.py +3 -3
  250. snappy/snap/t3mlite/simplex.py +12 -0
  251. snappy/snap/t3mlite/spun.py +18 -17
  252. snappy/snap/t3mlite/test_vs_regina.py +4 -4
  253. snappy/snap/test.py +37 -53
  254. snappy/snap/utilities.py +4 -5
  255. snappy/test.py +121 -138
  256. snappy/test_cases.py +263 -0
  257. snappy/testing.py +131 -0
  258. snappy/tiling/__init__.py +2 -0
  259. snappy/tiling/canonical_key_dict.py +59 -0
  260. snappy/tiling/dict_based_set.py +79 -0
  261. snappy/tiling/floor.py +49 -0
  262. snappy/tiling/hyperboloid_dict.py +54 -0
  263. snappy/tiling/iter_utils.py +78 -0
  264. snappy/tiling/lifted_tetrahedron.py +22 -0
  265. snappy/tiling/lifted_tetrahedron_set.py +54 -0
  266. snappy/tiling/real_hash_dict.py +164 -0
  267. snappy/tiling/test.py +23 -0
  268. snappy/tiling/tile.py +215 -0
  269. snappy/tiling/triangle.py +33 -0
  270. snappy/tkterminal.py +113 -84
  271. snappy/twister/main.py +1 -7
  272. snappy/twister/twister_core.cp38-win_amd64.pyd +0 -0
  273. snappy/upper_halfspace/__init__.py +78 -17
  274. snappy/verify/__init__.py +3 -7
  275. snappy/verify/{verifyCanonical.py → canonical.py} +78 -70
  276. snappy/verify/complex_volume/adjust_torsion.py +1 -2
  277. snappy/verify/complex_volume/closed.py +13 -13
  278. snappy/verify/complex_volume/cusped.py +6 -6
  279. snappy/verify/complex_volume/extended_bloch.py +5 -8
  280. snappy/verify/{cuspTranslations.py → cusp_translations.py} +1 -1
  281. snappy/verify/edge_equations.py +80 -0
  282. snappy/verify/exceptions.py +0 -55
  283. snappy/verify/{verifyHyperbolicity.py → hyperbolicity.py} +3 -3
  284. snappy/verify/interval_newton_shapes_engine.py +7 -5
  285. snappy/verify/interval_tree.py +5 -5
  286. snappy/verify/krawczyk_shapes_engine.py +17 -18
  287. snappy/verify/maximal_cusp_area_matrix/__init__.py +7 -74
  288. snappy/verify/maximal_cusp_area_matrix/cusp_tiling_engine.py +3 -4
  289. snappy/verify/maximal_cusp_area_matrix/cusp_translate_engine.py +1 -1
  290. snappy/verify/{realAlgebra.py → real_algebra.py} +1 -1
  291. snappy/verify/shapes.py +5 -3
  292. snappy/verify/short_slopes.py +39 -41
  293. snappy/verify/{squareExtensions.py → square_extensions.py} +14 -11
  294. snappy/verify/test.py +57 -60
  295. snappy/verify/upper_halfspace/extended_matrix.py +1 -1
  296. snappy/verify/upper_halfspace/finite_point.py +3 -4
  297. snappy/verify/upper_halfspace/ideal_point.py +9 -9
  298. snappy/verify/volume.py +2 -2
  299. snappy/version.py +2 -2
  300. {snappy-3.1.1.dist-info → snappy-3.2.dist-info}/METADATA +14 -10
  301. snappy-3.2.dist-info/RECORD +503 -0
  302. {snappy-3.1.1.dist-info → snappy-3.2.dist-info}/WHEEL +1 -1
  303. {snappy-3.1.1.dist-info → snappy-3.2.dist-info}/top_level.txt +6 -1
  304. snappy/__pycache__/__init__.cpython-38.pyc +0 -0
  305. snappy/__pycache__/browser.cpython-38.pyc +0 -0
  306. snappy/__pycache__/cache.cpython-38.pyc +0 -0
  307. snappy/__pycache__/database.cpython-38.pyc +0 -0
  308. snappy/__pycache__/db_utilities.cpython-38.pyc +0 -0
  309. snappy/__pycache__/decorated_isosig.cpython-38.pyc +0 -0
  310. snappy/__pycache__/exceptions.cpython-38.pyc +0 -0
  311. snappy/__pycache__/export_stl.cpython-38.pyc +0 -0
  312. snappy/__pycache__/filedialog.cpython-38.pyc +0 -0
  313. snappy/__pycache__/gui.cpython-38.pyc +0 -0
  314. snappy/__pycache__/horoviewer.cpython-38.pyc +0 -0
  315. snappy/__pycache__/math_basics.cpython-38.pyc +0 -0
  316. snappy/__pycache__/matrix.cpython-38.pyc +0 -0
  317. snappy/__pycache__/number.cpython-38.pyc +0 -0
  318. snappy/__pycache__/numeric_output_checker.cpython-38.pyc +0 -0
  319. snappy/__pycache__/pari.cpython-38.pyc +0 -0
  320. snappy/__pycache__/polyviewer.cpython-38.pyc +0 -0
  321. snappy/__pycache__/sage_helper.cpython-38.pyc +0 -0
  322. snappy/__pycache__/version.cpython-38.pyc +0 -0
  323. snappy/doc/_sources/verify_canon.rst.txt +0 -90
  324. snappy/doc/_static/jquery-3.6.0.js +0 -10881
  325. snappy/doc/_static/js/html5shiv-printshiv.min.js +0 -4
  326. snappy/doc/_static/js/html5shiv.min.js +0 -4
  327. snappy/doc/_static/underscore-1.13.1.js +0 -2042
  328. snappy/doc/_static/underscore.js +0 -6
  329. snappy/doc/verify_canon.html +0 -304
  330. snappy/drilling/__pycache__/__init__.cpython-38.pyc +0 -0
  331. snappy/drilling/__pycache__/constants.cpython-38.pyc +0 -0
  332. snappy/drilling/__pycache__/crush.cpython-38.pyc +0 -0
  333. snappy/drilling/__pycache__/cusps.cpython-38.pyc +0 -0
  334. snappy/drilling/__pycache__/debug.cpython-38.pyc +0 -0
  335. snappy/drilling/__pycache__/epsilons.cpython-38.pyc +0 -0
  336. snappy/drilling/__pycache__/exceptions.cpython-38.pyc +0 -0
  337. snappy/drilling/__pycache__/fixed_points.cpython-38.pyc +0 -0
  338. snappy/drilling/__pycache__/geodesic_info.cpython-38.pyc +0 -0
  339. snappy/drilling/__pycache__/geodesic_tube.cpython-38.pyc +0 -0
  340. snappy/drilling/__pycache__/geometric_structure.cpython-38.pyc +0 -0
  341. snappy/drilling/__pycache__/line.cpython-38.pyc +0 -0
  342. snappy/drilling/__pycache__/moves.cpython-38.pyc +0 -0
  343. snappy/drilling/__pycache__/peripheral_curves.cpython-38.pyc +0 -0
  344. snappy/drilling/__pycache__/perturb.cpython-38.pyc +0 -0
  345. snappy/drilling/__pycache__/quotient_space.cpython-38.pyc +0 -0
  346. snappy/drilling/__pycache__/spatial_dict.cpython-38.pyc +0 -0
  347. snappy/drilling/__pycache__/subdivide.cpython-38.pyc +0 -0
  348. snappy/drilling/__pycache__/tracing.cpython-38.pyc +0 -0
  349. snappy/drilling/geodesic_tube.py +0 -441
  350. snappy/drilling/geometric_structure.py +0 -366
  351. snappy/drilling/line.py +0 -122
  352. snappy/drilling/quotient_space.py +0 -94
  353. snappy/drilling/spatial_dict.py +0 -128
  354. snappy/exterior_to_link/__pycache__/__init__.cpython-38.pyc +0 -0
  355. snappy/exterior_to_link/__pycache__/barycentric_geometry.cpython-38.pyc +0 -0
  356. snappy/exterior_to_link/__pycache__/exceptions.cpython-38.pyc +0 -0
  357. snappy/exterior_to_link/__pycache__/hyp_utils.cpython-38.pyc +0 -0
  358. snappy/exterior_to_link/__pycache__/link_projection.cpython-38.pyc +0 -0
  359. snappy/exterior_to_link/__pycache__/main.cpython-38.pyc +0 -0
  360. snappy/exterior_to_link/__pycache__/mcomplex_with_expansion.cpython-38.pyc +0 -0
  361. snappy/exterior_to_link/__pycache__/mcomplex_with_link.cpython-38.pyc +0 -0
  362. snappy/exterior_to_link/__pycache__/mcomplex_with_memory.cpython-38.pyc +0 -0
  363. snappy/exterior_to_link/__pycache__/pl_utils.cpython-38.pyc +0 -0
  364. snappy/exterior_to_link/__pycache__/put_in_S3.cpython-38.pyc +0 -0
  365. snappy/exterior_to_link/__pycache__/rational_linear_algebra.cpython-38.pyc +0 -0
  366. snappy/exterior_to_link/__pycache__/simplify_to_base_tri.cpython-38.pyc +0 -0
  367. snappy/exterior_to_link/__pycache__/stored_moves.cpython-38.pyc +0 -0
  368. snappy/hyperboloid/__pycache__/__init__.cpython-38.pyc +0 -0
  369. snappy/manifolds/__pycache__/__init__.cpython-38.pyc +0 -0
  370. snappy/ptolemy/__pycache__/__init__.cpython-38.pyc +0 -0
  371. snappy/ptolemy/__pycache__/component.cpython-38.pyc +0 -0
  372. snappy/ptolemy/__pycache__/coordinates.cpython-38.pyc +0 -0
  373. snappy/ptolemy/__pycache__/fieldExtensions.cpython-38.pyc +0 -0
  374. snappy/ptolemy/__pycache__/findLoops.cpython-38.pyc +0 -0
  375. snappy/ptolemy/__pycache__/homology.cpython-38.pyc +0 -0
  376. snappy/ptolemy/__pycache__/manifoldMethods.cpython-38.pyc +0 -0
  377. snappy/ptolemy/__pycache__/matrix.cpython-38.pyc +0 -0
  378. snappy/ptolemy/__pycache__/numericalSolutionsToGroebnerBasis.cpython-38.pyc +0 -0
  379. snappy/ptolemy/__pycache__/polynomial.cpython-38.pyc +0 -0
  380. snappy/ptolemy/__pycache__/processComponents.cpython-38.pyc +0 -0
  381. snappy/ptolemy/__pycache__/processFileBase.cpython-38.pyc +0 -0
  382. snappy/ptolemy/__pycache__/processFileDispatch.cpython-38.pyc +0 -0
  383. snappy/ptolemy/__pycache__/processMagmaFile.cpython-38.pyc +0 -0
  384. snappy/ptolemy/__pycache__/processRurFile.cpython-38.pyc +0 -0
  385. snappy/ptolemy/__pycache__/ptolemyGeneralizedObstructionClass.cpython-38.pyc +0 -0
  386. snappy/ptolemy/__pycache__/ptolemyObstructionClass.cpython-38.pyc +0 -0
  387. snappy/ptolemy/__pycache__/ptolemyVariety.cpython-38.pyc +0 -0
  388. snappy/ptolemy/__pycache__/ptolemyVarietyPrimeIdealGroebnerBasis.cpython-38.pyc +0 -0
  389. snappy/ptolemy/__pycache__/rur.cpython-38.pyc +0 -0
  390. snappy/ptolemy/__pycache__/solutionsToPrimeIdealGroebnerBasis.cpython-38.pyc +0 -0
  391. snappy/ptolemy/__pycache__/utilities.cpython-38.pyc +0 -0
  392. snappy/snap/__pycache__/__init__.cpython-38.pyc +0 -0
  393. snappy/snap/__pycache__/character_varieties.cpython-38.pyc +0 -0
  394. snappy/snap/__pycache__/fundamental_polyhedron.cpython-38.pyc +0 -0
  395. snappy/snap/__pycache__/interval_reps.cpython-38.pyc +0 -0
  396. snappy/snap/__pycache__/kernel_structures.cpython-38.pyc +0 -0
  397. snappy/snap/__pycache__/mcomplex_base.cpython-38.pyc +0 -0
  398. snappy/snap/__pycache__/nsagetools.cpython-38.pyc +0 -0
  399. snappy/snap/__pycache__/polished_reps.cpython-38.pyc +0 -0
  400. snappy/snap/__pycache__/shapes.cpython-38.pyc +0 -0
  401. snappy/snap/__pycache__/slice_obs_HKL.cpython-38.pyc +0 -0
  402. snappy/snap/__pycache__/utilities.cpython-38.pyc +0 -0
  403. snappy/snap/peripheral/__pycache__/__init__.cpython-38.pyc +0 -0
  404. snappy/snap/peripheral/__pycache__/dual_cellulation.cpython-38.pyc +0 -0
  405. snappy/snap/peripheral/__pycache__/link.cpython-38.pyc +0 -0
  406. snappy/snap/peripheral/__pycache__/peripheral.cpython-38.pyc +0 -0
  407. snappy/snap/peripheral/__pycache__/surface.cpython-38.pyc +0 -0
  408. snappy/snap/t3mlite/__pycache__/__init__.cpython-38.pyc +0 -0
  409. snappy/snap/t3mlite/__pycache__/arrow.cpython-38.pyc +0 -0
  410. snappy/snap/t3mlite/__pycache__/corner.cpython-38.pyc +0 -0
  411. snappy/snap/t3mlite/__pycache__/edge.cpython-38.pyc +0 -0
  412. snappy/snap/t3mlite/__pycache__/face.cpython-38.pyc +0 -0
  413. snappy/snap/t3mlite/__pycache__/files.cpython-38.pyc +0 -0
  414. snappy/snap/t3mlite/__pycache__/homology.cpython-38.pyc +0 -0
  415. snappy/snap/t3mlite/__pycache__/linalg.cpython-38.pyc +0 -0
  416. snappy/snap/t3mlite/__pycache__/mcomplex.cpython-38.pyc +0 -0
  417. snappy/snap/t3mlite/__pycache__/perm4.cpython-38.pyc +0 -0
  418. snappy/snap/t3mlite/__pycache__/simplex.cpython-38.pyc +0 -0
  419. snappy/snap/t3mlite/__pycache__/spun.cpython-38.pyc +0 -0
  420. snappy/snap/t3mlite/__pycache__/surface.cpython-38.pyc +0 -0
  421. snappy/snap/t3mlite/__pycache__/tetrahedron.cpython-38.pyc +0 -0
  422. snappy/snap/t3mlite/__pycache__/vertex.cpython-38.pyc +0 -0
  423. snappy/togl/__init__.py +0 -3
  424. snappy/togl/darwin-tk8.6/Togl2.1/LICENSE +0 -28
  425. snappy/togl/darwin-tk8.6/Togl2.1/libTogl2.1.dylib +0 -0
  426. snappy/togl/darwin-tk8.6/Togl2.1/pkgIndex.tcl +0 -5
  427. snappy/togl/darwin-tk8.7/Togl2.1/LICENSE +0 -28
  428. snappy/togl/darwin-tk8.7/Togl2.1/libTogl2.1.dylib +0 -0
  429. snappy/togl/darwin-tk8.7/Togl2.1/pkgIndex.tcl +0 -5
  430. snappy/togl/linux2-x86_64-tk8.6/Togl2.1/LICENSE +0 -28
  431. snappy/togl/linux2-x86_64-tk8.6/Togl2.1/libTogl2.1.so +0 -0
  432. snappy/togl/linux2-x86_64-tk8.6/Togl2.1/pkgIndex.tcl +0 -5
  433. snappy/togl/win32VC-tk8.6/Togl2.1/LICENSE +0 -28
  434. snappy/togl/win32VC-tk8.6/Togl2.1/Togl21.dll +0 -0
  435. snappy/togl/win32VC-tk8.6/Togl2.1/Togl21.lib +0 -0
  436. snappy/togl/win32VC-tk8.6/Togl2.1/pkgIndex.tcl +0 -6
  437. snappy/togl/win32VC-x86_64-tk8.6/Togl2.1/LICENSE +0 -28
  438. snappy/togl/win32VC-x86_64-tk8.6/Togl2.1/Togl21.dll +0 -0
  439. snappy/togl/win32VC-x86_64-tk8.6/Togl2.1/Togl21.lib +0 -0
  440. snappy/togl/win32VC-x86_64-tk8.6/Togl2.1/pkgIndex.tcl +0 -6
  441. snappy/twister/__pycache__/__init__.cpython-38.pyc +0 -0
  442. snappy/twister/__pycache__/main.cpython-38.pyc +0 -0
  443. snappy/upper_halfspace/__pycache__/__init__.cpython-38.pyc +0 -0
  444. snappy/upper_halfspace/__pycache__/ideal_point.cpython-38.pyc +0 -0
  445. snappy/verify/__pycache__/__init__.cpython-38.pyc +0 -0
  446. snappy/verify/__pycache__/cuspCrossSection.cpython-38.pyc +0 -0
  447. snappy/verify/__pycache__/cuspTranslations.cpython-38.pyc +0 -0
  448. snappy/verify/__pycache__/cusp_areas.cpython-38.pyc +0 -0
  449. snappy/verify/__pycache__/cusp_shapes.cpython-38.pyc +0 -0
  450. snappy/verify/__pycache__/exceptions.cpython-38.pyc +0 -0
  451. snappy/verify/__pycache__/interval_newton_shapes_engine.cpython-38.pyc +0 -0
  452. snappy/verify/__pycache__/interval_tree.cpython-38.pyc +0 -0
  453. snappy/verify/__pycache__/krawczyk_shapes_engine.cpython-38.pyc +0 -0
  454. snappy/verify/__pycache__/realAlgebra.cpython-38.pyc +0 -0
  455. snappy/verify/__pycache__/shapes.cpython-38.pyc +0 -0
  456. snappy/verify/__pycache__/short_slopes.cpython-38.pyc +0 -0
  457. snappy/verify/__pycache__/squareExtensions.cpython-38.pyc +0 -0
  458. snappy/verify/__pycache__/verifyCanonical.cpython-38.pyc +0 -0
  459. snappy/verify/__pycache__/verifyHyperbolicity.cpython-38.pyc +0 -0
  460. snappy/verify/__pycache__/volume.cpython-38.pyc +0 -0
  461. snappy/verify/complex_volume/__pycache__/__init__.cpython-38.pyc +0 -0
  462. snappy/verify/complex_volume/__pycache__/adjust_torsion.cpython-38.pyc +0 -0
  463. snappy/verify/complex_volume/__pycache__/closed.cpython-38.pyc +0 -0
  464. snappy/verify/complex_volume/__pycache__/compute_ptolemys.cpython-38.pyc +0 -0
  465. snappy/verify/complex_volume/__pycache__/cusped.cpython-38.pyc +0 -0
  466. snappy/verify/complex_volume/__pycache__/extended_bloch.cpython-38.pyc +0 -0
  467. snappy/verify/cuspCrossSection.py +0 -1422
  468. snappy/verify/maximal_cusp_area_matrix/__pycache__/__init__.cpython-38.pyc +0 -0
  469. snappy/verify/maximal_cusp_area_matrix/__pycache__/cusp_tiling_engine.cpython-38.pyc +0 -0
  470. snappy/verify/maximal_cusp_area_matrix/__pycache__/cusp_translate_engine.cpython-38.pyc +0 -0
  471. snappy/verify/upper_halfspace/__pycache__/__init__.cpython-38.pyc +0 -0
  472. snappy/verify/upper_halfspace/__pycache__/extended_matrix.cpython-38.pyc +0 -0
  473. snappy/verify/upper_halfspace/__pycache__/finite_point.cpython-38.pyc +0 -0
  474. snappy/verify/upper_halfspace/__pycache__/ideal_point.cpython-38.pyc +0 -0
  475. snappy-3.1.1.dist-info/RECORD +0 -575
  476. {snappy-3.1.1.dist-info → snappy-3.2.dist-info}/entry_points.txt +0 -0
@@ -1,10 +1,6 @@
1
1
  import re
2
2
  import operator
3
3
  from fractions import Fraction
4
- import sys
5
-
6
- long = int
7
- unicode = str
8
4
 
9
5
  #######################################################
10
6
  # Public Definitions of Monomial and Polynomial class
@@ -21,7 +17,7 @@ class Monomial():
21
17
  @classmethod
22
18
  def from_variable_name(cls, var):
23
19
  """Construct a monomial with a single variable given as a string."""
24
- assert isinstance(var, str) or isinstance(var, unicode)
20
+ assert isinstance(var, str)
25
21
  return Monomial(1, ((var, 1),))
26
22
 
27
23
  # Constructs a constant monomial
@@ -47,7 +43,7 @@ class Monomial():
47
43
  else:
48
44
  assert isinstance(vars, tuple)
49
45
  for var, expo in vars:
50
- assert isinstance(var, str) or isinstance(var, unicode)
46
+ assert isinstance(var, str)
51
47
  assert isinstance(expo, int)
52
48
  assert expo > 0
53
49
  self._vars = vars
@@ -124,7 +120,7 @@ class Monomial():
124
120
 
125
121
  # Compute the variables
126
122
  var_dict = _combine_dicts(
127
- [dict(self._vars),dict(other._vars)],
123
+ [dict(self._vars), dict(other._vars)],
128
124
  operator.add)
129
125
 
130
126
  return Monomial(coefficient, var_dict)
@@ -138,9 +134,9 @@ class Monomial():
138
134
  return Monomial.constant_monomial(1)
139
135
  if other == 1:
140
136
  return self
141
- if other % 2 == 1:
142
- return self * (self ** (other-1))
143
- return (self * self) ** (other//2)
137
+ if other % 2:
138
+ return self * (self ** (other - 1))
139
+ return (self * self) ** (other // 2)
144
140
 
145
141
  def __neg__(self):
146
142
  """Negate this monomial."""
@@ -166,7 +162,7 @@ class Monomial():
166
162
 
167
163
  def split_variable(self, variable):
168
164
  """Split the specified variable from the others."""
169
- remaining_terms = { }
165
+ remaining_terms = {}
170
166
  exponent = 0
171
167
  for var, expo in self._vars:
172
168
  if var == variable:
@@ -258,12 +254,12 @@ class Polynomial():
258
254
  @classmethod
259
255
  def constant_polynomial(cls, constant):
260
256
  """Construct a constant polynomial."""
261
- return Polynomial( (Monomial.constant_monomial(constant),))
257
+ return Polynomial((Monomial.constant_monomial(constant),))
262
258
 
263
259
  @classmethod
264
260
  def from_variable_name(cls, var):
265
261
  """Construct a polynomial consisting of a single variable."""
266
- return Polynomial( (Monomial.from_variable_name(var),))
262
+ return Polynomial((Monomial.from_variable_name(var),))
267
263
 
268
264
  # constructor takes a tuple of polynomials which are combined
269
265
 
@@ -279,7 +275,7 @@ class Polynomial():
279
275
  # and value being the coefficient
280
276
 
281
277
  list_of_vars_coeff_dicts = [
282
- { monomial.get_vars() : monomial.get_coefficient() }
278
+ {monomial.get_vars(): monomial.get_coefficient()}
283
279
  for monomial in monomials]
284
280
 
285
281
  # combine the dictionaries using sum
@@ -327,9 +323,9 @@ class Polynomial():
327
323
  return Polynomial((Monomial.constant_monomial(1),))
328
324
  if other == 1:
329
325
  return self
330
- if other % 2 == 1:
331
- return self * (self ** (other-1))
332
- return (self * self) ** (other//2)
326
+ if other % 2:
327
+ return self * (self ** (other - 1))
328
+ return (self * self) ** (other // 2)
333
329
 
334
330
  def __mul__(self, other):
335
331
  monomials = []
@@ -352,7 +348,7 @@ class Polynomial():
352
348
 
353
349
  other = other.convert_coefficients(Fraction)
354
350
  other = other * Polynomial.constant_polynomial(
355
- Fraction(1,1) / other.leading_coefficient())
351
+ Fraction(1, 1) / other.leading_coefficient())
356
352
 
357
353
  variable = other.variables()[0]
358
354
  assert ((not other.variables())
@@ -392,8 +388,8 @@ class Polynomial():
392
388
  """Convert all coefficients using conversion_function."""
393
389
 
394
390
  return Polynomial(tuple(
395
- [monomial.convert_coefficient(conversion_function)
396
- for monomial in self._monomials]))
391
+ [monomial.convert_coefficient(conversion_function)
392
+ for monomial in self._monomials]))
397
393
 
398
394
  def substitute(self, d):
399
395
  """
@@ -417,11 +413,11 @@ class Polynomial():
417
413
 
418
414
  for var, expo in vars:
419
415
  if var not in d:
420
- new_vars.append((var,expo))
416
+ new_vars.append((var, expo))
421
417
 
422
418
  poly = Polynomial((
423
- Monomial(monomial.get_coefficient(),
424
- tuple(new_vars)),))
419
+ Monomial(monomial.get_coefficient(),
420
+ tuple(new_vars)),))
425
421
 
426
422
  for var, expo in vars:
427
423
  if var in d:
@@ -430,7 +426,7 @@ class Polynomial():
430
426
  return poly
431
427
 
432
428
  return sum([substitute_monomial(monomial)
433
- for monomial in self._monomials], Polynomial(()))
429
+ for monomial in self._monomials], Polynomial(()))
434
430
 
435
431
  def variables(self):
436
432
  """Return a list of all variables in the polynomial."""
@@ -478,11 +474,11 @@ class Polynomial():
478
474
  """Assert univariance; return True iff this polynomial is monic."""
479
475
  return self.leading_coefficient() == 1
480
476
 
481
- def get_coefficients(self, conversion_function=lambda x:x):
477
+ def get_coefficients(self, conversion_function=lambda x: x):
482
478
  """Assert univariance; return the coefficients in degree order."""
483
479
  assert self.is_univariate()
484
480
  degree = self.degree()
485
- list_of_coefficients = (degree + 1) * [ conversion_function(0) ]
481
+ list_of_coefficients = (degree + 1) * [conversion_function(0)]
486
482
  for monomial in self._monomials:
487
483
  list_of_coefficients[degree - monomial.degree()] = (
488
484
  conversion_function(monomial.get_coefficient()))
@@ -533,7 +529,7 @@ class Polynomial():
533
529
 
534
530
  def factor_out_variables(self):
535
531
 
536
- if self._monomials == ():
532
+ if not self._monomials:
537
533
  return self
538
534
 
539
535
  def intersect(lists):
@@ -543,22 +539,21 @@ class Polynomial():
543
539
  return s
544
540
 
545
541
  non_trivial_variables = intersect(
546
- [ monomial.variables() for monomial in self._monomials])
542
+ [monomial.variables() for monomial in self._monomials])
547
543
 
548
- lowest_powers = dict([ (var,1000000) for var in non_trivial_variables ])
544
+ lowest_powers = {var: 1000000 for var in non_trivial_variables}
549
545
 
550
- def safe_dict(d,var):
546
+ def safe_dict(d, var):
551
547
  if var in d:
552
548
  return d[var]
553
- else:
554
- return 0
549
+ return 0
555
550
 
556
551
  for monomial in self._monomials:
557
552
  for var, expo in monomial.get_vars():
558
- lowest_powers[var] = min(safe_dict(lowest_powers,var), expo)
553
+ lowest_powers[var] = min(safe_dict(lowest_powers, var), expo)
559
554
 
560
- return Polynomial(tuple([ monomial.reduce_exponents(lowest_powers)
561
- for monomial in self._monomials]))
555
+ return Polynomial(tuple([monomial.reduce_exponents(lowest_powers)
556
+ for monomial in self._monomials]))
562
557
 
563
558
  ###############################################################
564
559
  # Default functions for parsing and printing the coefficients
@@ -568,7 +563,7 @@ class Polynomial():
568
563
 
569
564
 
570
565
  def parse_int_coefficient(s):
571
- coeff, rest = re.match('([0-9]*)(.*)',s).groups()
566
+ coeff, rest = re.match('([0-9]*)(.*)', s).groups()
572
567
  if coeff:
573
568
  coeff = int(coeff)
574
569
  else:
@@ -577,7 +572,7 @@ def parse_int_coefficient(s):
577
572
 
578
573
 
579
574
  def parse_int_or_fraction(s):
580
- m = re.match('([0-9]+/[0-9]+)(.*)',s)
575
+ m = re.match('([0-9]+/[0-9]+)(.*)', s)
581
576
  if m:
582
577
  frac, rest = m.groups()
583
578
  return Fraction(frac), rest
@@ -623,9 +618,9 @@ def _storage_type_policy(type_a, type_b):
623
618
  assert isinstance(type_a, type)
624
619
  assert isinstance(type_b, type)
625
620
 
626
- if type_a in [int, long]:
621
+ if type_a in [int]:
627
622
  return type_b
628
- if type_b in [int, long]:
623
+ if type_b in [int]:
629
624
  return type_a
630
625
 
631
626
  if not type_a == type_b:
@@ -642,9 +637,9 @@ def _operator_type_policy(obj_a, obj_b, op=operator.add):
642
637
 
643
638
  if type(obj_a) == type(obj_b):
644
639
  return op(obj_a, obj_b)
645
- if type(obj_a) in [int, long]:
640
+ if type(obj_a) in [int]:
646
641
  return op(type(obj_b)(obj_a), obj_b)
647
- if type(obj_b) in [int, long]:
642
+ if type(obj_b) in [int]:
648
643
  return op(type(obj_a)(obj_b), obj_a)
649
644
 
650
645
  raise Exception
@@ -660,23 +655,21 @@ def _operator_type_policy(obj_a, obj_b, op=operator.add):
660
655
 
661
656
 
662
657
  _operators = {
663
- '+' : operator.add,
664
- '-' : operator.sub,
665
- '*' : operator.mul,
666
- '^' : operator.pow
667
- }
658
+ '+': operator.add,
659
+ '-': operator.sub,
660
+ '*': operator.mul,
661
+ '^': operator.pow}
668
662
 
669
663
  _operator_precedence = {
670
- None : 0,
671
- '+' : 1,
672
- '-' : 1,
673
- '*' : 2,
674
- '^' : 3
675
- }
664
+ None: 0,
665
+ '+': 1,
666
+ '-': 1,
667
+ '*': 2,
668
+ '^': 3}
676
669
 
677
670
 
678
671
  def _apply_operator(op, l, r):
679
- return _operators[op](l,r)
672
+ return _operators[op](l, r)
680
673
 
681
674
  # Helper functions for parsing
682
675
 
@@ -690,7 +683,7 @@ def _coefficient_is_non_trivial(c):
690
683
 
691
684
 
692
685
  def _parse_variable(s):
693
- r = re.match(r'([_A-Za-z][_A-Za-z0-9]*)(.*)$',s)
686
+ r = re.match(r'([_A-Za-z][_A-Za-z0-9]*)(.*)$', s)
694
687
  if r:
695
688
  return r.groups()
696
689
  else:
@@ -709,7 +702,7 @@ def _parse_polynomial_from_string(s, parse_coefficient_function):
709
702
 
710
703
  # Has there been an operand since the opening parenthesis
711
704
  # e.g. parse things like "(+ x)"
712
- no_operand_since_opening_parenthesis = [ True ]
705
+ no_operand_since_opening_parenthesis = [True]
713
706
 
714
707
  def debug_print(s):
715
708
  print("=" * 75)
@@ -730,7 +723,7 @@ def _parse_polynomial_from_string(s, parse_coefficient_function):
730
723
 
731
724
  # or if the top operator is not preceding
732
725
  if (_operator_precedence[top_operator] <
733
- _operator_precedence[operator]):
726
+ _operator_precedence[operator]):
734
727
  return
735
728
 
736
729
  top_operator = operator_stack.pop()
@@ -766,7 +759,7 @@ def _parse_polynomial_from_string(s, parse_coefficient_function):
766
759
 
767
760
  next_char, rest = s[0], s[1:]
768
761
 
769
- if next_char in list(_operators.keys()):
762
+ if next_char in _operators:
770
763
  operator = next_char
771
764
  eval_preceding_operators_on_stack(operator)
772
765
  operator_stack.append(operator)
@@ -1,11 +1,28 @@
1
1
  import re
2
2
 
3
3
  from . import utilities
4
+ from .ptolemyObstructionClass import PtolemyObstructionClass
4
5
 
5
6
  """
6
7
  Basic functions to read a ptolemy solutions file.
7
8
  """
8
9
 
10
+ class PtolemyPrecomputedObstructionClassMismatchError(Exception):
11
+ def __init__(self, index, actual_class, precomputed_class):
12
+
13
+ msg = (
14
+ "The obstruction class in the pre-computed file does not match "
15
+ "the obstruction class of the Ptolemy variety (index %d). "
16
+ "The underlying reason is that the pari's implementation of the "
17
+ "Smith normal form has changed affecting the order in which we "
18
+ "list the cohomology classes or the cocycles we use as "
19
+ "representatives. A pre-computed file for the new cocycle has "
20
+ "not yet been computed.") % index
21
+
22
+ Exception.__init__(self, msg)
23
+ self.index = index
24
+ self.actual_class = actual_class
25
+ self.precomputed_class = precomputed_class
9
26
 
10
27
  def find_section(text, name):
11
28
  """
@@ -139,6 +156,49 @@ def get_py_eval(text):
139
156
  utilities.join_long_lines(
140
157
  find_unique_section(text, "PY=EVAL=SECTION")))
141
158
 
159
+ # A dict-like object we can feed into the variable dict
160
+ # function in the pre-computed solution file.
161
+ #
162
+ # It is sufficient to evaluate the obstruction class but
163
+ # returns 1 for all other keys.
164
+ #
165
+ class _DummyDict:
166
+ def __getitem__(self, key):
167
+ if key == '1' or key[0] == 'c':
168
+ return 1
169
+ raise KeyError(key)
170
+
171
+ def check_obstruction_class_for_variable_dict_function(
172
+ variable_dict_function, obstruction_class):
173
+
174
+ if not isinstance(obstruction_class, PtolemyObstructionClass):
175
+ # Note that no obstruction class has always been
176
+ # corresponding to index 0 ("c0" in file name).
177
+ # So nothing to check.
178
+ #
179
+ # We also don't check for the generalized
180
+ # obstruction class.
181
+ #
182
+ # We should double check that our solutions
183
+ # for PSL(n,C) with n>2 are still fine...
184
+ #
185
+ return
186
+
187
+ variable_dict = variable_dict_function(_DummyDict())
188
+ precomputed_class = [
189
+ variable_dict[var_name]
190
+ for var_name in obstruction_class._explain_basis ]
191
+
192
+ # Obstruction class contains element in Z/2 as additive group.
193
+ # We need to convert it to be in multiplicative group {-1, 1}.
194
+ actual_class = [
195
+ (-1) ** i for i in obstruction_class._H2_element ]
196
+
197
+ if actual_class != precomputed_class:
198
+ raise PtolemyPrecomputedObstructionClassMismatchError(
199
+ obstruction_class._index,
200
+ actual_class,
201
+ precomputed_class)
142
202
 
143
203
  def get_manifold_thunk(text):
144
204
  """
@@ -5,6 +5,7 @@ from .ptolemyObstructionClass import PtolemyObstructionClass
5
5
  from .ptolemyGeneralizedObstructionClass import PtolemyGeneralizedObstructionClass
6
6
  from .ptolemyVarietyPrimeIdealGroebnerBasis import PtolemyVarietyPrimeIdealGroebnerBasis
7
7
  from . import processFileBase, processFileDispatch, processMagmaFile
8
+ from .processFileBase import PtolemyPrecomputedObstructionClassMismatchError
8
9
  from . import utilities
9
10
  from string import Template
10
11
  import signal
@@ -34,6 +35,18 @@ class PtolemyFileMissingError(Exception):
34
35
  def __init__(self, message):
35
36
  Exception.__init__(self, message)
36
37
 
38
+ class PtolemyMissingFileForObstructionClass(Exception):
39
+ def __init__(self, index):
40
+
41
+ msg = (
42
+ "Pari's implementation of the Smith normal form has changed "
43
+ "affecting the order in which the cohomology classes are listed "
44
+ "and the cocycles used to represent them. Unfortunately, the "
45
+ "pre-computed file uses a cocycle that no longer matches and "
46
+ "a file matching the new cocycle has not yet been produced. "
47
+ "Please report the manifold and index (%d)." % index)
48
+ Exception.__init__(self, msg)
49
+ self.index = index
37
50
 
38
51
  class PtolemyVariety():
39
52
  """
@@ -125,7 +138,7 @@ class PtolemyVariety():
125
138
  N, manifold.num_tetrahedra(),
126
139
  isinstance(obstruction_class, PtolemyObstructionClass)))
127
140
 
128
- self.equations = [eqn for eqn in self._ptolemy_relations]
141
+ self.equations = list(self._ptolemy_relations)
129
142
 
130
143
  order_of_u = 1
131
144
 
@@ -471,7 +484,7 @@ class PtolemyVariety():
471
484
  dir,
472
485
  '%02d_tetrahedra' % tets])
473
486
 
474
- def _solution_file_url(self, data_url=None, rur=False):
487
+ def _solution_file_url(self, alt=0, ext='magma_out', data_url=None):
475
488
 
476
489
  if data_url is None:
477
490
  from . import DATA_URL as data_url
@@ -486,47 +499,91 @@ class PtolemyVariety():
486
499
  if not data_url[-1] == '/':
487
500
  data_url = data_url + '/'
488
501
 
489
- if rur:
490
- ext = '.rur'
502
+ if alt > 0:
503
+ suffix = '_alt%d' % alt
491
504
  else:
492
- ext = '.magma_out'
505
+ suffix = ''
493
506
 
494
- filename = self.filename_base() + ext
507
+ filename = self.filename_base() + suffix + "." + ext
495
508
 
496
509
  return data_url + self.path_to_file() + '/' + urlquote(filename)
497
510
 
498
- def _retrieve_solution_file(self, data_url=None, prefer_rur=False,
499
- verbose=False):
500
-
501
- # First try to retrieve solutions from the URL corresponding to
502
- # the preferred format (i.e., RUR vs magma decomposition)
503
-
504
- url = self._solution_file_url(data_url=data_url,
505
- rur=prefer_rur)
506
- if verbose:
507
- print("Trying to retrieve solutions from %s ..." % url)
508
-
509
- try:
510
- return _retrieve_url(url)
511
+ def _retrieve_solution_file_alt(self,
512
+ alt=0,
513
+ data_url=None,
514
+ exts=['magma_out', 'rur'],
515
+ verbose=False):
516
+ for i, ext in enumerate(exts):
517
+ url = self._solution_file_url(alt=alt,
518
+ data_url=data_url,
519
+ ext=ext)
520
+ if verbose:
521
+ print("Trying to retrieve solutions from %s ..." % url)
511
522
 
512
- except PtolemyFileMissingError:
523
+ try:
524
+ return _retrieve_url(url)
525
+ except PtolemyFileMissingError as e:
526
+ if i == len(exts) - 1:
527
+ raise
513
528
 
514
- # If that file wasn't there, try to retrieve solutions from URL
515
- # corresponding to the non-prefered format
529
+ def _retrieve_solution_file(self,
530
+ data_url=None,
531
+ exts=['magma_out', 'rur'],
532
+ verbose=False):
516
533
 
517
- url = self._solution_file_url(data_url=data_url,
518
- rur=not prefer_rur)
519
- if verbose:
520
- print("Retrieving solutions instead from %s ...:" % url)
521
- return _retrieve_url(url)
534
+ num_alts = 3
535
+
536
+ for alt in range(num_alts):
537
+ try:
538
+ text = self._retrieve_solution_file_alt(alt=alt,
539
+ data_url=data_url,
540
+ exts=exts,
541
+ verbose=verbose)
542
+ self._check_obstruction_class_for_precomputed_file(text)
543
+ return text
544
+ except PtolemyPrecomputedObstructionClassMismatchError as e:
545
+ if alt == num_alts - 1:
546
+ raise
547
+ except PtolemyFileMissingError as e:
548
+ if alt == 0:
549
+ raise
550
+ else:
551
+ raise PtolemyMissingFileForObstructionClass(
552
+ self._obstruction_class._index if self._obstruction_class else 0)
553
+
554
+ def _check_obstruction_class_for_precomputed_file(
555
+ self, text):
556
+
557
+ # Grab the PY=EVAL=SECTION
558
+ # Note that this will be evaluated again later.
559
+ # But it is cheap enough that the double evaluation should not matter.
560
+ py_eval = processFileBase.get_py_eval(text)
561
+
562
+ # Now get the function that takes a dictionary-like object with
563
+ # the solutions to the variety and expands it to a dictionary
564
+ # assigning a value to all Ptolemy coordinates and obstruction class
565
+ # variables.
566
+ variable_dict_function = py_eval['variable_dict']
567
+
568
+ # As noticed by Nathan, the obstruction classes used for producing
569
+ # the pre-computed solutions do not match the obstruction classes
570
+ # we compute now.
571
+ # This is due to pari changing the code for computing the
572
+ # Smith normal form in version 2.13 (see
573
+ # http://pari.math.u-bordeaux.fr/archives/pari-announce-20/msg00006.html)
574
+ #
575
+ # We thus check here explicitly that the obstruction class still
576
+ # matches.
577
+ #
578
+ processFileBase.check_obstruction_class_for_variable_dict_function(
579
+ variable_dict_function,
580
+ self._obstruction_class)
522
581
 
523
582
  def retrieve_decomposition(self, data_url=None, verbose=True):
524
583
 
525
- url = self._solution_file_url(data_url=data_url, rur=False)
526
- if verbose:
527
- print("Retrieving decomposition from %s ..." % url)
528
-
529
- text = _retrieve_url(url)
584
+ text = self._retrieve_solution_file(data_url,
585
+ exts=['magma_out'],
586
+ verbose=verbose)
530
587
 
531
588
  if verbose:
532
589
  print("Parsing...")
@@ -542,9 +599,14 @@ class PtolemyVariety():
542
599
  data_url=None,
543
600
  verbose=True):
544
601
 
602
+ exts = ['magma_out.gz', 'magma_out', 'rur']
603
+ if prefer_rur:
604
+ exts = exts[::-1]
605
+
545
606
  text = self._retrieve_solution_file(data_url=data_url,
546
- prefer_rur=prefer_rur,
607
+ exts=exts,
547
608
  verbose=verbose)
609
+
548
610
  if verbose:
549
611
  print("Parsing...")
550
612
 
@@ -819,7 +881,7 @@ def _identified_variables_canonize(identified_variables):
819
881
 
820
882
  return dict1
821
883
 
822
- all_variables = { }
884
+ all_variables = {}
823
885
 
824
886
  for sign, power, var1, var2 in identified_variables:
825
887
  all_variables[var1] = { var1 : (+1, 0) }
@@ -830,10 +892,10 @@ def _identified_variables_canonize(identified_variables):
830
892
  new_dict = merge_two_dicts(sign, power, var1, var2,
831
893
  all_variables[var1],
832
894
  all_variables[var2])
833
- for var in new_dict.keys():
895
+ for var in new_dict:
834
896
  all_variables[var] = new_dict
835
897
 
836
- result = { }
898
+ result = {}
837
899
 
838
900
  for variable, variable_dict in all_variables.items():
839
901
  if variable not in result:
@@ -884,7 +946,7 @@ def _canonical_representative_to_polynomial_substituition(
884
946
 
885
947
  def _retrieve_url(url):
886
948
 
887
- overview_url = "http://ptolemy.unhyperbolic.org/data/overview.html"
949
+ overview_url = "https://ptolemy.unhyperbolic.org/data/overview.html"
888
950
 
889
951
  try:
890
952
  # Remember SnapPy's SIGALRM handler (defined in app.py)
@@ -910,10 +972,10 @@ def _retrieve_url(url):
910
972
  "is not configured correctly: %s. Also see %s" % (
911
973
  e, overview_url))
912
974
 
913
- except IOError as e:
975
+ except OSError as e:
914
976
  # IOError: this means the file wasn't there or we couldn't connect
915
977
  # to the server
916
- if url[:5] == 'http:':
978
+ if url.startswith('http:') or url.startswith('https'):
917
979
  # IOError for http means we could not connect to server
918
980
  raise RuntimeError(
919
981
  "Problem connecting to server while retrieving %s: "
@@ -931,10 +993,16 @@ def _retrieve_url(url):
931
993
  if sigalrm_handler: # Not supported under windows
932
994
  signal.signal(signal.SIGALRM, sigalrm_handler)
933
995
 
996
+ text = s.read()
997
+
998
+ if url.endswith('.gz'):
999
+ import gzip
1000
+ text = gzip.decompress(text)
1001
+
934
1002
  # Read the text
935
- text = s.read().decode('ascii').replace('\r\n', '\n')
1003
+ text = text.decode('ascii').replace('\r\n', '\n')
936
1004
 
937
- if url[:5] != 'http:':
1005
+ if not (url.startswith('http:') or url.startswith('https')):
938
1006
  # If this is a normal file, we are done
939
1007
  return text
940
1008
 
@@ -40,7 +40,7 @@ class NTriangulationForPtolemy(NTriangulation):
40
40
  """
41
41
  Constructor - takes same arguments as NTriangulation.
42
42
  """
43
- super(NTriangulationForPtolemy, self).__init__(*args, **kwargs)
43
+ super().__init__(*args, **kwargs)
44
44
 
45
45
  # Make sure we are oriented
46
46
  if not self.isOriented():
@@ -146,10 +146,10 @@ class NTriangulationForPtolemy(NTriangulation):
146
146
 
147
147
  * Stavros Garoufalidis, Dyland Thurston, Christian K. Zickert:
148
148
  "The Complex Volume of SL(n,C)-Representations of 3-Manifolds"
149
- (http://arxiv.org/abs/1111.2828)
149
+ (https://arxiv.org/abs/1111.2828)
150
150
  * Stavros Garoufalidis, Matthias Goerner, Christian K. Zickert:
151
151
  "Gluing Equations for PGL(n,C)-Representations of 3-Manifolds "
152
- (http://arxiv.org/abs/1207.6711)
152
+ (https://arxiv.org/abs/1207.6711)
153
153
 
154
154
  The variety can be exported to magma or sage and solved there. The
155
155
  solutions can be processed to compute invariants.
@@ -439,7 +439,7 @@ class NTriangulationForPtolemy(NTriangulation):
439
439
  # Following Remark 5.7 of
440
440
  # Garoufalidis, Goerner, Zickert:
441
441
  # Gluing Equations for PGL(n,C)-Representations of 3-Manifolds
442
- # http://arxiv.org/abs/1207.6711
442
+ # https://arxiv.org/abs/1207.6711
443
443
  # we discard all even entries and get a permutation called
444
444
  # "effective_perm" here.
445
445
  effective_perm = []
snappy/ptolemy/rur.py CHANGED
@@ -443,7 +443,7 @@ class RUR():
443
443
  return
444
444
 
445
445
  def term_to_expand_fraction_by(old_terms):
446
- result = [ pair for pair in new_denominator_terms ]
446
+ result = list(new_denominator_terms)
447
447
  for p, e in old_terms:
448
448
  if e < 0:
449
449
  subtract_denominator_from_list(p, e, result)