snappy 3.0.3__cp38-cp38-macosx_11_0_arm64.whl → 3.2__cp38-cp38-macosx_11_0_arm64.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (401) hide show
  1. snappy/CyOpenGL.cpython-38-darwin.so +0 -0
  2. snappy/SnapPy.cpython-38-darwin.so +0 -0
  3. snappy/SnapPyHP.cpython-38-darwin.so +0 -0
  4. snappy/__init__.py +373 -426
  5. snappy/app.py +240 -75
  6. snappy/app_menus.py +93 -78
  7. snappy/browser.py +87 -63
  8. snappy/cache.py +5 -8
  9. snappy/canonical.py +249 -0
  10. snappy/{verify/cusp_shapes.py → cusps/__init__.py} +11 -19
  11. snappy/cusps/cusp_area_matrix.py +101 -0
  12. snappy/{verify/cusp_areas.py → cusps/cusp_areas_from_matrix.py} +39 -54
  13. snappy/cusps/maximal_cusp_area_matrix.py +136 -0
  14. snappy/cusps/test.py +21 -0
  15. snappy/cusps/trig_cusp_area_matrix.py +63 -0
  16. snappy/database.py +40 -31
  17. snappy/db_utilities.py +13 -14
  18. snappy/decorated_isosig.py +377 -133
  19. snappy/dev/extended_ptolemy/complexVolumesClosed.py +42 -9
  20. snappy/dev/extended_ptolemy/extended.py +32 -25
  21. snappy/dev/extended_ptolemy/giac_rur.py +23 -8
  22. snappy/dev/extended_ptolemy/phc_wrapper.py +10 -10
  23. snappy/dev/vericlosed/computeApproxHyperbolicStructureOrb.py +2 -1
  24. snappy/dev/vericlosed/gimbalLoopFinder.py +5 -5
  25. snappy/dev/vericlosed/hyperbolicStructure.py +3 -3
  26. snappy/dev/vericlosed/oneVertexTruncatedComplex.py +2 -2
  27. snappy/dev/vericlosed/truncatedComplex.py +3 -2
  28. snappy/dev/vericlosed/verifyHyperbolicStructureEngine.py +4 -3
  29. snappy/doc/_images/geodesics.jpg +0 -0
  30. snappy/doc/_images/m004_paper_plane_on_systole.jpg +0 -0
  31. snappy/doc/_images/m125_paper_plane.jpg +0 -0
  32. snappy/doc/_images/o9_00000_systole_paper_plane.jpg +0 -0
  33. snappy/doc/_images/o9_00000_systole_paper_plane_closer.jpg +0 -0
  34. snappy/doc/_sources/additional_classes.rst.txt +1 -0
  35. snappy/doc/_sources/credits.rst.txt +6 -1
  36. snappy/doc/_sources/development.rst.txt +69 -50
  37. snappy/doc/_sources/index.rst.txt +101 -66
  38. snappy/doc/_sources/installing.rst.txt +148 -165
  39. snappy/doc/_sources/news.rst.txt +136 -32
  40. snappy/doc/_sources/ptolemy.rst.txt +1 -1
  41. snappy/doc/_sources/ptolemy_examples1.rst.txt +9 -8
  42. snappy/doc/_sources/ptolemy_examples2.rst.txt +3 -3
  43. snappy/doc/_sources/ptolemy_examples3.rst.txt +14 -14
  44. snappy/doc/_sources/ptolemy_prelim.rst.txt +1 -1
  45. snappy/doc/_sources/snap.rst.txt +2 -2
  46. snappy/doc/_sources/snappy.rst.txt +1 -1
  47. snappy/doc/_sources/triangulation.rst.txt +3 -2
  48. snappy/doc/_sources/verify.rst.txt +89 -29
  49. snappy/doc/_sources/verify_internals.rst.txt +5 -16
  50. snappy/doc/_static/SnapPy-horizontal-128.png +0 -0
  51. snappy/doc/_static/SnapPy.ico +0 -0
  52. snappy/doc/_static/_sphinx_javascript_frameworks_compat.js +123 -0
  53. snappy/doc/_static/basic.css +47 -27
  54. snappy/doc/_static/css/badge_only.css +1 -0
  55. snappy/doc/_static/css/fonts/Roboto-Slab-Bold.woff +0 -0
  56. snappy/doc/_static/css/fonts/Roboto-Slab-Bold.woff2 +0 -0
  57. snappy/doc/_static/css/fonts/Roboto-Slab-Regular.woff +0 -0
  58. snappy/doc/_static/css/fonts/Roboto-Slab-Regular.woff2 +0 -0
  59. snappy/doc/_static/css/fonts/fontawesome-webfont.eot +0 -0
  60. snappy/doc/_static/css/fonts/fontawesome-webfont.svg +2671 -0
  61. snappy/doc/_static/css/fonts/fontawesome-webfont.ttf +0 -0
  62. snappy/doc/_static/css/fonts/fontawesome-webfont.woff +0 -0
  63. snappy/doc/_static/css/fonts/fontawesome-webfont.woff2 +0 -0
  64. snappy/doc/_static/css/fonts/lato-bold-italic.woff +0 -0
  65. snappy/doc/_static/css/fonts/lato-bold-italic.woff2 +0 -0
  66. snappy/doc/_static/css/fonts/lato-bold.woff +0 -0
  67. snappy/doc/_static/css/fonts/lato-bold.woff2 +0 -0
  68. snappy/doc/_static/css/fonts/lato-normal-italic.woff +0 -0
  69. snappy/doc/_static/css/fonts/lato-normal-italic.woff2 +0 -0
  70. snappy/doc/_static/css/fonts/lato-normal.woff +0 -0
  71. snappy/doc/_static/css/fonts/lato-normal.woff2 +0 -0
  72. snappy/doc/_static/css/theme.css +4 -0
  73. snappy/doc/_static/doctools.js +107 -274
  74. snappy/doc/_static/documentation_options.js +6 -5
  75. snappy/doc/_static/fonts/Lato/lato-bold.eot +0 -0
  76. snappy/doc/_static/fonts/Lato/lato-bold.ttf +0 -0
  77. snappy/doc/_static/fonts/Lato/lato-bold.woff +0 -0
  78. snappy/doc/_static/fonts/Lato/lato-bold.woff2 +0 -0
  79. snappy/doc/_static/fonts/Lato/lato-bolditalic.eot +0 -0
  80. snappy/doc/_static/fonts/Lato/lato-bolditalic.ttf +0 -0
  81. snappy/doc/_static/fonts/Lato/lato-bolditalic.woff +0 -0
  82. snappy/doc/_static/fonts/Lato/lato-bolditalic.woff2 +0 -0
  83. snappy/doc/_static/fonts/Lato/lato-italic.eot +0 -0
  84. snappy/doc/_static/fonts/Lato/lato-italic.ttf +0 -0
  85. snappy/doc/_static/fonts/Lato/lato-italic.woff +0 -0
  86. snappy/doc/_static/fonts/Lato/lato-italic.woff2 +0 -0
  87. snappy/doc/_static/fonts/Lato/lato-regular.eot +0 -0
  88. snappy/doc/_static/fonts/Lato/lato-regular.ttf +0 -0
  89. snappy/doc/_static/fonts/Lato/lato-regular.woff +0 -0
  90. snappy/doc/_static/fonts/Lato/lato-regular.woff2 +0 -0
  91. snappy/doc/_static/fonts/RobotoSlab/roboto-slab-v7-bold.eot +0 -0
  92. snappy/doc/_static/fonts/RobotoSlab/roboto-slab-v7-bold.ttf +0 -0
  93. snappy/doc/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff +0 -0
  94. snappy/doc/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff2 +0 -0
  95. snappy/doc/_static/fonts/RobotoSlab/roboto-slab-v7-regular.eot +0 -0
  96. snappy/doc/_static/fonts/RobotoSlab/roboto-slab-v7-regular.ttf +0 -0
  97. snappy/doc/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff +0 -0
  98. snappy/doc/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff2 +0 -0
  99. snappy/doc/_static/jquery.js +2 -2
  100. snappy/doc/_static/js/badge_only.js +1 -0
  101. snappy/doc/_static/js/theme.js +1 -0
  102. snappy/doc/_static/js/versions.js +228 -0
  103. snappy/doc/_static/language_data.js +3 -101
  104. snappy/doc/_static/pygments.css +1 -0
  105. snappy/doc/_static/searchtools.js +489 -398
  106. snappy/doc/_static/snappy_furo.css +33 -0
  107. snappy/doc/_static/snappy_sphinx_rtd_theme.css +42 -0
  108. snappy/doc/_static/sphinx_highlight.js +154 -0
  109. snappy/doc/additional_classes.html +688 -263
  110. snappy/doc/bugs.html +107 -94
  111. snappy/doc/censuses.html +155 -127
  112. snappy/doc/credits.html +115 -104
  113. snappy/doc/development.html +184 -146
  114. snappy/doc/genindex.html +287 -204
  115. snappy/doc/index.html +189 -150
  116. snappy/doc/installing.html +259 -266
  117. snappy/doc/manifold.html +1626 -592
  118. snappy/doc/manifoldhp.html +119 -105
  119. snappy/doc/news.html +198 -104
  120. snappy/doc/objects.inv +0 -0
  121. snappy/doc/other.html +117 -105
  122. snappy/doc/platonic_census.html +161 -114
  123. snappy/doc/plink.html +113 -105
  124. snappy/doc/ptolemy.html +131 -108
  125. snappy/doc/ptolemy_classes.html +242 -223
  126. snappy/doc/ptolemy_examples1.html +144 -130
  127. snappy/doc/ptolemy_examples2.html +141 -129
  128. snappy/doc/ptolemy_examples3.html +148 -132
  129. snappy/doc/ptolemy_examples4.html +131 -111
  130. snappy/doc/ptolemy_prelim.html +162 -138
  131. snappy/doc/py-modindex.html +104 -69
  132. snappy/doc/screenshots.html +117 -108
  133. snappy/doc/search.html +115 -84
  134. snappy/doc/searchindex.js +1 -1
  135. snappy/doc/snap.html +109 -96
  136. snappy/doc/snappy.html +134 -97
  137. snappy/doc/spherogram.html +259 -187
  138. snappy/doc/todo.html +107 -94
  139. snappy/doc/triangulation.html +1380 -111
  140. snappy/doc/tutorial.html +107 -94
  141. snappy/doc/verify.html +194 -125
  142. snappy/doc/verify_internals.html +248 -686
  143. snappy/drilling/__init__.py +456 -0
  144. snappy/drilling/barycentric.py +103 -0
  145. snappy/drilling/constants.py +5 -0
  146. snappy/drilling/crush.py +270 -0
  147. snappy/drilling/cusps.py +125 -0
  148. snappy/drilling/debug.py +242 -0
  149. snappy/drilling/epsilons.py +6 -0
  150. snappy/drilling/exceptions.py +55 -0
  151. snappy/drilling/moves.py +620 -0
  152. snappy/drilling/peripheral_curves.py +210 -0
  153. snappy/drilling/perturb.py +188 -0
  154. snappy/drilling/shorten.py +36 -0
  155. snappy/drilling/subdivide.py +274 -0
  156. snappy/drilling/test.py +23 -0
  157. snappy/drilling/test_cases.py +126 -0
  158. snappy/drilling/tracing.py +351 -0
  159. snappy/exceptions.py +23 -3
  160. snappy/export_stl.py +20 -14
  161. snappy/exterior_to_link/__init__.py +2 -0
  162. snappy/exterior_to_link/barycentric_geometry.py +463 -0
  163. snappy/exterior_to_link/exceptions.py +6 -0
  164. snappy/exterior_to_link/geodesic_map.json +14408 -0
  165. snappy/exterior_to_link/hyp_utils.py +112 -0
  166. snappy/exterior_to_link/link_projection.py +323 -0
  167. snappy/exterior_to_link/main.py +197 -0
  168. snappy/exterior_to_link/mcomplex_with_expansion.py +261 -0
  169. snappy/exterior_to_link/mcomplex_with_link.py +687 -0
  170. snappy/exterior_to_link/mcomplex_with_memory.py +162 -0
  171. snappy/exterior_to_link/pl_utils.py +491 -0
  172. snappy/exterior_to_link/put_in_S3.py +156 -0
  173. snappy/exterior_to_link/rational_linear_algebra.py +123 -0
  174. snappy/exterior_to_link/rational_linear_algebra_wrapped.py +135 -0
  175. snappy/exterior_to_link/simplify_to_base_tri.py +114 -0
  176. snappy/exterior_to_link/stored_moves.py +475 -0
  177. snappy/exterior_to_link/test.py +31 -0
  178. snappy/geometric_structure/__init__.py +212 -0
  179. snappy/geometric_structure/cusp_neighborhood/__init__.py +3 -0
  180. snappy/geometric_structure/cusp_neighborhood/complex_cusp_cross_section.py +697 -0
  181. snappy/geometric_structure/cusp_neighborhood/cusp_cross_section_base.py +484 -0
  182. snappy/geometric_structure/cusp_neighborhood/exceptions.py +42 -0
  183. snappy/geometric_structure/cusp_neighborhood/real_cusp_cross_section.py +298 -0
  184. snappy/geometric_structure/cusp_neighborhood/tiles_for_cusp_neighborhood.py +159 -0
  185. snappy/geometric_structure/cusp_neighborhood/vertices.py +32 -0
  186. snappy/geometric_structure/geodesic/__init__.py +0 -0
  187. snappy/geometric_structure/geodesic/add_core_curves.py +152 -0
  188. snappy/geometric_structure/geodesic/avoid_core_curves.py +369 -0
  189. snappy/geometric_structure/geodesic/canonical_keys.py +52 -0
  190. snappy/geometric_structure/geodesic/check_away_from_core_curve.py +60 -0
  191. snappy/geometric_structure/geodesic/constants.py +6 -0
  192. snappy/geometric_structure/geodesic/exceptions.py +22 -0
  193. snappy/geometric_structure/geodesic/fixed_points.py +93 -0
  194. snappy/geometric_structure/geodesic/geodesic_start_point_info.py +435 -0
  195. snappy/geometric_structure/geodesic/graph_trace_helper.py +67 -0
  196. snappy/geometric_structure/geodesic/line.py +30 -0
  197. snappy/geometric_structure/geodesic/multiplicity.py +127 -0
  198. snappy/geometric_structure/geodesic/tiles_for_geodesic.py +101 -0
  199. snappy/geometric_structure/test.py +22 -0
  200. snappy/gui.py +36 -36
  201. snappy/horoviewer.py +50 -48
  202. snappy/hyperboloid/__init__.py +212 -0
  203. snappy/hyperboloid/distances.py +245 -0
  204. snappy/hyperboloid/horoball.py +19 -0
  205. snappy/hyperboloid/line.py +35 -0
  206. snappy/hyperboloid/point.py +9 -0
  207. snappy/hyperboloid/triangle.py +29 -0
  208. snappy/{infodialog.py → infowindow.py} +32 -33
  209. snappy/isometry_signature.py +382 -0
  210. snappy/len_spec/__init__.py +596 -0
  211. snappy/len_spec/geodesic_info.py +110 -0
  212. snappy/len_spec/geodesic_key_info_dict.py +117 -0
  213. snappy/len_spec/geodesic_piece.py +143 -0
  214. snappy/len_spec/geometric_structure.py +182 -0
  215. snappy/len_spec/geometry.py +80 -0
  216. snappy/len_spec/length_spectrum_geodesic_info.py +170 -0
  217. snappy/len_spec/spine.py +206 -0
  218. snappy/len_spec/test.py +24 -0
  219. snappy/len_spec/test_cases.py +69 -0
  220. snappy/len_spec/tile.py +275 -0
  221. snappy/len_spec/word.py +86 -0
  222. snappy/manifolds/__init__.py +1 -1
  223. snappy/math_basics.py +176 -0
  224. snappy/matrix.py +525 -0
  225. snappy/number.py +97 -21
  226. snappy/numeric_output_checker.py +37 -27
  227. snappy/pari.py +30 -69
  228. snappy/phone_home.py +25 -20
  229. snappy/polyviewer.py +39 -37
  230. snappy/ptolemy/__init__.py +4 -6
  231. snappy/ptolemy/component.py +14 -12
  232. snappy/ptolemy/coordinates.py +312 -295
  233. snappy/ptolemy/fieldExtensions.py +14 -12
  234. snappy/ptolemy/findLoops.py +43 -31
  235. snappy/ptolemy/geometricRep.py +24 -26
  236. snappy/ptolemy/homology.py +12 -7
  237. snappy/ptolemy/manifoldMethods.py +69 -70
  238. snappy/ptolemy/matrix.py +65 -26
  239. snappy/ptolemy/numericalSolutionsToGroebnerBasis.py +18 -14
  240. snappy/ptolemy/polynomial.py +125 -119
  241. snappy/ptolemy/processComponents.py +36 -30
  242. snappy/ptolemy/processFileBase.py +79 -18
  243. snappy/ptolemy/processFileDispatch.py +13 -14
  244. snappy/ptolemy/processMagmaFile.py +44 -39
  245. snappy/ptolemy/processRurFile.py +18 -11
  246. snappy/ptolemy/ptolemyGeneralizedObstructionClass.py +20 -17
  247. snappy/ptolemy/ptolemyObstructionClass.py +13 -17
  248. snappy/ptolemy/ptolemyVariety.py +190 -121
  249. snappy/ptolemy/ptolemyVarietyPrimeIdealGroebnerBasis.py +20 -19
  250. snappy/ptolemy/reginaWrapper.py +25 -29
  251. snappy/ptolemy/rur.py +6 -14
  252. snappy/ptolemy/solutionsToPrimeIdealGroebnerBasis.py +27 -22
  253. snappy/ptolemy/test.py +247 -188
  254. snappy/ptolemy/utilities.py +41 -43
  255. snappy/raytracing/__init__.py +64 -0
  256. snappy/raytracing/additional_horospheres.py +64 -0
  257. snappy/raytracing/additional_len_spec_choices.py +63 -0
  258. snappy/raytracing/cohomology_fractal.py +10 -6
  259. snappy/raytracing/eyeball.py +123 -0
  260. snappy/raytracing/finite_raytracing_data.py +48 -38
  261. snappy/raytracing/finite_viewer.py +218 -210
  262. snappy/raytracing/geodesic_tube_info.py +174 -0
  263. snappy/raytracing/geodesics.py +246 -0
  264. snappy/raytracing/geodesics_window.py +258 -0
  265. snappy/raytracing/gui_utilities.py +152 -40
  266. snappy/raytracing/hyperboloid_navigation.py +102 -52
  267. snappy/raytracing/hyperboloid_utilities.py +114 -261
  268. snappy/raytracing/ideal_raytracing_data.py +256 -179
  269. snappy/raytracing/inside_viewer.py +522 -253
  270. snappy/raytracing/pack.py +22 -0
  271. snappy/raytracing/raytracing_data.py +46 -34
  272. snappy/raytracing/raytracing_view.py +190 -109
  273. snappy/raytracing/shaders/Eye.png +0 -0
  274. snappy/raytracing/shaders/NonGeometric.png +0 -0
  275. snappy/raytracing/shaders/__init__.py +60 -4
  276. snappy/raytracing/shaders/fragment.glsl +575 -148
  277. snappy/raytracing/test.py +29 -0
  278. snappy/raytracing/tooltip.py +146 -0
  279. snappy/raytracing/upper_halfspace_utilities.py +98 -0
  280. snappy/raytracing/view_scale_controller.py +98 -0
  281. snappy/raytracing/zoom_slider/__init__.py +32 -29
  282. snappy/raytracing/zoom_slider/test.py +2 -0
  283. snappy/sage_helper.py +69 -123
  284. snappy/{preferences.py → settings.py} +167 -145
  285. snappy/shell.py +4 -0
  286. snappy/snap/__init__.py +12 -8
  287. snappy/snap/character_varieties.py +24 -18
  288. snappy/snap/find_field.py +35 -34
  289. snappy/snap/fundamental_polyhedron.py +99 -85
  290. snappy/snap/generators.py +6 -8
  291. snappy/snap/interval_reps.py +18 -6
  292. snappy/snap/kernel_structures.py +8 -3
  293. snappy/snap/mcomplex_base.py +1 -2
  294. snappy/snap/nsagetools.py +107 -53
  295. snappy/snap/peripheral/__init__.py +1 -1
  296. snappy/snap/peripheral/dual_cellulation.py +15 -7
  297. snappy/snap/peripheral/link.py +20 -16
  298. snappy/snap/peripheral/peripheral.py +22 -14
  299. snappy/snap/peripheral/surface.py +47 -50
  300. snappy/snap/peripheral/test.py +8 -8
  301. snappy/snap/polished_reps.py +65 -40
  302. snappy/snap/shapes.py +41 -22
  303. snappy/snap/slice_obs_HKL.py +64 -25
  304. snappy/snap/t3mlite/arrow.py +88 -51
  305. snappy/snap/t3mlite/corner.py +5 -6
  306. snappy/snap/t3mlite/edge.py +32 -21
  307. snappy/snap/t3mlite/face.py +7 -9
  308. snappy/snap/t3mlite/files.py +31 -23
  309. snappy/snap/t3mlite/homology.py +14 -10
  310. snappy/snap/t3mlite/linalg.py +158 -56
  311. snappy/snap/t3mlite/mcomplex.py +739 -291
  312. snappy/snap/t3mlite/perm4.py +236 -84
  313. snappy/snap/t3mlite/setup.py +9 -10
  314. snappy/snap/t3mlite/simplex.py +65 -48
  315. snappy/snap/t3mlite/spun.py +42 -30
  316. snappy/snap/t3mlite/surface.py +45 -45
  317. snappy/snap/t3mlite/test.py +3 -0
  318. snappy/snap/t3mlite/test_vs_regina.py +17 -13
  319. snappy/snap/t3mlite/tetrahedron.py +25 -24
  320. snappy/snap/t3mlite/vertex.py +8 -13
  321. snappy/snap/test.py +45 -52
  322. snappy/snap/utilities.py +66 -65
  323. snappy/test.py +155 -158
  324. snappy/test_cases.py +263 -0
  325. snappy/testing.py +131 -0
  326. snappy/tiling/__init__.py +2 -0
  327. snappy/tiling/canonical_key_dict.py +59 -0
  328. snappy/tiling/dict_based_set.py +79 -0
  329. snappy/tiling/floor.py +49 -0
  330. snappy/tiling/hyperboloid_dict.py +54 -0
  331. snappy/tiling/iter_utils.py +78 -0
  332. snappy/tiling/lifted_tetrahedron.py +22 -0
  333. snappy/tiling/lifted_tetrahedron_set.py +54 -0
  334. snappy/tiling/real_hash_dict.py +164 -0
  335. snappy/tiling/test.py +23 -0
  336. snappy/tiling/tile.py +215 -0
  337. snappy/tiling/triangle.py +33 -0
  338. snappy/tkterminal.py +313 -203
  339. snappy/twister/main.py +1 -8
  340. snappy/twister/twister_core.cpython-38-darwin.so +0 -0
  341. snappy/upper_halfspace/__init__.py +146 -0
  342. snappy/upper_halfspace/ideal_point.py +26 -0
  343. snappy/verify/__init__.py +4 -8
  344. snappy/verify/{verifyCanonical.py → canonical.py} +114 -97
  345. snappy/verify/complex_volume/__init__.py +3 -2
  346. snappy/verify/complex_volume/adjust_torsion.py +13 -11
  347. snappy/verify/complex_volume/closed.py +29 -24
  348. snappy/verify/complex_volume/compute_ptolemys.py +8 -6
  349. snappy/verify/complex_volume/cusped.py +10 -9
  350. snappy/verify/complex_volume/extended_bloch.py +14 -12
  351. snappy/verify/{cuspTranslations.py → cusp_translations.py} +15 -14
  352. snappy/verify/edge_equations.py +80 -0
  353. snappy/verify/exceptions.py +23 -56
  354. snappy/verify/{verifyHyperbolicity.py → hyperbolicity.py} +19 -15
  355. snappy/verify/interval_newton_shapes_engine.py +51 -211
  356. snappy/verify/interval_tree.py +27 -25
  357. snappy/verify/krawczyk_shapes_engine.py +47 -50
  358. snappy/verify/maximal_cusp_area_matrix/__init__.py +17 -86
  359. snappy/verify/maximal_cusp_area_matrix/cusp_tiling_engine.py +58 -48
  360. snappy/verify/maximal_cusp_area_matrix/cusp_translate_engine.py +53 -57
  361. snappy/verify/{realAlgebra.py → real_algebra.py} +26 -20
  362. snappy/verify/shapes.py +10 -7
  363. snappy/verify/short_slopes.py +41 -42
  364. snappy/verify/{squareExtensions.py → square_extensions.py} +96 -92
  365. snappy/verify/test.py +59 -57
  366. snappy/verify/upper_halfspace/extended_matrix.py +5 -5
  367. snappy/verify/upper_halfspace/finite_point.py +44 -31
  368. snappy/verify/upper_halfspace/ideal_point.py +69 -57
  369. snappy/verify/volume.py +15 -12
  370. snappy/version.py +2 -3
  371. {snappy-3.0.3.dist-info → snappy-3.2.dist-info}/METADATA +14 -12
  372. snappy-3.2.dist-info/RECORD +503 -0
  373. {snappy-3.0.3.dist-info → snappy-3.2.dist-info}/WHEEL +1 -1
  374. {snappy-3.0.3.dist-info → snappy-3.2.dist-info}/entry_points.txt +0 -1
  375. {snappy-3.0.3.dist-info → snappy-3.2.dist-info}/top_level.txt +10 -1
  376. snappy/doc/_sources/verify_canon.rst.txt +0 -90
  377. snappy/doc/_static/classic.css +0 -266
  378. snappy/doc/_static/jquery-3.5.1.js +0 -10872
  379. snappy/doc/_static/sidebar.js +0 -159
  380. snappy/doc/_static/underscore-1.13.1.js +0 -2042
  381. snappy/doc/_static/underscore.js +0 -6
  382. snappy/doc/verify_canon.html +0 -283
  383. snappy/ppm_to_png.py +0 -243
  384. snappy/togl/__init__.py +0 -3
  385. snappy/togl/darwin-tk8.6/Togl2.1/LICENSE +0 -28
  386. snappy/togl/darwin-tk8.6/Togl2.1/libTogl2.1.dylib +0 -0
  387. snappy/togl/darwin-tk8.6/Togl2.1/pkgIndex.tcl +0 -5
  388. snappy/togl/linux2-x86_64-tk8.6/Togl2.1/LICENSE +0 -28
  389. snappy/togl/linux2-x86_64-tk8.6/Togl2.1/libTogl2.1.so +0 -0
  390. snappy/togl/linux2-x86_64-tk8.6/Togl2.1/pkgIndex.tcl +0 -5
  391. snappy/togl/win32VC-tk8.6/Togl2.1/LICENSE +0 -28
  392. snappy/togl/win32VC-tk8.6/Togl2.1/Togl21.dll +0 -0
  393. snappy/togl/win32VC-tk8.6/Togl2.1/Togl21.lib +0 -0
  394. snappy/togl/win32VC-tk8.6/Togl2.1/pkgIndex.tcl +0 -6
  395. snappy/togl/win32VC-x86_64-tk8.6/Togl2.1/LICENSE +0 -28
  396. snappy/togl/win32VC-x86_64-tk8.6/Togl2.1/Togl21.dll +0 -0
  397. snappy/togl/win32VC-x86_64-tk8.6/Togl2.1/Togl21.lib +0 -0
  398. snappy/togl/win32VC-x86_64-tk8.6/Togl2.1/pkgIndex.tcl +0 -6
  399. snappy/verify/cuspCrossSection.py +0 -1413
  400. snappy/verify/mathHelpers.py +0 -64
  401. snappy-3.0.3.dist-info/RECORD +0 -360
snappy/ptolemy/test.py CHANGED
@@ -1,32 +1,37 @@
1
- from __future__ import print_function
2
- ### Tests the ptolemy module
1
+ # Tests the ptolemy module
3
2
  ###
4
- ### Test in sage with precomputed results in testing_files_directory:
5
- ### sage -python test.py
3
+ # Test in sage with precomputed results in testing_files_directory:
4
+ # sage -python test.py
6
5
  ###
7
- ### Test in python with precomputed results:
8
- ### python test.py
6
+ # Test in python with precomputed results:
7
+ # python test.py
9
8
  ###
10
- ### Test in sage computing the results:
11
- ### sage -python test.py --compute
9
+ # Test in sage computing the results:
10
+ # sage -python test.py --compute
12
11
  ###
13
- ### Test in python computing the results using magma:
14
- ### python test.py --compute
12
+ # Test in python computing the results using magma:
13
+ # python test.py --compute
15
14
 
16
15
  from snappy import Manifold, pari, ptolemy
16
+ from snappy import ptolemy
17
17
  from snappy.ptolemy import solutions_from_magma, Flattenings, parse_solutions
18
18
  from snappy.ptolemy.processFileBase import get_manifold
19
19
  from snappy.ptolemy import __path__ as ptolemy_paths
20
20
  from snappy.ptolemy.coordinates import PtolemyCannotBeCheckedError
21
- from snappy.sage_helper import _within_sage, doctest_modules
21
+ from snappy.sage_helper import _within_sage
22
+ from snappy.testing import doctest_modules
22
23
  from snappy.pari import pari
23
24
  import bz2
24
- import os, sys
25
+ import os
26
+ import sys
27
+ import doctest
28
+ import traceback
25
29
 
26
30
  if _within_sage:
27
31
  from sage.misc.sage_eval import sage_eval
28
32
 
29
33
  test_regina = '--regina' in sys.argv
34
+ compute_solutions = '--compute' in sys.argv
30
35
 
31
36
  base_path = ptolemy_paths[0]
32
37
  if test_regina:
@@ -50,9 +55,10 @@ else:
50
55
 
51
56
  vol_tet = pari('1.014941606409653625021202554274520285941689307530299792017489106776597476258244022136470354228256695')
52
57
 
58
+
53
59
  def check_volumes(complex_volumes, baseline_complex_volumes,
54
- check_real_part_only = False,
55
- torsion_imaginary_part = 6, epsilon = 1e-80):
60
+ check_real_part_only=False,
61
+ torsion_imaginary_part=6, epsilon=1e-80):
56
62
 
57
63
  # add complex volumes from complex conjugation to baseline
58
64
 
@@ -79,8 +85,7 @@ def check_volumes(complex_volumes, baseline_complex_volumes,
79
85
  # check that every base line volume appears in computed volumes
80
86
  for cvol1 in baseline_complex_volumes:
81
87
 
82
- if not True in [
83
- is_close(cvol1, cvol2) for cvol2 in complex_volumes]:
88
+ if not any(is_close(cvol1, cvol2) for cvol2 in complex_volumes):
84
89
  print("Missing base line volume:", cvol1)
85
90
 
86
91
  print("Volumes:")
@@ -91,19 +96,20 @@ def check_volumes(complex_volumes, baseline_complex_volumes,
91
96
 
92
97
  # check that every computed volume is a base line volume
93
98
  for cvol2 in complex_volumes:
94
- if not True in [
95
- is_close(cvol1, cvol2) for cvol1 in baseline_complex_volumes]:
99
+ if not any(is_close(cvol1, cvol2)
100
+ for cvol1 in baseline_complex_volumes):
96
101
  print("Extra volume:", cvol2)
97
-
102
+
98
103
  print("Volumes:")
99
104
  for i in complex_volumes:
100
105
  print(" ", i)
101
-
106
+
102
107
  raise Exception
103
108
 
104
- def testSolutionsForManifold(M, N, solutions, baseline_cvolumes = None,
105
- expect_non_zero_dimensional = None,
106
- against_geometric = True):
109
+
110
+ def testSolutionsForManifold(M, N, solutions, baseline_cvolumes=None,
111
+ expect_non_zero_dimensional=None,
112
+ against_geometric=True):
107
113
 
108
114
  old_precision = pari.set_real_precision(100)
109
115
 
@@ -135,14 +141,14 @@ def testSolutionsForManifold(M, N, solutions, baseline_cvolumes = None,
135
141
  for numerical_solution in solution.numerical():
136
142
  numerical_solutions.append(numerical_solution)
137
143
  numerical_cross_ratios.append(numerical_solution.cross_ratios())
138
-
144
+
139
145
  # check exact cross ratios
140
146
  cross_ratios = solution.cross_ratios()
141
147
  if not test_regina:
142
148
  cross_ratios.check_against_manifold(M)
143
149
 
144
150
  assert cross_ratios.N() == N
145
-
151
+
146
152
  # compute numerical cross ratios alternatively
147
153
  # (above we converted exact Ptolemy's to numerical and then
148
154
  # converted to cross ratio, here we first compute cross ratios
@@ -151,23 +157,23 @@ def testSolutionsForManifold(M, N, solutions, baseline_cvolumes = None,
151
157
 
152
158
  # check we encountered non-zero dimensional component if that's
153
159
  # expected
154
- if not expect_non_zero_dimensional is None:
160
+ if expect_non_zero_dimensional is not None:
155
161
  assert expect_non_zero_dimensional == found_non_zero_dimensional
156
162
 
157
163
  # check the numerical solutions against the manifold
158
164
  for s in numerical_solutions:
159
- s.check_against_manifold(M, epsilon = 1e-80)
165
+ s.check_against_manifold(M, epsilon=1e-80)
160
166
 
161
167
  # check that they make a flattening
162
168
  if not test_regina:
163
- s.flattenings_numerical().check_against_manifold(M, epsilon = 1e-80)
169
+ s.flattenings_numerical().check_against_manifold(M, epsilon=1e-80)
164
170
 
165
171
  if not test_regina:
166
172
  for s in numerical_cross_ratios:
167
- s.check_against_manifold(M, epsilon = 1e-80)
173
+ s.check_against_manifold(M, epsilon=1e-80)
168
174
 
169
175
  for s in numerical_cross_ratios_alt:
170
- s.check_against_manifold(M, epsilon = 1e-80)
176
+ s.check_against_manifold(M, epsilon=1e-80)
171
177
 
172
178
  # compute complex volumes and volumes
173
179
  complex_volumes = [s.complex_volume_numerical() for s in numerical_solutions]
@@ -186,8 +192,8 @@ def testSolutionsForManifold(M, N, solutions, baseline_cvolumes = None,
186
192
 
187
193
  # volumes should be equal
188
194
  assert len(volumes) == len(volumes_alt)
189
- volumes.sort(key = float)
190
- volumes_alt.sort(key = float)
195
+ volumes.sort(key=float)
196
+ volumes_alt.sort(key=float)
191
197
  for vol1, vol2 in zip(volumes, volumes_alt):
192
198
  assert (vol1 - vol2).abs() < 1e-80
193
199
 
@@ -198,17 +204,19 @@ def testSolutionsForManifold(M, N, solutions, baseline_cvolumes = None,
198
204
  abs(geom_vol - vol) < 1e-11 for vol in volumes]
199
205
 
200
206
  # check that complex volumes match baseline volumes
201
- if not baseline_cvolumes is None:
207
+ if baseline_cvolumes is not None:
202
208
  check_volumes(complex_volumes, baseline_cvolumes)
203
209
 
204
210
  pari.set_real_precision(old_precision)
205
211
 
206
- def testComputeSolutionsForManifold(manifold, N,
207
- compute_solutions = False,
208
- baseline_cvolumes = None,
209
- expect_non_zero_dimensional = None):
210
212
 
211
- varieties = manifold.ptolemy_variety(N, obstruction_class = "all_original")
213
+ def testComputeSolutionsForManifold(manifold, N,
214
+ compute_solutions=False,
215
+ baseline_cvolumes=None,
216
+ expect_non_zero_dimensional=None,
217
+ print_info=True):
218
+
219
+ varieties = manifold.ptolemy_variety(N, obstruction_class="all_original")
212
220
 
213
221
  if compute_solutions:
214
222
  def compute(variety):
@@ -220,14 +228,15 @@ def testComputeSolutionsForManifold(manifold, N,
220
228
 
221
229
  solutions = sum([compute(variety) for variety in varieties], [])
222
230
 
223
- testSolutionsForManifold(manifold, N, solutions,
231
+ testSolutionsForManifold(manifold, N, solutions,
224
232
  baseline_cvolumes, expect_non_zero_dimensional)
225
233
 
226
234
  if manifold.name() == 't00000':
227
- testMatrixMethods(manifold, solutions)
235
+ testMatrixMethods(manifold, solutions, print_info=print_info)
236
+
237
+
238
+ def testMatrixMethods(manifold, solutions, print_info=True):
228
239
 
229
- def testMatrixMethods(manifold, solutions):
230
-
231
240
  def matrix_is_diagonal(m):
232
241
  return (
233
242
  m[0][0] - m[1][1] == 0 and
@@ -238,14 +247,15 @@ def testMatrixMethods(manifold, solutions):
238
247
  return matrix_is_diagonal(m) and (
239
248
  m[0][0] + 1 == 0 or m[0][0] - 1 == 0)
240
249
 
241
- print("Testing matrix methods...")
250
+ if print_info:
251
+ print("Testing matrix methods...")
242
252
 
243
- G = manifold.fundamental_group(simplify_presentation = True)
244
- Graw = manifold.fundamental_group(simplify_presentation = False)
253
+ G = manifold.fundamental_group(simplify_presentation=True)
254
+ Graw = manifold.fundamental_group(simplify_presentation=False)
245
255
 
246
256
  for solution in solutions:
247
257
  if solution.dimension == 0:
248
-
258
+
249
259
  solution._testing_check_cocycles()
250
260
 
251
261
  cross_ratios = solution.cross_ratios()
@@ -281,7 +291,7 @@ def testMatrixMethods(manifold, solutions):
281
291
  solution.evaluate_word(rel))
282
292
  assert matrix_is_diagonal(
283
293
  solution.evaluate_word(rel))
284
-
294
+
285
295
 
286
296
  def test_flattenings_from_tetrahedra_shapes_of_manifold():
287
297
 
@@ -299,46 +309,52 @@ def test_flattenings_from_tetrahedra_shapes_of_manifold():
299
309
 
300
310
  from snappy import OrientableCuspedCensus
301
311
 
302
- for M in (list(OrientableCuspedCensus()[0:10])+
303
- list(OrientableCuspedCensus()[10000:10010])):
312
+ for M_database in (list(OrientableCuspedCensus()[0:10]) +
313
+ list(OrientableCuspedCensus()[10000:10010])):
314
+
315
+ # The manifold returned by OrientableCuspedCensus is
316
+ # a SnapPy.Manifold, not a snappy.Manifold (as is overridden
317
+ # in python/test.py).
318
+ M = Manifold(M_database)
304
319
 
305
320
  flattening = Flattenings.from_tetrahedra_shapes_of_manifold(M)
306
- flattening.check_against_manifold(M, epsilon = 1e-80)
321
+ flattening.check_against_manifold(M, epsilon=1e-80)
307
322
 
308
323
  if not is_close(flattening.complex_volume(),
309
324
  M.complex_volume(), # returns only double precision
310
- epsilon = 1e-13):
325
+ epsilon=1e-13):
311
326
  raise Exception("Wrong volume")
312
-
327
+
313
328
  # test high precision
314
329
 
315
330
  M = ManifoldGetter("5_2")
316
331
  flattening = Flattenings.from_tetrahedra_shapes_of_manifold(M)
317
- flattening.check_against_manifold(M, epsilon = 1e-80)
332
+ flattening.check_against_manifold(M, epsilon=1e-80)
318
333
 
319
334
  if not is_close(flattening.complex_volume(),
320
335
  pari('2.828122088330783162763898809276634942770981317300649477043520327258802548322471630936947017929999108 - 3.024128376509301659719951221694600993984450242270735312503300643508917708286193746506469158300472966*I'),
321
- epsilon = 1e-80):
336
+ epsilon=1e-80):
322
337
  raise Exception("Wrong volume")
323
338
 
324
339
  pari.set_real_precision(old_precision)
325
340
 
341
+
326
342
  def checkSolutionsForManifoldGeneralizedObstructionClass(
327
343
  solutions_trivial, solutions_non_trivial,
328
344
  manifold, N, baseline_volumes, baseline_dimensions):
329
345
 
330
346
  torsionTrivial = pari('Pi^2/6 * I')
331
347
  torsionNonTrivial = pari('Pi^2/18 * I')
332
-
348
+
333
349
  solutions = (
334
350
  [ (s, False) for s in solutions_trivial ] +
335
- [ (s, True) for s in solutions_non_trivial ])
351
+ [ (s, True) for s in solutions_non_trivial ])
336
352
 
337
353
  # Dimensions and volumes encountered
338
354
  dimensions = set()
339
355
  volumes = []
340
356
  volumes_2 = []
341
-
357
+
342
358
  for solution, sol_is_non_trivial in solutions:
343
359
  # Add the dimension
344
360
  dimensions.add(solution.dimension)
@@ -350,19 +366,19 @@ def checkSolutionsForManifoldGeneralizedObstructionClass(
350
366
  solution.check_against_manifold(manifold)
351
367
  except PtolemyCannotBeCheckedError:
352
368
  got_exception = True
353
-
369
+
354
370
  assert got_exception, (
355
371
  "check_against_manifold should not have passed")
356
372
  else:
357
373
  solution.check_against_manifold(manifold)
358
-
374
+
359
375
  fl = solution.flattenings_numerical()
360
376
  for f in fl:
361
377
  if not test_regina:
362
378
  # Not supported yet in regina
363
- f.check_against_manifold(epsilon = 1e-80)
379
+ f.check_against_manifold(epsilon=1e-80)
364
380
 
365
- cvol, modulo = f.complex_volume(with_modulo = True)
381
+ cvol, modulo = f.complex_volume(with_modulo=True)
366
382
 
367
383
  if sol_is_non_trivial and N == 3:
368
384
  assert (modulo - torsionNonTrivial).abs() < 1e-80, (
@@ -375,7 +391,7 @@ def checkSolutionsForManifoldGeneralizedObstructionClass(
375
391
 
376
392
  # Add the volumes
377
393
  volumes += solution.volume_numerical()
378
-
394
+
379
395
  # Check that the resulting cross ratios full fill
380
396
  # the gluing equations
381
397
  cross_ratios = solution.cross_ratios()
@@ -388,12 +404,12 @@ def checkSolutionsForManifoldGeneralizedObstructionClass(
388
404
  def make_unique(L):
389
405
  L.sort()
390
406
  result = L[:1]
391
-
407
+
392
408
  for i in L:
393
409
  if not is_close(result[-1], i):
394
410
  result.append(i)
395
411
  return result
396
-
412
+
397
413
  volumes = make_unique(volumes)
398
414
  volumes_2 = make_unique(volumes_2)
399
415
  all_expected_volumes = make_unique(baseline_volumes +
@@ -409,15 +425,16 @@ def checkSolutionsForManifoldGeneralizedObstructionClass(
409
425
 
410
426
  assert dimensions == set(baseline_dimensions)
411
427
 
428
+
412
429
  def testComputeSolutionsForManifoldGeneralizedObstructionClass(
413
430
  manifold, N, compute_solutions, baseline_volumes, baseline_dimensions):
414
431
 
415
432
  varieties = manifold.ptolemy_variety(N,
416
- obstruction_class = "all_generalized"
417
- #, simplify = False
418
- #, eliminate_fixed_ptolemys = True
433
+ obstruction_class="all_generalized"
434
+ # , simplify = False
435
+ # , eliminate_fixed_ptolemys = True
419
436
  )
420
-
437
+
421
438
  assert len(varieties) == 2
422
439
 
423
440
  if compute_solutions:
@@ -427,11 +444,11 @@ def testComputeSolutionsForManifoldGeneralizedObstructionClass(
427
444
  else:
428
445
  def compute(variety):
429
446
  return compute_using_precomputed_magma(
430
- variety, dir = testing_files_generalized_directory)
447
+ variety, dir=testing_files_generalized_directory)
431
448
 
432
449
  # Solutions for the trivial obstruction class
433
450
  solutions_trivial = compute(varieties[0])
434
-
451
+
435
452
  # Solutions for the non-trivial obstruction class
436
453
  solutions_non_trivial = sum([compute(variety)
437
454
  for variety in varieties[1:]],
@@ -441,7 +458,8 @@ def testComputeSolutionsForManifoldGeneralizedObstructionClass(
441
458
  solutions_trivial, solutions_non_trivial,
442
459
  manifold, N, baseline_volumes, baseline_dimensions)
443
460
 
444
- def testGeneralizedObstructionClass(compute_solutions):
461
+
462
+ def testGeneralizedObstructionClass(compute_solutions, print_info = True):
445
463
 
446
464
  vols = [
447
465
  pari('0'),
@@ -478,16 +496,18 @@ def testGeneralizedObstructionClass(compute_solutions):
478
496
 
479
497
  for manifold, N, vols, dims in test_cases:
480
498
 
481
- print("Checking for", manifold.name(), "N = %d" % N)
499
+ if print_info:
500
+ print("Checking for", manifold.name(), "N = %d" % N)
482
501
 
483
502
  testComputeSolutionsForManifoldGeneralizedObstructionClass(
484
503
  manifold, N, compute_solutions, vols, dims)
485
504
 
505
+
486
506
  def testMapleLikeRur():
487
-
507
+
488
508
  M = ManifoldGetter("m052")
489
509
  p = M.ptolemy_variety(3, 0)
490
-
510
+
491
511
  sols = parse_solutions(
492
512
  bz2.BZ2File(os.path.join(testing_files_rur_directory,
493
513
  p.filename_base() + '.rur.bz2'),
@@ -515,11 +535,11 @@ def testMapleLikeRur():
515
535
 
516
536
  old_precision = pari.set_real_precision(60)
517
537
 
518
- sols.numerical().check_against_manifold(epsilon = 1e-50)
519
- sols.numerical().cross_ratios().check_against_manifold(epsilon = 1e-50)
520
- cross_ratios.numerical().check_against_manifold(epsilon = 1e-50)
521
- sol_pur.numerical().check_against_manifold(epsilon = 1e-50)
522
- cross_ratio_pur.numerical().check_against_manifold(epsilon = 1e-50)
538
+ sols.numerical().check_against_manifold(epsilon=1e-50)
539
+ sols.numerical().cross_ratios().check_against_manifold(epsilon=1e-50)
540
+ cross_ratios.numerical().check_against_manifold(epsilon=1e-50)
541
+ sol_pur.numerical().check_against_manifold(epsilon=1e-50)
542
+ cross_ratio_pur.numerical().check_against_manifold(epsilon=1e-50)
523
543
 
524
544
  expected_cvols = [
525
545
  pari('-0.78247122081308825152609555186377860994691907952043*I'),
@@ -557,12 +577,12 @@ def testMapleLikeRur():
557
577
 
558
578
  cvols = sols.complex_volume_numerical().flatten(2) # Include witnesses
559
579
 
560
- check_volumes(cvols, expected_cvols, epsilon = 1e-40)
580
+ check_volumes(cvols, expected_cvols, epsilon=1e-40)
561
581
 
562
582
  vols = sols.volume_numerical().flatten(2) # Include witnesses
563
583
 
564
- check_volumes(vols, expected_cvols, check_real_part_only = True, epsilon = 1e-40)
565
-
584
+ check_volumes(vols, expected_cvols, check_real_part_only=True, epsilon=1e-40)
585
+
566
586
  pari.set_real_precision(old_precision)
567
587
 
568
588
 
@@ -571,13 +591,13 @@ def testNumericalSolutions():
571
591
  M = ManifoldGetter("m003")
572
592
  N = 3
573
593
 
574
- varieties = M.ptolemy_variety(N, obstruction_class = 'all')
594
+ varieties = M.ptolemy_variety(N, obstruction_class='all')
575
595
 
576
- solutions = [
596
+ solutions = [
577
597
  solutions_from_magma(
578
598
  get_precomputed_magma(variety,
579
- dir = testing_files_generalized_directory),
580
- numerical = True)
599
+ dir=testing_files_generalized_directory),
600
+ numerical=True)
581
601
  for variety in varieties ]
582
602
 
583
603
  for obstruction_index, obstruction in enumerate(solutions):
@@ -585,7 +605,7 @@ def testNumericalSolutions():
585
605
  for solution in component:
586
606
  flattenings = solution.flattenings_numerical()
587
607
  if not test_regina:
588
- flattenings.check_against_manifold(epsilon = 1e-80)
608
+ flattenings.check_against_manifold(epsilon=1e-80)
589
609
  order = flattenings.get_order()
590
610
 
591
611
  if obstruction_index:
@@ -594,8 +614,8 @@ def testNumericalSolutions():
594
614
  assert order == 2
595
615
 
596
616
  cross_ratios = solution.cross_ratios()
597
- is_cr = cross_ratios.is_pu_2_1_representation(epsilon = 1e-80,
598
- epsilon2 = 1e-10)
617
+ is_cr = cross_ratios.is_pu_2_1_representation(epsilon=1e-80,
618
+ epsilon2=1e-10)
599
619
 
600
620
  if cross_ratios.volume_numerical().abs() < 1e-10:
601
621
  # Every volume 0 representation of m003 happens to be
@@ -612,7 +632,7 @@ def testNumericalSolutions():
612
632
  degree_dict = {}
613
633
 
614
634
  for component in allComponents:
615
-
635
+
616
636
  dim = component.dimension
617
637
  deg = len(component)
618
638
 
@@ -620,10 +640,10 @@ def testNumericalSolutions():
620
640
  degree_dict[deg] = 1 + degree_dict.get(deg, 0)
621
641
 
622
642
  assert (dim == 0) ^ (deg == 0)
623
-
643
+
624
644
  assert dimension_dict == {0: 4, 1: 2}
625
645
  assert degree_dict == {0 :2, 2: 2, 8: 2}
626
-
646
+
627
647
  allSolutions = sum(allComponents, [])
628
648
 
629
649
  allCVolumes = [s.complex_volume_numerical() for s in allSolutions]
@@ -639,53 +659,59 @@ def testNumericalSolutions():
639
659
 
640
660
  check_volumes(allCVolumes, expected_cvolumes)
641
661
 
642
- def testGeometricRep(compute_solutions):
643
-
662
+
663
+ def testGeometricRep(compute_solutions, print_info=False):
664
+
644
665
  from snappy.ptolemy import geometricRep
645
-
666
+
646
667
  M = Manifold("m019")
647
668
  if compute_solutions:
648
669
  sol = geometricRep.compute_geometric_solution(M)
649
670
  else:
650
671
  from urllib.request import pathname2url
651
672
  url = pathname2url(os.path.abspath(testing_files_directory))
652
- sol = geometricRep.retrieve_geometric_solution(M, data_url=url)
673
+ sol = geometricRep.retrieve_geometric_solution(
674
+ M, data_url=url, verbose = print_info)
653
675
 
654
676
  # Make sure this is of type Ptolemy
655
677
  sol['c_0011_2']
656
678
 
657
679
  assert any(
658
- [ abs(vol - 2.9441064867) < 1e-9 for vol in sol.volume_numerical()])
680
+ abs(vol - 2.9441064867) < 1e-9 for vol in sol.volume_numerical())
681
+
659
682
 
660
683
  def testSageCommandLine():
661
684
 
662
685
  sage_eval('Manifold("m004").ptolemy_variety(3,0).compute_solutions().check_against_manifold()',
663
686
  { 'Manifold' : ManifoldGetter })
664
-
687
+
688
+
665
689
  def get_precomputed_magma(variety, dir):
666
- magma_file_name = os.path.join(dir,
690
+ magma_file_name = os.path.join(dir,
667
691
  variety.filename_base() + '.magma_out.bz2')
668
692
  return bz2.BZ2File(magma_file_name,'r').read().decode('ascii')
669
693
 
670
- def compute_using_precomputed_magma(variety, dir = testing_files_directory):
694
+
695
+ def compute_using_precomputed_magma(variety, dir=testing_files_directory):
671
696
  return solutions_from_magma(get_precomputed_magma(variety, dir))
672
697
 
698
+
673
699
  def test_induced_representation():
674
700
 
675
701
  M = ManifoldGetter("m015")
676
- variety__sl2_c1 = M.ptolemy_variety(2, obstruction_class = 1)
677
- variety__sl3_c0 = M.ptolemy_variety(3, obstruction_class = 0)
702
+ variety__sl2_c1 = M.ptolemy_variety(2, obstruction_class=1)
703
+ variety__sl3_c0 = M.ptolemy_variety(3, obstruction_class=0)
678
704
 
679
705
  solutions__sl2_c1 = compute_using_precomputed_magma(
680
- variety__sl2_c1, dir = testing_files_generalized_directory)
706
+ variety__sl2_c1, dir=testing_files_generalized_directory)
681
707
  solutions__sl3_c0 = compute_using_precomputed_magma(
682
- variety__sl3_c0, dir = testing_files_generalized_directory)
708
+ variety__sl3_c0, dir=testing_files_generalized_directory)
709
+
710
+ # Check that is_real
683
711
 
684
- # Check that is_real
685
-
686
712
  got_exception = False
687
713
  try:
688
- solutions__sl3_c0[0].cross_ratios().is_real(epsilon = 1e-80)
714
+ solutions__sl3_c0[0].cross_ratios().is_real(epsilon=1e-80)
689
715
  except:
690
716
  got_exception = True
691
717
  assert got_exception, (
@@ -699,11 +725,11 @@ def test_induced_representation():
699
725
  number_real = 0
700
726
  number_all = 0
701
727
  for z in component.cross_ratios_numerical():
702
- if z.is_real(epsilon = 1e-80):
728
+ if z.is_real(epsilon=1e-80):
703
729
  number_real += 1
704
730
  number_all += 1
705
731
  numbers_all_and_real.append((number_all, number_real))
706
-
732
+
707
733
  # Bring into canonical form
708
734
  numbers_all_and_real.sort()
709
735
 
@@ -711,7 +737,7 @@ def test_induced_representation():
711
737
  (3, 1), # component has 3 solutions, 1 of them has real cross ratios
712
738
  (4, 2),
713
739
  (6, 0) ]
714
-
740
+
715
741
  assert numbers_all_and_real == expected_numbers, (
716
742
  "Order of components and number of real solutions is off")
717
743
 
@@ -728,16 +754,15 @@ def test_induced_representation():
728
754
  number_psl2 = 0
729
755
 
730
756
  for component in solutions__sl3_c0:
731
- is_induced_from_psl2 = [ z.is_induced_from_psl2(epsilon = 1e-80)
732
- for z in component.cross_ratios_numerical() ]
733
- if True in is_induced_from_psl2:
757
+ is_induced_from_psl2 = [z.is_induced_from_psl2(epsilon=1e-80)
758
+ for z in component.cross_ratios_numerical()]
759
+ if any(is_induced_from_psl2):
734
760
  number_psl2 += 1
735
- assert not False in is_induced_from_psl2, (
736
- "Mixed up is_induced_from_psl2")
761
+ assert all(is_induced_from_psl2), "Mixed up is_induced_from_psl2"
737
762
 
738
763
  assert number_psl2 == 1, (
739
764
  "Only one component can come from psl2 (numerically)")
740
-
765
+
741
766
  # Check that induced_representation for sl3 throws error
742
767
  got_exception = False
743
768
  try:
@@ -767,12 +792,13 @@ def test_induced_representation():
767
792
  assert v.abs() < 1e-80 or (v.abs() - 4 * m015_volume).abs() < 1e-80, (
768
793
  "Did not get expected voluem for induced representation")
769
794
 
795
+
770
796
  def test_induced_sl4_representation():
771
797
  M = Manifold("m004")
772
798
 
773
799
  z_gl2 = ptolemy.CrossRatios.from_snappy_manifold(M)
774
800
  z_gl4 = z_gl2.induced_representation(4)
775
-
801
+
776
802
  G = M.fundamental_group()
777
803
 
778
804
  mat = z_gl4.evaluate_word(G.relators()[0], G)
@@ -783,7 +809,7 @@ def test_induced_sl4_representation():
783
809
  assert abs(entry - 1) < 1e-9
784
810
  else:
785
811
  assert abs(entry) < 1e-9
786
-
812
+
787
813
 
788
814
  def test_num_obstruction_class_match():
789
815
  from snappy import OrientableCuspedCensus
@@ -796,79 +822,69 @@ def test_num_obstruction_class_match():
796
822
 
797
823
  for i in range(2,6):
798
824
  assert len(M.ptolemy_generalized_obstruction_classes(i)) == len(N.ptolemy_generalized_obstruction_classes(i))
799
-
800
- modules = [ptolemy.component, ptolemy.coordinates, ptolemy.manifoldMethods,
801
- ptolemy.matrix, ptolemy.polynomial, ptolemy.processMagmaFile,
802
- ptolemy.ptolemyObstructionClass, ptolemy.ptolemyVariety,
803
- ptolemy.ptolemyVariety, ptolemy.processFileBase, ptolemy.processRurFile,
804
- ptolemy.rur, ptolemy.utilities]
805
- if test_regina:
806
- modules.append(ptolemy.reginaWrapper)
807
825
 
808
- def run_doctests(verbose=False, print_info=True):
809
- return doctest_modules(modules, verbose, print_info)
826
+ def run_ptolemy_tests_raising_exceptions(print_info=True):
827
+ if print_info:
828
+ print("Testing in sage:", _within_sage)
810
829
 
811
- def main(verbose=False, doctest=True):
812
- print("Testing in sage:", _within_sage)
813
-
814
- print("Testing in regina:", test_regina)
815
-
816
- if doctest:
817
- print("Running doctests...")
818
- run_doctests(verbose)
819
- print()
830
+ print("Testing in regina:", test_regina)
820
831
 
821
832
  if test_regina:
822
- print("Testing that regina agrees with snappy obstruction classes")
833
+ if print_info:
834
+ print("Testing that regina agrees with snappy obstruction classes")
823
835
  test_num_obstruction_class_match()
824
836
 
825
837
  if not test_regina:
826
- print("Testing Flattenings.from_tetrahedra_shapes_of_manifold...")
838
+ if print_info:
839
+ print("Testing Flattenings.from_tetrahedra_shapes_of_manifold...")
827
840
 
828
841
  test_flattenings_from_tetrahedra_shapes_of_manifold()
829
842
 
830
- compute_solutions = False
831
-
832
- if '--compute' in sys.argv:
833
- compute_solutions = True
834
-
835
843
  if test_regina and not compute_solutions:
836
844
  print("regina testing requires --compute")
837
845
  sys.exit(1)
838
-
846
+
839
847
  old_precision = pari.set_real_precision(100)
840
848
 
841
- print("Testing induced representation...")
849
+ if print_info:
850
+ print("Testing induced representation...")
842
851
 
843
852
  test_induced_representation()
844
853
 
845
- print("Testing induced SL(4,C) representation...")
854
+ if print_info:
855
+ print("Testing induced SL(4,C) representation...")
846
856
 
847
857
  test_induced_sl4_representation()
848
858
 
849
- print("Running manifold tests for generalized obstruction class...")
859
+ if print_info:
860
+ print("Running manifold tests for generalized obstruction class...")
850
861
 
851
- testGeneralizedObstructionClass(compute_solutions)
862
+ testGeneralizedObstructionClass(compute_solutions, print_info=print_info)
852
863
 
853
864
  if not test_regina:
854
- print("Testing RUR for m052__sl3_c0.rur")
865
+ if print_info:
866
+ print("Testing RUR for m052__sl3_c0.rur")
855
867
 
856
868
  testMapleLikeRur()
857
869
 
858
- print("Testing numerical solution retrieval method...")
870
+ if print_info:
871
+ print("Testing numerical solution retrieval method...")
859
872
 
860
873
  testNumericalSolutions()
861
874
 
862
- print("Testing geometricRep...")
863
- testGeometricRep(compute_solutions)
875
+ if print_info:
876
+ print("Testing geometricRep...")
877
+ testGeometricRep(compute_solutions, print_info=print_info)
864
878
 
865
879
  if _within_sage:
866
- print("Testing in sage command line...")
880
+ if print_info:
881
+ print("Testing in sage command line...")
867
882
  testSageCommandLine()
868
883
 
869
- print("Running manifold tests...")
884
+ if print_info:
885
+ print("Running manifold tests...")
870
886
 
871
- ### Test for a non-hyperbolic manifold
887
+ # Test for a non-hyperbolic manifold
872
888
 
873
889
  cvols = [ # Expected Complex volumes
874
890
  pari('0') ]
@@ -877,7 +893,7 @@ def main(verbose=False, doctest=True):
877
893
  cvols, # expected complex volumes
878
894
  False) # No non-zero dimensional components
879
895
 
880
- ### Test for 4_1, amphichiral, expect zero CS
896
+ # Test for 4_1, amphichiral, expect zero CS
881
897
 
882
898
  cvols = [ # Expected Complex volumes
883
899
  2 * vol_tet
@@ -887,7 +903,7 @@ def main(verbose=False, doctest=True):
887
903
  cvols, # expected complex volumes
888
904
  False) # expect non-zero dimensional components
889
905
 
890
- ### N = 3
906
+ # N = 3
891
907
 
892
908
  cvols = [ # Expected Complex volumes
893
909
  pari(0),
@@ -898,7 +914,7 @@ def main(verbose=False, doctest=True):
898
914
  cvols, # expected complex volumes
899
915
  False) # expect non-zero dimensional components
900
916
 
901
- ### N = 4
917
+ # N = 4
902
918
 
903
919
  cvols = [ # Expected Complex volumes
904
920
  2 * 10 * vol_tet,
@@ -918,10 +934,9 @@ def main(verbose=False, doctest=True):
918
934
  cvols, # expected complex volumes
919
935
  True) # expect non-zero dimensional components
920
936
 
921
-
922
- ### Test for 5_2, expect non-trivial CS
923
- ### Number field has one real embedding with non-trival CS
924
- ### And one pair of complex embeddings with non-trivial CS
937
+ # Test for 5_2, expect non-trivial CS
938
+ # Number field has one real embedding with non-trival CS
939
+ # And one pair of complex embeddings with non-trivial CS
925
940
 
926
941
  cvols = [ # Expected Complex volumes
927
942
  pari('+ 1.113454552473924010022656943451126420312050780921075311799926598907813005362784871512051614741669817*I'),
@@ -932,8 +947,8 @@ def main(verbose=False, doctest=True):
932
947
  cvols, # expected complex volumes
933
948
  False) # expect no non-zero dimensional components
934
949
 
935
- ### m015 which is isometric to 5_2
936
- ### This example is also appearing on the website
950
+ # m015 which is isometric to 5_2
951
+ # This example is also appearing on the website
937
952
 
938
953
  cvols = [ # Expected Complex volumes
939
954
  pari('+ 0.4033353624187061319128390413376061001062613536896471642214173008084760853375773296525240139108027276*I'),
@@ -949,8 +964,8 @@ def main(verbose=False, doctest=True):
949
964
  cvols, # expected volumes
950
965
  False) # expect no non-zero dimensional components
951
966
 
952
- ### Test for m135
953
- ### Ptolemy Variety has one non-zero dimensional component
967
+ # Test for m135
968
+ # Ptolemy Variety has one non-zero dimensional component
954
969
 
955
970
  cvols = [ # Expected Complex volumes
956
971
  pari('3.66386237670887606021841405972953644309659749712668853706599247848705207910501907791742605170446042499429769047678479831614359521330343623772637894992 + 4.93480220054467930941724549993807556765684970362039531320667468811002241120960262150088670185927611591201295688701157203888617406101502336380530883900*I')
@@ -961,9 +976,9 @@ def main(verbose=False, doctest=True):
961
976
  cvols, # expected volumes
962
977
  True) # expect a non-zero dimensional component
963
978
 
964
- ### Test for s000
965
- ### Number field has one real embedding with non-trival CS
966
- ### And two complex embeddings with non-trivial CS
979
+ # Test for s000
980
+ # Number field has one real embedding with non-trival CS
981
+ # And two complex embeddings with non-trivial CS
967
982
 
968
983
  cvols = [ # Expected Complex volumes
969
984
  pari('3.296902414326637335562593088559162089146991699269941951875989849869324250860299302482577730785960256 + 0.4908671850777469648812718224097607532197026477625119178645010117072332396428578681905186509136879130*I'),
@@ -976,24 +991,23 @@ def main(verbose=False, doctest=True):
976
991
  cvols, # expected complex volumes
977
992
  False) # expect non-zero dimensional components
978
993
 
979
- ### Test for v0000
980
- ### This also tests the case of having more than one (here two)
981
- ### cusps
994
+ # Test for v0000
995
+ # This also tests the case of having more than one (here two)
996
+ # cusps
982
997
 
983
998
  cvols = [ # Expected Complex volumes
984
999
  pari('3.377597408231442496961257171798882829176020069714519460350380851901055794392493960110119513942153791 + 0.3441889979504813554136570264352067044809511501367282461849580661783699588789118851518262199077361427*I'),
985
1000
  pari('1.380586178282342062845519278761524817753278777803238623999221385504661588501960339341800843520223671 + 0.06704451876157525370444676522629959282378632516497136324893149116413190872188833330658100524720353406*I')
986
1001
  ]
987
-
1002
+
988
1003
  test__v0000__2 = (ManifoldGetter("v0000"), # Manifold
989
1004
  2, # N = 2
990
1005
  cvols, # expected complex volumes
991
1006
  False) # expect non-zero dimensional components
992
1007
 
993
-
994
- ### Test for t00000
995
- ### This also tests the case of having more than one (here two)
996
- ### cusps
1008
+ # Test for t00000
1009
+ # This also tests the case of having more than one (here two)
1010
+ # cusps
997
1011
 
998
1012
  cvols = [ # Expected Complex volumes
999
1013
  pari('1.801231981344929412976326011175173926741195258454700704383597306674496002389749200442131507334117933 - 0.5490336239273931479260463113980794374780078424892352183284248305887346671477869107359071072271699046*I'),
@@ -1001,16 +1015,16 @@ def main(verbose=False, doctest=True):
1001
1015
  pari('2.781430316400743786576311128801205534982324055570742403430395886754122643539081915302290955978507418 - 0.1135489194824466736456241002458946823709871812077727407261274931826622024508518397031626436088171650*I'),
1002
1016
  pari('0.6223401945262803853426860070209275705147832620602921139947907237662088851273537136119288228151713940 + 0.06594907226052699343130923275995552293727798462035885627276325301997714628516294342514039299674185799*I')
1003
1017
  ]
1004
-
1018
+
1005
1019
  test__t00000__2 = (ManifoldGetter("t00000"), # Manifold
1006
1020
  2, # N = 2
1007
1021
  cvols, # expected complex volumes
1008
1022
  False) # expect non-zero dimensional components
1009
1023
 
1010
- ### Check a big link
1011
- ### Also an example from the website
1024
+ # Check a big link
1025
+ # Also an example from the website
1012
1026
 
1013
- magma_file_name = os.path.join(testing_files_directory,
1027
+ magma_file_name = os.path.join(testing_files_directory,
1014
1028
  'DT_mcbbiceaibjklmdfgh__sl2_c0.magma_out.bz2')
1015
1029
  magma_file = bz2.BZ2File(magma_file_name, 'r').read().decode('ascii')
1016
1030
  M = get_manifold(magma_file)
@@ -1050,18 +1064,63 @@ def main(verbose=False, doctest=True):
1050
1064
  test__4_1__3,
1051
1065
  test__m015__3,
1052
1066
  test__4_1__4]
1053
-
1067
+
1054
1068
  pari.set_real_precision(old_precision)
1055
1069
 
1056
1070
  for manifold, N, cvols, expect_non_zero_dim in test_cases:
1057
1071
 
1058
- print("Checking for", manifold.name(), "N = %d" % N)
1072
+ if print_info:
1073
+ print("Checking for", manifold.name(), "N = %d" % N)
1059
1074
 
1060
1075
  testComputeSolutionsForManifold(
1061
1076
  manifold, N,
1062
- compute_solutions = compute_solutions,
1063
- baseline_cvolumes = cvols,
1064
- expect_non_zero_dimensional = expect_non_zero_dim)
1077
+ compute_solutions=compute_solutions,
1078
+ baseline_cvolumes=cvols,
1079
+ expect_non_zero_dimensional=expect_non_zero_dim,
1080
+ print_info=print_info)
1081
+
1082
+ def run_ptolemy_tests(verbose=False, print_info=True):
1083
+ try:
1084
+ run_ptolemy_tests_raising_exceptions(
1085
+ print_info=print_info)
1086
+ return doctest.TestResults(failed=0, attempted=1)
1087
+ except Exception as e:
1088
+ print()
1089
+ print("FAILED TEST in Ptolemy. Exception is:")
1090
+ traceback.print_exc()
1091
+ print()
1092
+ return doctest.TestResults(failed=1, attempted=1)
1093
+
1094
+ run_ptolemy_tests.__name__ = ptolemy.__name__ + ' (non-doc tests)'
1095
+
1096
+ modules = [ptolemy.component,
1097
+ ptolemy.coordinates,
1098
+ ptolemy.manifoldMethods,
1099
+ ptolemy.matrix,
1100
+ ptolemy.polynomial,
1101
+ ptolemy.processFileBase,
1102
+ ptolemy.processMagmaFile,
1103
+ ptolemy.processRurFile,
1104
+ ptolemy.ptolemyObstructionClass,
1105
+ ptolemy.ptolemyVariety,
1106
+ ptolemy.rur,
1107
+ ptolemy.utilities]
1108
+ if test_regina:
1109
+ modules.append(ptolemy.reginaWrapper)
1110
+
1111
+ def run_doctests(verbose=False, print_info=True):
1112
+ return doctest_modules(
1113
+ modules,
1114
+ verbose=verbose, print_info=print_info)
1115
+
1116
+ run_doctests.__name__ = ptolemy.__name__
1065
1117
 
1066
1118
  if __name__ == '__main__':
1067
- main()
1119
+ verbose = '-v' in sys.argv[1:] or '--verbose' in sys.argv[1:]
1120
+
1121
+ result = run_doctests(verbose=verbose, print_info=True)
1122
+ if result.failed:
1123
+ sys.exit(result.failed)
1124
+
1125
+ result = run_ptolemy_tests(verbose=verbose, print_info=True)
1126
+ sys.exit(result.failed)