Skip to content

Commit

Permalink
Merge branch 'master' into ruff_auto
Browse files Browse the repository at this point in the history
  • Loading branch information
fchapoton committed Aug 16, 2024
2 parents 55fe7f4 + 678a9fe commit 0b8e56e
Show file tree
Hide file tree
Showing 436 changed files with 10,601 additions and 188,763 deletions.
29 changes: 0 additions & 29 deletions .cirrus.yml

This file was deleted.

39 changes: 0 additions & 39 deletions .github/workflows/macos.yml

This file was deleted.

38 changes: 0 additions & 38 deletions .github/workflows/macos_older_pythons.yml

This file was deleted.

16 changes: 14 additions & 2 deletions .github/workflows/test.yml → .github/workflows/sage_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
version: [9.3, 9.4, 9.5, 9.6, 9.7, 9.8, 10.1, 10.2, latest]
version: [9.3, 9.4, 9.5, 9.6, 9.7, 9.8, 10.1, 10.2, 10.3, latest]

container:
image: sagemath/sagemath:${{ matrix.version }}
Expand All @@ -20,7 +20,7 @@ jobs:
run: sage --version

- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install PLink
run:
Expand All @@ -47,3 +47,15 @@ jobs:
- name: Do the tests
run: sage -python -m snappy.test

- name: Build docs
# Doesn't just do "make html" as neither "make" nor "zip" is
# installed in this image.
run: |
cd /__w/SnapPy/SnapPy/doc_src
sage -python -m sphinx -b html -E -d _build/doctrees . _build/doc
- uses: actions/upload-artifact@v4
with:
name: doc-${{ matrix.version }}
path: /__w/SnapPy/SnapPy/doc_src/_build/doc/*
27 changes: 15 additions & 12 deletions .github/workflows/linux.yml → .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Linux Wheels
name: Wheels

on: [push, pull_request]

Expand All @@ -7,34 +7,37 @@ jobs:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04]
os: [ubuntu-22.04, macos-12, macos-14, windows-2019]

steps:
- uses: actions/checkout@v3

- name: Build wheels
uses: pypa/cibuildwheel@v2.15.0
uses: pypa/cibuildwheel@v2.19.2
env:
# Skip Python 3.12, 32 bit Linux, and PyPy
# Skip Python 32 bit Linux, and PyPy
CIBW_ENVIRONMENT: SNAPPY_ALWAYS_BUILD_CYOPENGL=True
CIBW_ENVIRONMENT_MACOS: >
SNAPPY_ALWAYS_BUILD_CYOPENGL=True
MACOSX_DEPLOYMENT_TARGET=10.12
CIBW_BUILD: "cp38-* cp39-* cp310-* cp311-* cp312-*"
CIBW_SKIP: "*-manylinux_i686 *musllinux* pp*"
CIBW_BEFORE_ALL_LINUX: yum install -y tk mesa-libGLU-devel
CIBW_BEFORE_BUILD: >
pip install cython FXrays low_index sphinx sphinx_rtd_theme &&
pip install --pre --extra-index-url https://test.pypi.org/simple cypari &&
pip install git+https://github.com/3-manifolds/PLink &&
pip install git+https://github.com/3-manifolds/snappy_manifolds &&
pip install git+https://github.com/3-manifolds/Spherogram
pip install cython
CIBW_BEFORE_TEST: >
pip install cython low_index &&
pip install low_index &&
pip install --pre --extra-index-url https://test.pypi.org/simple cypari &&
pip install git+https://github.com/3-manifolds/PLink &&
pip install git+https://github.com/3-manifolds/snappy_manifolds &&
pip install git+https://github.com/3-manifolds/Spherogram
CIBW_REPAIR_WHEEL_COMMAND_LINUX: auditwheel repair --strip -w {dest_dir} {wheel}
CIBW_TEST_COMMAND: python -m snappy.test --skip-modern-opengl
CIBW_TEST_COMMAND: python -m snappy.test --skip-gui


- uses: actions/upload-artifact@v3
with:
name: snappy_linux_wheels
name: snappy_all_wheels
path: ./wheelhouse/*.whl
38 changes: 0 additions & 38 deletions .github/workflows/windows.yml

This file was deleted.

9 changes: 9 additions & 0 deletions CI_README
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
The locations of the files controlling continuous integration are:

.cirrus.yml

For Mac OS ARM only. Machine seems to be headless - so skipping GUI tests.

.github/workflows

For everything else.
1 change: 1 addition & 0 deletions cython/SnapPy.pyx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# cython: language_level=3str
# cython: embedsignature = False

ctypedef double Real

Expand Down
1 change: 1 addition & 0 deletions cython/SnapPyHP.pyx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# distutils: language = c++
# distutils: sources = SnapPyHP.cpp
# cython: language_level=3str
# cython: embedsignature = False

ctypedef qd_real Real

Expand Down
2 changes: 1 addition & 1 deletion cython/core/abelian_group.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ cdef class PresentationMatrix():
Continue until no units remain. When a generator is removed,
remember its column index.
"""
cdef int temp, m, i = 0, j = 0, k, l
cdef int i = 0, j = 0, k, l
while len(self._units) > 0:
for i, j in self._units:
break
Expand Down
29 changes: 3 additions & 26 deletions cython/core/basic.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ try:
except ImportError:
pass

from .matrix import matrix, vector, SimpleMatrix
from .matrix import matrix
from . import number

# SnapPy components
Expand All @@ -52,6 +52,7 @@ from . import twister
from . import snap
from . import verify
from .verify import complex_volume as verify_complex_volume
from .cusps import compute_cusp_shapes as cusps_compute_cusp_shapes
from . import decorated_isosig
from .ptolemy import manifoldMethods as ptolemyManifoldMethods
from .export_stl import stl
Expand Down Expand Up @@ -370,24 +371,6 @@ class MatrixWithExplanations():
self.explain_rows = explain_rows
self.explain_columns = explain_columns

def __add__(self, other):

assert self.explain_columns == other.explain_columns, (
"matrices with different columns")

if isinstance(self.matrix, SimpleMatrix):
newMatrix = SimpleMatrix(self.matrix.data + other.matrix.data)
elif _within_sage:
newMatrix = self.matrix.stack(other.matrix)
else:
raise ValueError('Matrix type in MatrixWithExplanations '
'not supported')

return MatrixWithExplanations(
newMatrix,
self.explain_rows+other.explain_rows,
self.explain_columns)

def __repr__(self, _type_str = "MatrixWithExplanations"):

def format_explain_list(l):
Expand Down Expand Up @@ -419,12 +402,6 @@ class NeumannZagierTypeEquations(MatrixWithExplanations):
return MatrixWithExplanations.__repr__(self,
"NeumannZagierTypeEquations")

def __add__(self, other):
mat = MatrixWithExplanations.__add__(self, other)

return NeumannZagierTypeEquations(
mat.matrix, mat.explain_rows, mat.explain_columns)

# C type for a function of Real returning an object
ctypedef object (*func_real_to_obj)(Real)

Expand Down Expand Up @@ -601,7 +578,7 @@ class LengthSpectrumInfo(Info):
lenStr += " + "
else:
lenStr += " - "
lenStr += "%17.14f*I" % absImag
lenStr += "%16.14f*I" % absImag

if 'word' in self:
return LengthSpectrumFormatStringWithWord % (
Expand Down
7 changes: 4 additions & 3 deletions cython/core/dirichlet.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,8 @@ class DirichletDomain(CDirichletDomain):
is a local maximum of injectivity radius. It will have ideal
vertices if the manifold is not closed.
Instantiate as M.dirichlet_domain() where M is a Manifold to
Instantiate as M.dirichlet_domain()
where M is a Manifold to
obtain a Dirichlet Domain centered at a point which maximizes
injectivity radius.
Expand All @@ -721,7 +722,7 @@ class DirichletDomain(CDirichletDomain):
You can also create a Dirichlet Domain from a file listing matrix
generators for the group, in SnapPea's "% Generator" format, via
D = DirichletDomain(generator_file='test.gens')
>>> D = DirichletDomain(generator_file='test.gens') # doctest: +SKIP
Or from matrices:
Expand All @@ -733,7 +734,7 @@ class DirichletDomain(CDirichletDomain):
The group elements for the face-pairings of the Dirichlet domain
can be given as words in the original generators by setting
include_words = True.
``include_words = True``.
"""

Expand Down
9 changes: 5 additions & 4 deletions cython/core/fundamental_group.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ def word_as_list(word, int num_generators):

return word_list

def list_as_word(int_list, int num_generators, verbose_form):
return _letter_seperator(verbose_form).join(
int_to_gen_string(g, num_generators, verbose_form)
for g in int_list)

cdef class CFundamentalGroup():
cdef c_GroupPresentation *c_group_presentation
Expand Down Expand Up @@ -223,10 +227,7 @@ cdef class CFundamentalGroup():
return words[1:]
else:
n = self.num_original_generators()
return [_letter_seperator(verbose_form).join(
int_to_gen_string(g, n, verbose_form)
for g in word)
for word in words[1:]]
return [ list_as_word(word, n, verbose_form) for word in words[1:]]

def _word_moves(self):
cdef int *c_moves
Expand Down
Loading

0 comments on commit 0b8e56e

Please sign in to comment.