snappy 3.1.1__cp312-cp312-macosx_11_0_arm64.whl → 3.2__cp312-cp312-macosx_11_0_arm64.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (461) hide show
  1. snappy/CyOpenGL.cpython-312-darwin.so +0 -0
  2. snappy/SnapPy.cpython-312-darwin.so +0 -0
  3. snappy/SnapPyHP.cpython-312-darwin.so +0 -0
  4. snappy/__init__.py +271 -401
  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/development.rst.txt +66 -46
  25. snappy/doc/_sources/index.rst.txt +72 -5
  26. snappy/doc/_sources/installing.rst.txt +145 -162
  27. snappy/doc/_sources/news.rst.txt +73 -1
  28. snappy/doc/_sources/ptolemy_examples1.rst.txt +8 -7
  29. snappy/doc/_sources/ptolemy_examples3.rst.txt +2 -2
  30. snappy/doc/_sources/triangulation.rst.txt +2 -2
  31. snappy/doc/_sources/verify.rst.txt +89 -29
  32. snappy/doc/_sources/verify_internals.rst.txt +5 -16
  33. snappy/doc/_static/basic.css +1 -1
  34. snappy/doc/_static/css/badge_only.css +1 -1
  35. snappy/doc/_static/css/theme.css +1 -1
  36. snappy/doc/_static/doctools.js +1 -1
  37. snappy/doc/_static/documentation_options.js +1 -1
  38. snappy/doc/_static/fonts/Lato/lato-bold.eot +0 -0
  39. snappy/doc/_static/fonts/Lato/lato-bold.ttf +0 -0
  40. snappy/doc/_static/fonts/Lato/lato-bold.woff +0 -0
  41. snappy/doc/_static/fonts/Lato/lato-bold.woff2 +0 -0
  42. snappy/doc/_static/fonts/Lato/lato-bolditalic.eot +0 -0
  43. snappy/doc/_static/fonts/Lato/lato-bolditalic.ttf +0 -0
  44. snappy/doc/_static/fonts/Lato/lato-bolditalic.woff +0 -0
  45. snappy/doc/_static/fonts/Lato/lato-bolditalic.woff2 +0 -0
  46. snappy/doc/_static/fonts/Lato/lato-italic.eot +0 -0
  47. snappy/doc/_static/fonts/Lato/lato-italic.ttf +0 -0
  48. snappy/doc/_static/fonts/Lato/lato-italic.woff +0 -0
  49. snappy/doc/_static/fonts/Lato/lato-italic.woff2 +0 -0
  50. snappy/doc/_static/fonts/Lato/lato-regular.eot +0 -0
  51. snappy/doc/_static/fonts/Lato/lato-regular.ttf +0 -0
  52. snappy/doc/_static/fonts/Lato/lato-regular.woff +0 -0
  53. snappy/doc/_static/fonts/Lato/lato-regular.woff2 +0 -0
  54. snappy/doc/_static/fonts/RobotoSlab/roboto-slab-v7-bold.eot +0 -0
  55. snappy/doc/_static/fonts/RobotoSlab/roboto-slab-v7-bold.ttf +0 -0
  56. snappy/doc/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff +0 -0
  57. snappy/doc/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff2 +0 -0
  58. snappy/doc/_static/fonts/RobotoSlab/roboto-slab-v7-regular.eot +0 -0
  59. snappy/doc/_static/fonts/RobotoSlab/roboto-slab-v7-regular.ttf +0 -0
  60. snappy/doc/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff +0 -0
  61. snappy/doc/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff2 +0 -0
  62. snappy/doc/_static/js/versions.js +228 -0
  63. snappy/doc/_static/language_data.js +2 -2
  64. snappy/doc/_static/searchtools.js +108 -62
  65. snappy/doc/additional_classes.html +209 -40
  66. snappy/doc/bugs.html +16 -19
  67. snappy/doc/censuses.html +19 -38
  68. snappy/doc/credits.html +16 -19
  69. snappy/doc/development.html +84 -64
  70. snappy/doc/genindex.html +65 -144
  71. snappy/doc/index.html +81 -26
  72. snappy/doc/installing.html +158 -176
  73. snappy/doc/manifold.html +1119 -507
  74. snappy/doc/manifoldhp.html +16 -19
  75. snappy/doc/news.html +90 -32
  76. snappy/doc/objects.inv +0 -0
  77. snappy/doc/other.html +17 -19
  78. snappy/doc/platonic_census.html +16 -19
  79. snappy/doc/plink.html +16 -19
  80. snappy/doc/ptolemy.html +17 -19
  81. snappy/doc/ptolemy_classes.html +31 -34
  82. snappy/doc/ptolemy_examples1.html +23 -25
  83. snappy/doc/ptolemy_examples2.html +16 -19
  84. snappy/doc/ptolemy_examples3.html +18 -21
  85. snappy/doc/ptolemy_examples4.html +16 -19
  86. snappy/doc/ptolemy_prelim.html +17 -20
  87. snappy/doc/py-modindex.html +16 -19
  88. snappy/doc/screenshots.html +18 -20
  89. snappy/doc/search.html +15 -18
  90. snappy/doc/searchindex.js +1 -1
  91. snappy/doc/snap.html +16 -19
  92. snappy/doc/snappy.html +17 -19
  93. snappy/doc/spherogram.html +29 -32
  94. snappy/doc/todo.html +16 -19
  95. snappy/doc/triangulation.html +299 -190
  96. snappy/doc/tutorial.html +16 -19
  97. snappy/doc/verify.html +97 -43
  98. snappy/doc/verify_internals.html +59 -516
  99. snappy/drilling/__init__.py +153 -235
  100. snappy/drilling/barycentric.py +103 -0
  101. snappy/drilling/constants.py +0 -2
  102. snappy/drilling/crush.py +56 -130
  103. snappy/drilling/cusps.py +12 -6
  104. snappy/drilling/debug.py +2 -1
  105. snappy/drilling/exceptions.py +7 -40
  106. snappy/drilling/moves.py +302 -243
  107. snappy/drilling/perturb.py +63 -37
  108. snappy/drilling/shorten.py +36 -0
  109. snappy/drilling/subdivide.py +0 -5
  110. snappy/drilling/test.py +23 -0
  111. snappy/drilling/test_cases.py +126 -0
  112. snappy/drilling/tracing.py +9 -37
  113. snappy/exceptions.py +18 -5
  114. snappy/exterior_to_link/barycentric_geometry.py +2 -4
  115. snappy/exterior_to_link/main.py +8 -7
  116. snappy/exterior_to_link/mcomplex_with_link.py +2 -2
  117. snappy/exterior_to_link/rational_linear_algebra.py +1 -1
  118. snappy/exterior_to_link/rational_linear_algebra_wrapped.py +1 -1
  119. snappy/exterior_to_link/test.py +21 -33
  120. snappy/geometric_structure/__init__.py +212 -0
  121. snappy/geometric_structure/cusp_neighborhood/__init__.py +3 -0
  122. snappy/geometric_structure/cusp_neighborhood/complex_cusp_cross_section.py +697 -0
  123. snappy/geometric_structure/cusp_neighborhood/cusp_cross_section_base.py +484 -0
  124. snappy/geometric_structure/cusp_neighborhood/exceptions.py +42 -0
  125. snappy/geometric_structure/cusp_neighborhood/real_cusp_cross_section.py +298 -0
  126. snappy/geometric_structure/cusp_neighborhood/tiles_for_cusp_neighborhood.py +159 -0
  127. snappy/geometric_structure/cusp_neighborhood/vertices.py +32 -0
  128. snappy/geometric_structure/geodesic/__init__.py +0 -0
  129. snappy/geometric_structure/geodesic/add_core_curves.py +152 -0
  130. snappy/geometric_structure/geodesic/avoid_core_curves.py +369 -0
  131. snappy/geometric_structure/geodesic/canonical_keys.py +52 -0
  132. snappy/geometric_structure/geodesic/check_away_from_core_curve.py +60 -0
  133. snappy/geometric_structure/geodesic/constants.py +6 -0
  134. snappy/geometric_structure/geodesic/exceptions.py +22 -0
  135. snappy/{drilling → geometric_structure/geodesic}/fixed_points.py +34 -9
  136. snappy/{drilling/geodesic_info.py → geometric_structure/geodesic/geodesic_start_point_info.py} +139 -180
  137. snappy/geometric_structure/geodesic/graph_trace_helper.py +67 -0
  138. snappy/geometric_structure/geodesic/line.py +30 -0
  139. snappy/geometric_structure/geodesic/multiplicity.py +127 -0
  140. snappy/geometric_structure/geodesic/tiles_for_geodesic.py +101 -0
  141. snappy/geometric_structure/test.py +22 -0
  142. snappy/gui.py +23 -13
  143. snappy/horoviewer.py +7 -7
  144. snappy/hyperboloid/__init__.py +96 -31
  145. snappy/hyperboloid/distances.py +245 -0
  146. snappy/hyperboloid/horoball.py +19 -0
  147. snappy/hyperboloid/line.py +35 -0
  148. snappy/hyperboloid/point.py +9 -0
  149. snappy/hyperboloid/triangle.py +29 -0
  150. snappy/isometry_signature.py +382 -0
  151. snappy/len_spec/__init__.py +596 -0
  152. snappy/len_spec/geodesic_info.py +110 -0
  153. snappy/len_spec/geodesic_key_info_dict.py +117 -0
  154. snappy/len_spec/geodesic_piece.py +143 -0
  155. snappy/len_spec/geometric_structure.py +182 -0
  156. snappy/len_spec/geometry.py +80 -0
  157. snappy/len_spec/length_spectrum_geodesic_info.py +170 -0
  158. snappy/len_spec/spine.py +206 -0
  159. snappy/len_spec/test.py +24 -0
  160. snappy/len_spec/test_cases.py +69 -0
  161. snappy/len_spec/tile.py +275 -0
  162. snappy/len_spec/word.py +86 -0
  163. snappy/math_basics.py +39 -13
  164. snappy/matrix.py +52 -9
  165. snappy/number.py +12 -6
  166. snappy/numeric_output_checker.py +2 -3
  167. snappy/pari.py +6 -3
  168. snappy/polyviewer.py +8 -8
  169. snappy/ptolemy/__init__.py +1 -1
  170. snappy/ptolemy/component.py +2 -2
  171. snappy/ptolemy/coordinates.py +25 -25
  172. snappy/ptolemy/findLoops.py +9 -9
  173. snappy/ptolemy/manifoldMethods.py +27 -29
  174. snappy/ptolemy/polynomial.py +50 -57
  175. snappy/ptolemy/processFileBase.py +60 -0
  176. snappy/ptolemy/ptolemyVariety.py +109 -41
  177. snappy/ptolemy/reginaWrapper.py +4 -4
  178. snappy/ptolemy/rur.py +1 -1
  179. snappy/ptolemy/solutionsToPrimeIdealGroebnerBasis.py +9 -9
  180. snappy/ptolemy/test.py +99 -54
  181. snappy/ptolemy/utilities.py +1 -1
  182. snappy/raytracing/__init__.py +64 -0
  183. snappy/raytracing/additional_horospheres.py +64 -0
  184. snappy/raytracing/additional_len_spec_choices.py +63 -0
  185. snappy/raytracing/cohomology_fractal.py +0 -3
  186. snappy/raytracing/eyeball.py +123 -0
  187. snappy/raytracing/finite_raytracing_data.py +17 -17
  188. snappy/raytracing/finite_viewer.py +15 -15
  189. snappy/raytracing/geodesic_tube_info.py +93 -63
  190. snappy/raytracing/geodesics.py +94 -64
  191. snappy/raytracing/geodesics_window.py +56 -34
  192. snappy/raytracing/gui_utilities.py +21 -6
  193. snappy/raytracing/hyperboloid_navigation.py +29 -4
  194. snappy/raytracing/hyperboloid_utilities.py +73 -73
  195. snappy/raytracing/ideal_raytracing_data.py +121 -91
  196. snappy/raytracing/inside_viewer.py +199 -66
  197. snappy/raytracing/pack.py +22 -0
  198. snappy/raytracing/raytracing_data.py +37 -25
  199. snappy/raytracing/raytracing_view.py +70 -65
  200. snappy/raytracing/shaders/Eye.png +0 -0
  201. snappy/raytracing/shaders/NonGeometric.png +0 -0
  202. snappy/raytracing/shaders/__init__.py +39 -3
  203. snappy/raytracing/shaders/fragment.glsl +451 -133
  204. snappy/raytracing/test.py +29 -0
  205. snappy/raytracing/tooltip.py +146 -0
  206. snappy/raytracing/upper_halfspace_utilities.py +42 -9
  207. snappy/sage_helper.py +67 -134
  208. snappy/settings.py +90 -77
  209. snappy/shell.py +2 -0
  210. snappy/snap/character_varieties.py +2 -2
  211. snappy/snap/find_field.py +4 -3
  212. snappy/snap/fundamental_polyhedron.py +2 -2
  213. snappy/snap/kernel_structures.py +5 -1
  214. snappy/snap/nsagetools.py +9 -8
  215. snappy/snap/peripheral/dual_cellulation.py +4 -3
  216. snappy/snap/peripheral/peripheral.py +2 -2
  217. snappy/snap/peripheral/surface.py +5 -5
  218. snappy/snap/peripheral/test.py +1 -1
  219. snappy/snap/polished_reps.py +8 -8
  220. snappy/snap/slice_obs_HKL.py +16 -14
  221. snappy/snap/t3mlite/arrow.py +3 -3
  222. snappy/snap/t3mlite/edge.py +3 -3
  223. snappy/snap/t3mlite/homology.py +2 -2
  224. snappy/snap/t3mlite/mcomplex.py +3 -3
  225. snappy/snap/t3mlite/simplex.py +12 -0
  226. snappy/snap/t3mlite/spun.py +18 -17
  227. snappy/snap/t3mlite/test_vs_regina.py +4 -4
  228. snappy/snap/test.py +37 -53
  229. snappy/snap/utilities.py +4 -5
  230. snappy/test.py +121 -138
  231. snappy/test_cases.py +263 -0
  232. snappy/testing.py +131 -0
  233. snappy/tiling/__init__.py +2 -0
  234. snappy/tiling/canonical_key_dict.py +59 -0
  235. snappy/tiling/dict_based_set.py +79 -0
  236. snappy/tiling/floor.py +49 -0
  237. snappy/tiling/hyperboloid_dict.py +54 -0
  238. snappy/tiling/iter_utils.py +78 -0
  239. snappy/tiling/lifted_tetrahedron.py +22 -0
  240. snappy/tiling/lifted_tetrahedron_set.py +54 -0
  241. snappy/tiling/real_hash_dict.py +164 -0
  242. snappy/tiling/test.py +23 -0
  243. snappy/tiling/tile.py +215 -0
  244. snappy/tiling/triangle.py +33 -0
  245. snappy/tkterminal.py +113 -84
  246. snappy/twister/main.py +1 -7
  247. snappy/twister/twister_core.cpython-312-darwin.so +0 -0
  248. snappy/upper_halfspace/__init__.py +78 -17
  249. snappy/verify/__init__.py +3 -7
  250. snappy/verify/{verifyCanonical.py → canonical.py} +78 -70
  251. snappy/verify/complex_volume/adjust_torsion.py +1 -2
  252. snappy/verify/complex_volume/closed.py +13 -13
  253. snappy/verify/complex_volume/cusped.py +6 -6
  254. snappy/verify/complex_volume/extended_bloch.py +5 -8
  255. snappy/verify/{cuspTranslations.py → cusp_translations.py} +1 -1
  256. snappy/verify/edge_equations.py +80 -0
  257. snappy/verify/exceptions.py +0 -55
  258. snappy/verify/{verifyHyperbolicity.py → hyperbolicity.py} +3 -3
  259. snappy/verify/interval_newton_shapes_engine.py +7 -5
  260. snappy/verify/interval_tree.py +5 -5
  261. snappy/verify/krawczyk_shapes_engine.py +17 -18
  262. snappy/verify/maximal_cusp_area_matrix/__init__.py +7 -74
  263. snappy/verify/maximal_cusp_area_matrix/cusp_tiling_engine.py +3 -4
  264. snappy/verify/maximal_cusp_area_matrix/cusp_translate_engine.py +1 -1
  265. snappy/verify/{realAlgebra.py → real_algebra.py} +1 -1
  266. snappy/verify/shapes.py +5 -3
  267. snappy/verify/short_slopes.py +39 -41
  268. snappy/verify/{squareExtensions.py → square_extensions.py} +14 -11
  269. snappy/verify/test.py +57 -60
  270. snappy/verify/upper_halfspace/extended_matrix.py +1 -1
  271. snappy/verify/upper_halfspace/finite_point.py +3 -4
  272. snappy/verify/upper_halfspace/ideal_point.py +9 -9
  273. snappy/verify/volume.py +2 -2
  274. snappy/version.py +2 -2
  275. {snappy-3.1.1.dist-info → snappy-3.2.dist-info}/METADATA +25 -11
  276. snappy-3.2.dist-info/RECORD +503 -0
  277. {snappy-3.1.1.dist-info → snappy-3.2.dist-info}/WHEEL +1 -1
  278. {snappy-3.1.1.dist-info → snappy-3.2.dist-info}/top_level.txt +6 -1
  279. snappy/__pycache__/__init__.cpython-312.pyc +0 -0
  280. snappy/__pycache__/browser.cpython-312.pyc +0 -0
  281. snappy/__pycache__/cache.cpython-312.pyc +0 -0
  282. snappy/__pycache__/database.cpython-312.pyc +0 -0
  283. snappy/__pycache__/db_utilities.cpython-312.pyc +0 -0
  284. snappy/__pycache__/decorated_isosig.cpython-312.pyc +0 -0
  285. snappy/__pycache__/exceptions.cpython-312.pyc +0 -0
  286. snappy/__pycache__/export_stl.cpython-312.pyc +0 -0
  287. snappy/__pycache__/filedialog.cpython-312.pyc +0 -0
  288. snappy/__pycache__/gui.cpython-312.pyc +0 -0
  289. snappy/__pycache__/horoviewer.cpython-312.pyc +0 -0
  290. snappy/__pycache__/infowindow.cpython-312.pyc +0 -0
  291. snappy/__pycache__/math_basics.cpython-312.pyc +0 -0
  292. snappy/__pycache__/matrix.cpython-312.pyc +0 -0
  293. snappy/__pycache__/number.cpython-312.pyc +0 -0
  294. snappy/__pycache__/numeric_output_checker.cpython-312.pyc +0 -0
  295. snappy/__pycache__/pari.cpython-312.pyc +0 -0
  296. snappy/__pycache__/polyviewer.cpython-312.pyc +0 -0
  297. snappy/__pycache__/sage_helper.cpython-312.pyc +0 -0
  298. snappy/__pycache__/version.cpython-312.pyc +0 -0
  299. snappy/doc/_sources/verify_canon.rst.txt +0 -90
  300. snappy/doc/_static/js/html5shiv-printshiv.min.js +0 -4
  301. snappy/doc/_static/js/html5shiv.min.js +0 -4
  302. snappy/doc/verify_canon.html +0 -304
  303. snappy/drilling/__pycache__/__init__.cpython-312.pyc +0 -0
  304. snappy/drilling/__pycache__/constants.cpython-312.pyc +0 -0
  305. snappy/drilling/__pycache__/crush.cpython-312.pyc +0 -0
  306. snappy/drilling/__pycache__/cusps.cpython-312.pyc +0 -0
  307. snappy/drilling/__pycache__/debug.cpython-312.pyc +0 -0
  308. snappy/drilling/__pycache__/epsilons.cpython-312.pyc +0 -0
  309. snappy/drilling/__pycache__/exceptions.cpython-312.pyc +0 -0
  310. snappy/drilling/__pycache__/fixed_points.cpython-312.pyc +0 -0
  311. snappy/drilling/__pycache__/geodesic_info.cpython-312.pyc +0 -0
  312. snappy/drilling/__pycache__/geodesic_tube.cpython-312.pyc +0 -0
  313. snappy/drilling/__pycache__/geometric_structure.cpython-312.pyc +0 -0
  314. snappy/drilling/__pycache__/line.cpython-312.pyc +0 -0
  315. snappy/drilling/__pycache__/moves.cpython-312.pyc +0 -0
  316. snappy/drilling/__pycache__/peripheral_curves.cpython-312.pyc +0 -0
  317. snappy/drilling/__pycache__/perturb.cpython-312.pyc +0 -0
  318. snappy/drilling/__pycache__/quotient_space.cpython-312.pyc +0 -0
  319. snappy/drilling/__pycache__/spatial_dict.cpython-312.pyc +0 -0
  320. snappy/drilling/__pycache__/subdivide.cpython-312.pyc +0 -0
  321. snappy/drilling/__pycache__/tracing.cpython-312.pyc +0 -0
  322. snappy/drilling/geodesic_tube.py +0 -441
  323. snappy/drilling/geometric_structure.py +0 -366
  324. snappy/drilling/line.py +0 -122
  325. snappy/drilling/quotient_space.py +0 -94
  326. snappy/drilling/spatial_dict.py +0 -128
  327. snappy/exterior_to_link/__pycache__/__init__.cpython-312.pyc +0 -0
  328. snappy/exterior_to_link/__pycache__/barycentric_geometry.cpython-312.pyc +0 -0
  329. snappy/exterior_to_link/__pycache__/exceptions.cpython-312.pyc +0 -0
  330. snappy/exterior_to_link/__pycache__/hyp_utils.cpython-312.pyc +0 -0
  331. snappy/exterior_to_link/__pycache__/link_projection.cpython-312.pyc +0 -0
  332. snappy/exterior_to_link/__pycache__/main.cpython-312.pyc +0 -0
  333. snappy/exterior_to_link/__pycache__/mcomplex_with_expansion.cpython-312.pyc +0 -0
  334. snappy/exterior_to_link/__pycache__/mcomplex_with_link.cpython-312.pyc +0 -0
  335. snappy/exterior_to_link/__pycache__/mcomplex_with_memory.cpython-312.pyc +0 -0
  336. snappy/exterior_to_link/__pycache__/pl_utils.cpython-312.pyc +0 -0
  337. snappy/exterior_to_link/__pycache__/put_in_S3.cpython-312.pyc +0 -0
  338. snappy/exterior_to_link/__pycache__/rational_linear_algebra.cpython-312.pyc +0 -0
  339. snappy/exterior_to_link/__pycache__/simplify_to_base_tri.cpython-312.pyc +0 -0
  340. snappy/exterior_to_link/__pycache__/stored_moves.cpython-312.pyc +0 -0
  341. snappy/hyperboloid/__pycache__/__init__.cpython-312.pyc +0 -0
  342. snappy/manifolds/__pycache__/__init__.cpython-312.pyc +0 -0
  343. snappy/ptolemy/__pycache__/__init__.cpython-312.pyc +0 -0
  344. snappy/ptolemy/__pycache__/component.cpython-312.pyc +0 -0
  345. snappy/ptolemy/__pycache__/coordinates.cpython-312.pyc +0 -0
  346. snappy/ptolemy/__pycache__/fieldExtensions.cpython-312.pyc +0 -0
  347. snappy/ptolemy/__pycache__/findLoops.cpython-312.pyc +0 -0
  348. snappy/ptolemy/__pycache__/homology.cpython-312.pyc +0 -0
  349. snappy/ptolemy/__pycache__/manifoldMethods.cpython-312.pyc +0 -0
  350. snappy/ptolemy/__pycache__/matrix.cpython-312.pyc +0 -0
  351. snappy/ptolemy/__pycache__/numericalSolutionsToGroebnerBasis.cpython-312.pyc +0 -0
  352. snappy/ptolemy/__pycache__/polynomial.cpython-312.pyc +0 -0
  353. snappy/ptolemy/__pycache__/processComponents.cpython-312.pyc +0 -0
  354. snappy/ptolemy/__pycache__/processFileBase.cpython-312.pyc +0 -0
  355. snappy/ptolemy/__pycache__/processFileDispatch.cpython-312.pyc +0 -0
  356. snappy/ptolemy/__pycache__/processMagmaFile.cpython-312.pyc +0 -0
  357. snappy/ptolemy/__pycache__/processRurFile.cpython-312.pyc +0 -0
  358. snappy/ptolemy/__pycache__/ptolemyGeneralizedObstructionClass.cpython-312.pyc +0 -0
  359. snappy/ptolemy/__pycache__/ptolemyObstructionClass.cpython-312.pyc +0 -0
  360. snappy/ptolemy/__pycache__/ptolemyVariety.cpython-312.pyc +0 -0
  361. snappy/ptolemy/__pycache__/ptolemyVarietyPrimeIdealGroebnerBasis.cpython-312.pyc +0 -0
  362. snappy/ptolemy/__pycache__/rur.cpython-312.pyc +0 -0
  363. snappy/ptolemy/__pycache__/solutionsToPrimeIdealGroebnerBasis.cpython-312.pyc +0 -0
  364. snappy/ptolemy/__pycache__/utilities.cpython-312.pyc +0 -0
  365. snappy/raytracing/__pycache__/__init__.cpython-312.pyc +0 -0
  366. snappy/raytracing/__pycache__/finite_raytracing_data.cpython-312.pyc +0 -0
  367. snappy/raytracing/__pycache__/gui_utilities.cpython-312.pyc +0 -0
  368. snappy/raytracing/__pycache__/hyperboloid_navigation.cpython-312.pyc +0 -0
  369. snappy/raytracing/__pycache__/hyperboloid_utilities.cpython-312.pyc +0 -0
  370. snappy/raytracing/__pycache__/ideal_raytracing_data.cpython-312.pyc +0 -0
  371. snappy/raytracing/__pycache__/inside_viewer.cpython-312.pyc +0 -0
  372. snappy/raytracing/__pycache__/raytracing_data.cpython-312.pyc +0 -0
  373. snappy/raytracing/__pycache__/raytracing_view.cpython-312.pyc +0 -0
  374. snappy/raytracing/__pycache__/upper_halfspace_utilities.cpython-312.pyc +0 -0
  375. snappy/raytracing/__pycache__/view_scale_controller.cpython-312.pyc +0 -0
  376. snappy/raytracing/zoom_slider/__pycache__/__init__.cpython-312.pyc +0 -0
  377. snappy/snap/__pycache__/__init__.cpython-312.pyc +0 -0
  378. snappy/snap/__pycache__/character_varieties.cpython-312.pyc +0 -0
  379. snappy/snap/__pycache__/fundamental_polyhedron.cpython-312.pyc +0 -0
  380. snappy/snap/__pycache__/interval_reps.cpython-312.pyc +0 -0
  381. snappy/snap/__pycache__/kernel_structures.cpython-312.pyc +0 -0
  382. snappy/snap/__pycache__/mcomplex_base.cpython-312.pyc +0 -0
  383. snappy/snap/__pycache__/nsagetools.cpython-312.pyc +0 -0
  384. snappy/snap/__pycache__/polished_reps.cpython-312.pyc +0 -0
  385. snappy/snap/__pycache__/shapes.cpython-312.pyc +0 -0
  386. snappy/snap/__pycache__/slice_obs_HKL.cpython-312.pyc +0 -0
  387. snappy/snap/__pycache__/utilities.cpython-312.pyc +0 -0
  388. snappy/snap/peripheral/__pycache__/__init__.cpython-312.pyc +0 -0
  389. snappy/snap/peripheral/__pycache__/dual_cellulation.cpython-312.pyc +0 -0
  390. snappy/snap/peripheral/__pycache__/link.cpython-312.pyc +0 -0
  391. snappy/snap/peripheral/__pycache__/peripheral.cpython-312.pyc +0 -0
  392. snappy/snap/peripheral/__pycache__/surface.cpython-312.pyc +0 -0
  393. snappy/snap/t3mlite/__pycache__/__init__.cpython-312.pyc +0 -0
  394. snappy/snap/t3mlite/__pycache__/arrow.cpython-312.pyc +0 -0
  395. snappy/snap/t3mlite/__pycache__/corner.cpython-312.pyc +0 -0
  396. snappy/snap/t3mlite/__pycache__/edge.cpython-312.pyc +0 -0
  397. snappy/snap/t3mlite/__pycache__/face.cpython-312.pyc +0 -0
  398. snappy/snap/t3mlite/__pycache__/files.cpython-312.pyc +0 -0
  399. snappy/snap/t3mlite/__pycache__/homology.cpython-312.pyc +0 -0
  400. snappy/snap/t3mlite/__pycache__/linalg.cpython-312.pyc +0 -0
  401. snappy/snap/t3mlite/__pycache__/mcomplex.cpython-312.pyc +0 -0
  402. snappy/snap/t3mlite/__pycache__/perm4.cpython-312.pyc +0 -0
  403. snappy/snap/t3mlite/__pycache__/simplex.cpython-312.pyc +0 -0
  404. snappy/snap/t3mlite/__pycache__/spun.cpython-312.pyc +0 -0
  405. snappy/snap/t3mlite/__pycache__/surface.cpython-312.pyc +0 -0
  406. snappy/snap/t3mlite/__pycache__/tetrahedron.cpython-312.pyc +0 -0
  407. snappy/snap/t3mlite/__pycache__/vertex.cpython-312.pyc +0 -0
  408. snappy/togl/__init__.py +0 -3
  409. snappy/togl/darwin-tk8.6/Togl2.1/LICENSE +0 -28
  410. snappy/togl/darwin-tk8.6/Togl2.1/libTogl2.1.dylib +0 -0
  411. snappy/togl/darwin-tk8.6/Togl2.1/pkgIndex.tcl +0 -5
  412. snappy/togl/darwin-tk8.7/Togl2.1/LICENSE +0 -28
  413. snappy/togl/darwin-tk8.7/Togl2.1/libTogl2.1.dylib +0 -0
  414. snappy/togl/darwin-tk8.7/Togl2.1/pkgIndex.tcl +0 -5
  415. snappy/togl/linux2-x86_64-tk8.6/Togl2.1/LICENSE +0 -28
  416. snappy/togl/linux2-x86_64-tk8.6/Togl2.1/libTogl2.1.so +0 -0
  417. snappy/togl/linux2-x86_64-tk8.6/Togl2.1/pkgIndex.tcl +0 -5
  418. snappy/togl/win32VC-tk8.6/Togl2.1/LICENSE +0 -28
  419. snappy/togl/win32VC-tk8.6/Togl2.1/Togl21.dll +0 -0
  420. snappy/togl/win32VC-tk8.6/Togl2.1/Togl21.lib +0 -0
  421. snappy/togl/win32VC-tk8.6/Togl2.1/pkgIndex.tcl +0 -6
  422. snappy/togl/win32VC-x86_64-tk8.6/Togl2.1/LICENSE +0 -28
  423. snappy/togl/win32VC-x86_64-tk8.6/Togl2.1/Togl21.dll +0 -0
  424. snappy/togl/win32VC-x86_64-tk8.6/Togl2.1/Togl21.lib +0 -0
  425. snappy/togl/win32VC-x86_64-tk8.6/Togl2.1/pkgIndex.tcl +0 -6
  426. snappy/twister/__pycache__/__init__.cpython-312.pyc +0 -0
  427. snappy/twister/__pycache__/main.cpython-312.pyc +0 -0
  428. snappy/upper_halfspace/__pycache__/__init__.cpython-312.pyc +0 -0
  429. snappy/upper_halfspace/__pycache__/ideal_point.cpython-312.pyc +0 -0
  430. snappy/verify/__pycache__/__init__.cpython-312.pyc +0 -0
  431. snappy/verify/__pycache__/cuspCrossSection.cpython-312.pyc +0 -0
  432. snappy/verify/__pycache__/cuspTranslations.cpython-312.pyc +0 -0
  433. snappy/verify/__pycache__/cusp_areas.cpython-312.pyc +0 -0
  434. snappy/verify/__pycache__/cusp_shapes.cpython-312.pyc +0 -0
  435. snappy/verify/__pycache__/exceptions.cpython-312.pyc +0 -0
  436. snappy/verify/__pycache__/interval_newton_shapes_engine.cpython-312.pyc +0 -0
  437. snappy/verify/__pycache__/interval_tree.cpython-312.pyc +0 -0
  438. snappy/verify/__pycache__/krawczyk_shapes_engine.cpython-312.pyc +0 -0
  439. snappy/verify/__pycache__/realAlgebra.cpython-312.pyc +0 -0
  440. snappy/verify/__pycache__/shapes.cpython-312.pyc +0 -0
  441. snappy/verify/__pycache__/short_slopes.cpython-312.pyc +0 -0
  442. snappy/verify/__pycache__/squareExtensions.cpython-312.pyc +0 -0
  443. snappy/verify/__pycache__/verifyCanonical.cpython-312.pyc +0 -0
  444. snappy/verify/__pycache__/verifyHyperbolicity.cpython-312.pyc +0 -0
  445. snappy/verify/__pycache__/volume.cpython-312.pyc +0 -0
  446. snappy/verify/complex_volume/__pycache__/__init__.cpython-312.pyc +0 -0
  447. snappy/verify/complex_volume/__pycache__/adjust_torsion.cpython-312.pyc +0 -0
  448. snappy/verify/complex_volume/__pycache__/closed.cpython-312.pyc +0 -0
  449. snappy/verify/complex_volume/__pycache__/compute_ptolemys.cpython-312.pyc +0 -0
  450. snappy/verify/complex_volume/__pycache__/cusped.cpython-312.pyc +0 -0
  451. snappy/verify/complex_volume/__pycache__/extended_bloch.cpython-312.pyc +0 -0
  452. snappy/verify/cuspCrossSection.py +0 -1422
  453. snappy/verify/maximal_cusp_area_matrix/__pycache__/__init__.cpython-312.pyc +0 -0
  454. snappy/verify/maximal_cusp_area_matrix/__pycache__/cusp_tiling_engine.cpython-312.pyc +0 -0
  455. snappy/verify/maximal_cusp_area_matrix/__pycache__/cusp_translate_engine.cpython-312.pyc +0 -0
  456. snappy/verify/upper_halfspace/__pycache__/__init__.cpython-312.pyc +0 -0
  457. snappy/verify/upper_halfspace/__pycache__/extended_matrix.cpython-312.pyc +0 -0
  458. snappy/verify/upper_halfspace/__pycache__/finite_point.cpython-312.pyc +0 -0
  459. snappy/verify/upper_halfspace/__pycache__/ideal_point.cpython-312.pyc +0 -0
  460. snappy-3.1.1.dist-info/RECORD +0 -585
  461. {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)