Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into pr_generic_rings
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarbenjamin committed Sep 15, 2024
2 parents f7f0c1e + ae4fe25 commit 893857b
Show file tree
Hide file tree
Showing 60 changed files with 2,229 additions and 1,074 deletions.
10 changes: 2 additions & 8 deletions .github/workflows/buildwheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,7 @@ jobs:
with:
python-version: '3.12'

- run: sudo apt-get update
- run: sudo apt-get install libgmp-dev libmpfr-dev xz-utils ninja-build
- run: curl -O -L https://www.flintlib.org/flint-3.1.0.tar.gz
- run: tar -xzf flint-3.1.0.tar.gz
- run: cd flint-3.1.0 && ./configure --disable-static && make -j4 && sudo make install
- run: bin/install_latest_flint_ubuntu.sh
- run: pip install build
- run: python -m build --sdist

Expand Down Expand Up @@ -129,9 +125,7 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- run: sudo apt-get update
- run: sudo apt-get install libflint-dev

- run: bin/install_latest_flint_ubuntu.sh
- run: pip install --upgrade pip
- run: pip install -r requirements-dev.txt
- run: spin run -- pytest --doctest-glob='*.rst' doc/source
Expand Down
16 changes: 12 additions & 4 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,24 @@ build:
os: ubuntu-24.04
tools:
python: "3.12"
# You can also specify other tool versions:
# nodejs: "19"
# rust: "1.64"
# golang: "1.19"

apt_packages:
- libflint-dev
jobs:
pre_build:
- pip install .

# Tried to use this to build latest version of FLINT but FLINT does not build
# in rtd for some reason. FLINT's configure seems to fail in all sorts of ways
# even though GMP and MPFR build fine.
#
# commands:
# - pip install -r requirements-dev.txt
# - bin/build_dependencies_unix.sh --use-gmp-github-mirror
# - spin build -- --pkg-config-path=.local/lib/pkgconfig -Dadd_flint_rpath=true
# - spin docs
# - mv doc/build/html $READTHEDOCS_OUTPUT/html

# Build documentation in the "docs/" directory with Sphinx
sphinx:
configuration: doc/source/conf.py
Expand Down
15 changes: 15 additions & 0 deletions bin/install_latest_flint_ubuntu.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash

set -e

source bin/build_variables.sh

sudo apt-get update
sudo apt-get install libgmp-dev libmpfr-dev xz-utils ninja-build

curl -O -L https://github.com/flintlib/flint/releases/download/v$FLINTVER/flint-$FLINTVER.tar.gz
tar -xzf flint-$FLINTVER.tar.gz
cd flint-$FLINTVER && ./configure --disable-static && make -j$(expr $(nproc) + 1) && sudo make install

ls -l /usr/local/lib
sudo ldconfig /usr/local/lib
8 changes: 8 additions & 0 deletions bin/rtd_before_all_linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

apt-get install xz-utils

bin/build_dependencies_unix.sh\
--gmp gmp\
--host x86_64-pc-linux-gnu\
--use-gmp-github-mirror
18 changes: 18 additions & 0 deletions doc/source/fmpq_mpoly.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
**fmpq_mpoly** -- multivariate polynomials over the rational numbers
===============================================================================

.. autoclass :: flint.fmpq_mpoly_ctx
:members:
:inherited-members:
:undoc-members:
.. autoclass :: flint.fmpq_mpoly
:members:
:inherited-members:
:undoc-members:
.. autoclass :: flint.fmpq_mpoly_vec
:members:
:inherited-members:
:undoc-members:
18 changes: 18 additions & 0 deletions doc/source/fmpz_mod_mpoly.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
**fmpz_mod_mpoly** -- multivariate polynomials over the integers mod n
===============================================================================

.. autoclass :: flint.fmpz_mod_mpoly_ctx
:members:
:inherited-members:
:undoc-members:
.. autoclass :: flint.fmpz_mod_mpoly
:members:
:inherited-members:
:undoc-members:
.. autoclass :: flint.fmpz_mod_mpoly_vec
:members:
:inherited-members:
:undoc-members:
18 changes: 18 additions & 0 deletions doc/source/fmpz_mpoly.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
**fmpz_mpoly** -- multivariate polynomials over the integers
===============================================================================

.. autoclass :: flint.fmpz_mpoly_ctx
:members:
:inherited-members:
:undoc-members:
.. autoclass :: flint.fmpz_mpoly
:members:
:inherited-members:
:undoc-members:
.. autoclass :: flint.fmpz_mpoly_vec
:members:
:inherited-members:
:undoc-members:
4 changes: 4 additions & 0 deletions doc/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,13 @@ Polynomial types
:maxdepth: 1

fmpz_poly.rst
fmpz_mpoly.rst
fmpq_poly.rst
fmpq_mpoly.rst
nmod_poly.rst
nmod_mpoly.rst
fmpz_mod_poly.rst
fmpz_mod_mpoly.rst
fq_default_poly.rst
arb_poly.rst
acb_poly.rst
Expand Down
18 changes: 18 additions & 0 deletions doc/source/nmod_mpoly.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
**nmod_mpoly** -- multivariate polynomials over the integers mod n (word-size n)
================================================================================

.. autoclass :: flint.nmod_mpoly_ctx
:members:
:inherited-members:
:undoc-members:
.. autoclass :: flint.nmod_mpoly
:members:
:inherited-members:
:undoc-members:
.. autoclass :: flint.nmod_mpoly_vec
:members:
:inherited-members:
:undoc-members:
6 changes: 1 addition & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,8 @@ build-backend = "mesonpy"
# E741 ambiguous variable name
# Reasoning: many places it makes sense to use l or other letters as variable
# names as it is standard in mathematical notation.
#
# E743 ambiguous function definition
# Reasoning: this is a work in progress and will be enforced after #210 is
# resolved.
max-line-length = 120
ignore = ['E129','E501','E741','E743']
ignore = ['E129','E501','E741']
exclude = 'src/flint/flintlib/functions.*'

[tool.spin]
Expand Down
10 changes: 6 additions & 4 deletions src/flint/flint_base/flint_base.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ cdef class flint_mpoly_context(flint_elem):
cdef public object py_names
cdef const char ** c_names

cdef class flint_mod_mpoly_context(flint_mpoly_context):
cdef readonly bint __prime_modulus

cdef class flint_mpoly(flint_elem):
cdef _add_scalar_(self, other)
cdef _sub_scalar_(self, other)
Expand All @@ -26,6 +29,8 @@ cdef class flint_mpoly(flint_elem):
cdef _mul_mpoly_(self, other)

cdef _divmod_mpoly_(self, other)
cdef _truediv_scalar_(self, other)
cdef _divexact_scalar_(self, other)
cdef _floordiv_mpoly_(self, other)
cdef _truediv_mpoly_(self, other)
cdef _mod_mpoly_(self, other)
Expand Down Expand Up @@ -55,8 +60,5 @@ cdef class flint_mat(flint_elem):
cdef class flint_series(flint_elem):
pass

cpdef enum Ordering:
lex, deglex, degrevlex

cdef ordering_t ordering_py_to_c(ordering: Ordering)
cdef ordering_t ordering_py_to_c(ordering)
cdef ordering_c_to_py(ordering_t ordering)
Loading

0 comments on commit 893857b

Please sign in to comment.