Opened 5 years ago
Closed 5 years ago
#20815 closed enhancement (fixed)
libbraiding as an optional package.
Reported by:  mmarco  Owned by:  

Priority:  major  Milestone:  sage7.3 
Component:  packages: optional  Keywords:  
Cc:  kcrisman, amitjamadagni, fugelde, tscrim, jdemeyer  Merged in:  
Authors:  Miguel Marco  Reviewers:  Travis Scrimshaw 
Report Upstream:  N/A  Work issues:  
Branch:  47d64ef (Commits, GitHub, GitLab)  Commit:  47d64ef506b5ebdde2869491e5e05d5e293d37d2 
Dependencies:  Stopgaps: 
Description (last modified by )
braiding[1] is a C++ program writen by Juan GonzalezMeneses to compute several properties of braids. Specially related to the conjugacy problem in the braid group.
I did a fork of it[2] to convert it into a shared library[2].
The cython interface, and the methods in the braid groups are being worked on.
[1] https://github.com/jeanluct/cbraid [2] https://github.com/miguelmarco/libbraiding
Attachments (1)
Change History (32)
Changed 5 years ago by
comment:1 Changed 5 years ago by
 Description modified (diff)
comment:2 Changed 5 years ago by
 Branch set to u/mmarco/libbraiding_as_an_optional_package_
comment:3 Changed 5 years ago by
 Cc kcrisman amitjamadagni fugelde tscrim jdemeyer added
 Commit set to 774d04802bc4f3fc1970cf8498aae7a59c067d76
 Status changed from new to needs_review
comment:4 Changed 5 years ago by
From what we did with libhomfly, I felt that it would have been better to do everything on one ticket. That way we could make changes at all stages (the backend library, cython interface, and the Sage frontend) in one localized place. To me, it doesn't quite make sense to just add the spkg.
comment:6 Changed 5 years ago by
 Status changed from needs_review to needs_work
comment:7 Changed 5 years ago by
 Commit changed from 774d04802bc4f3fc1970cf8498aae7a59c067d76 to a6453b180c76aa1b1b24aca30525beb608b70b57
Branch pushed to git repo; I updated commit sha1. New commits:
a6453b1  cython interface. Some docstrings missing.

comment:8 Changed 5 years ago by
 Commit changed from a6453b180c76aa1b1b24aca30525beb608b70b57 to 27be32be6c9b9538d0b414cba2c42025dd24ceb1
Branch pushed to git repo; I updated commit sha1. New commits:
27be32b  Polished doctests, added to module list and documentation

comment:9 Changed 5 years ago by
 Commit changed from 27be32be6c9b9538d0b414cba2c42025dd24ceb1 to 1f76bcfc26c4aa445048401ad7de202f4b74772c
comment:10 Changed 5 years ago by
 Status changed from needs_work to needs_review
I think it id ready for review.
comment:11 Changed 5 years ago by
 Status changed from needs_review to needs_work
Remove these comments:
#clang C++ #clib braiding
comment:12 Changed 5 years ago by
 Commit changed from 1f76bcfc26c4aa445048401ad7de202f4b74772c to f065a2dc349c90ab289d7cef25f103df7c0d432d
Branch pushed to git repo; I updated commit sha1. New commits:
f065a2d  Removed pragmalike comments,

comment:14 Changed 5 years ago by
 Status changed from needs_review to needs_work
sage t src/sage/libs/braiding.pyx ********************************************************************** File "src/sage/libs/braiding.pyx", line 66, in sage.libs.braiding.conjugatingbraid Failed example: from sage.libs.braiding import conjugatingbraid Exception raised: Traceback (most recent call last): File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 498, in _run self.compile_and_execute(example, compiler, test.globs) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 861, in compile_and_execute exec(compiled, globs) File "<doctest sage.libs.braiding.conjugatingbraid[0]>", line 1, in <module> from sage.libs.braiding import conjugatingbraid ImportError: No module named braiding ********************************************************************** File "src/sage/libs/braiding.pyx", line 99, in sage.libs.braiding.leftnormalform Failed example: from sage.libs.braiding import leftnormalform Exception raised: Traceback (most recent call last): File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 498, in _run self.compile_and_execute(example, compiler, test.globs) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 861, in compile_and_execute exec(compiled, globs) File "<doctest sage.libs.braiding.leftnormalform[0]>", line 1, in <module> from sage.libs.braiding import leftnormalform ImportError: No module named braiding ********************************************************************** File "src/sage/libs/braiding.pyx", line 130, in sage.libs.braiding.rightnormalform Failed example: from sage.libs.braiding import rightnormalform Exception raised: Traceback (most recent call last): File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 498, in _run self.compile_and_execute(example, compiler, test.globs) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 861, in compile_and_execute exec(compiled, globs) File "<doctest sage.libs.braiding.rightnormalform[0]>", line 1, in <module> from sage.libs.braiding import rightnormalform ImportError: No module named braiding ********************************************************************** File "src/sage/libs/braiding.pyx", line 162, in sage.libs.braiding.greatestcommondivisor Failed example: from sage.libs.braiding import greatestcommondivisor Exception raised: Traceback (most recent call last): File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 498, in _run self.compile_and_execute(example, compiler, test.globs) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 861, in compile_and_execute exec(compiled, globs) File "<doctest sage.libs.braiding.greatestcommondivisor[0]>", line 1, in <module> from sage.libs.braiding import greatestcommondivisor ImportError: No module named braiding ********************************************************************** File "src/sage/libs/braiding.pyx", line 196, in sage.libs.braiding.leastcommonmultiple Failed example: from sage.libs.braiding import leastcommonmultiple Exception raised: Traceback (most recent call last): File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 498, in _run self.compile_and_execute(example, compiler, test.globs) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 861, in compile_and_execute exec(compiled, globs) File "<doctest sage.libs.braiding.leastcommonmultiple[0]>", line 1, in <module> from sage.libs.braiding import leastcommonmultiple ImportError: No module named braiding ********************************************************************** File "src/sage/libs/braiding.pyx", line 228, in sage.libs.braiding.centralizer Failed example: from sage.libs.braiding import centralizer Exception raised: Traceback (most recent call last): File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 498, in _run self.compile_and_execute(example, compiler, test.globs) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 861, in compile_and_execute exec(compiled, globs) File "<doctest sage.libs.braiding.centralizer[0]>", line 1, in <module> from sage.libs.braiding import centralizer ImportError: No module named braiding ********************************************************************** File "src/sage/libs/braiding.pyx", line 266, in sage.libs.braiding.supersummitset Failed example: from sage.libs.braiding import supersummitset Exception raised: Traceback (most recent call last): File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 498, in _run self.compile_and_execute(example, compiler, test.globs) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 861, in compile_and_execute exec(compiled, globs) File "<doctest sage.libs.braiding.supersummitset[0]>", line 1, in <module> from sage.libs.braiding import supersummitset ImportError: No module named braiding ********************************************************************** File "src/sage/libs/braiding.pyx", line 297, in sage.libs.braiding.ultrasummitset Failed example: from sage.libs.braiding import ultrasummitset Exception raised: Traceback (most recent call last): File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 498, in _run self.compile_and_execute(example, compiler, test.globs) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 861, in compile_and_execute exec(compiled, globs) File "<doctest sage.libs.braiding.ultrasummitset[0]>", line 1, in <module> from sage.libs.braiding import ultrasummitset ImportError: No module named braiding ********************************************************************** File "src/sage/libs/braiding.pyx", line 328, in sage.libs.braiding.thurston_type Failed example: from sage.libs.braiding import thurston_type Exception raised: Traceback (most recent call last): File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 498, in _run self.compile_and_execute(example, compiler, test.globs) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 861, in compile_and_execute exec(compiled, globs) File "<doctest sage.libs.braiding.thurston_type[0]>", line 1, in <module> from sage.libs.braiding import thurston_type ImportError: No module named braiding ********************************************************************** File "src/sage/libs/braiding.pyx", line 369, in sage.libs.braiding.rigidity Failed example: from sage.libs.braiding import rigidity Exception raised: Traceback (most recent call last): File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 498, in _run self.compile_and_execute(example, compiler, test.globs) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 861, in compile_and_execute exec(compiled, globs) File "<doctest sage.libs.braiding.rigidity[0]>", line 1, in <module> from sage.libs.braiding import rigidity ImportError: No module named braiding ********************************************************************** File "src/sage/libs/braiding.pyx", line 399, in sage.libs.braiding.sliding_circuits Failed example: from sage.libs.braiding import sliding_circuits Exception raised: Traceback (most recent call last): File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 498, in _run self.compile_and_execute(example, compiler, test.globs) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 861, in compile_and_execute exec(compiled, globs) File "<doctest sage.libs.braiding.sliding_circuits[0]>", line 1, in <module> from sage.libs.braiding import sliding_circuits ImportError: No module named braiding **********************************************************************
New commits:
f065a2d  Removed pragmalike comments,

comment:15 Changed 5 years ago by
This is pointless since the module cannot even be imported without the package:
if not is_package_installed('libbraiding'): raise NotImplementedError("This functionality requires the libbraiding package")
comment:16 followup: ↓ 18 Changed 5 years ago by
Ok. Does it make sense to put it in the braid methods?
comment:17 Changed 5 years ago by
 Commit changed from f065a2dc349c90ab289d7cef25f103df7c0d432d to aee2f4d521172fa9d8881af15657cd29e3b7385b
Branch pushed to git repo; I updated commit sha1. New commits:
aee2f4d  Removed unnecessary checks for installed package

comment:18 in reply to: ↑ 16 Changed 5 years ago by
Replying to mmarco:
Ok. Does it make sense to put it in the braid methods?
Yes, but
 avoid
is_package_installed
, useexcept ImportError
instead.  use the
PackageNotFoundError
exception instead ofNotImplementedError
.
comment:19 Changed 5 years ago by
 Commit changed from aee2f4d521172fa9d8881af15657cd29e3b7385b to 17d0e8fed0fd83c18f271fa9a4d6fc43844cd155
comment:20 Changed 5 years ago by
 Status changed from needs_work to needs_review
comment:21 Changed 5 years ago by
 Status changed from needs_review to needs_work
The exception should be
PackageNotFoundError("libbraiding")
comment:22 Changed 5 years ago by
 Commit changed from 17d0e8fed0fd83c18f271fa9a4d6fc43844cd155 to fa4300c86af40d0834605215f99fc8bb4b86ffea
Branch pushed to git repo; I updated commit sha1. New commits:
fa4300c  Corrected Error message

comment:23 Changed 5 years ago by
 Status changed from needs_work to needs_review
comment:24 Changed 5 years ago by
 Branch changed from u/mmarco/libbraiding_as_an_optional_package_ to public/optional_packages/libbraiding20815
 Commit changed from fa4300c86af40d0834605215f99fc8bb4b86ffea to 12e649ceb53dd5dc9f4cac94f2e38d0484f27f48
 Reviewers set to Travis Scrimshaw
comment:25 Changed 5 years ago by
Positive review then?
comment:27 Changed 5 years ago by
 Status changed from positive_review to needs_work
sage t long src/sage/groups/braid.py ********************************************************************** File "src/sage/groups/braid.py", line 1445, in sage.groups.braid.Braid.sliding_circuits Failed example: b.sliding_circuits() Exception raised: Traceback (most recent call last): File "/home/buildbot/slave/sage_git/build/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 498, in _run self.compile_and_execute(example, compiler, test.globs) File "/home/buildbot/slave/sage_git/build/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 861, in compile_and_execute exec(compiled, globs) File "<doctest sage.groups.braid.Braid.sliding_circuits[3]>", line 1, in <module> b.sliding_circuits() File "/home/buildbot/slave/sage_git/build/local/lib/python2.7/sitepackages/sage/groups/braid.py", line 1456, in sliding_circuits raise PackageNotFoundError("libbraiding") NameError: global name 'PackageNotFoundError' is not defined ********************************************************************** 1 item had failures: 1 of 5 in sage.groups.braid.Braid.sliding_circuits [313 tests, 1 failure, 17.35 s]
comment:28 Changed 5 years ago by
 Commit changed from 12e649ceb53dd5dc9f4cac94f2e38d0484f27f48 to 96a414db31e8199d9dbbdccb06cd9fc890096cf3
Branch pushed to git repo; I updated commit sha1. New commits:
96a414d  Some last little details.

comment:29 Changed 5 years ago by
 Commit changed from 96a414db31e8199d9dbbdccb06cd9fc890096cf3 to 47d64ef506b5ebdde2869491e5e05d5e293d37d2
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
47d64ef  Some last little details.

comment:30 Changed 5 years ago by
 Status changed from needs_work to positive_review
Missed one doctest that was suppose to be marked as optional, as well as just a realignment of the doctest output.
comment:31 Changed 5 years ago by
 Branch changed from public/optional_packages/libbraiding20815 to 47d64ef506b5ebdde2869491e5e05d5e293d37d2
 Resolution set to fixed
 Status changed from positive_review to closed
New commits:
Add libbraiding package