Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modularization of sagelib: Break out a separate package sagemath-polyhedra #32432

Open
mkoeppe opened this issue Aug 28, 2021 · 369 comments · May be fixed by #35095
Open

Modularization of sagelib: Break out a separate package sagemath-polyhedra #32432

mkoeppe opened this issue Aug 28, 2021 · 369 comments · May be fixed by #35095

Comments

@mkoeppe
Copy link
Contributor

mkoeppe commented Aug 28, 2021

We define a superset of the distribution sagemath-categories (from #29865), called https://pypi.org/project/sagemath-polyhedra/, which is large enough to work with rational polyhedra, including running most doctests

In:

  • ZZ, QQ, RDF
  • enough of sage.modules, sage.matrix to do linear algebra over these rings
  • install_requires on pplpy

Out:

To test:

$ ./bootstrap && ./sage -sh -c '(cd pkgs/sagemath-polyhedra && SAGE_NUM_THREADS=16 tox -v -v -v)'

To run more of the testsuite afterwards:

$ . pkgs/sagemath-polyhedra/.tox/python/bin/activate
(python) $ (cd $(python -c "from sage.env import SAGE_SRC; print(SAGE_SRC)") && sage -tp --environment=sage.all__sagemath_polyhedra sage/geometry)
...
(python) $ deactivate

Follow-up steps:

  • redo as distribution with dependency on sagemath-categories
  • wheels for this distribution, for pplpy and PyNormaliz
  • native Windows port

Depends on #32779
Depends on #34855
Depends on #34849
Depends on #32709
Depends on #34849
Depends on #34931
Depends on #34941

CC: @kliem @tscrim @anneschilling

Component: refactoring

Work Issues: git blame -b --first-parent 32432-base.. src/sage/geometry/polyhedron/base.py

Author: Matthias Koeppe

Issue created by migration from https://trac.sagemath.org/ticket/32432

@mkoeppe mkoeppe added this to the sage-9.5 milestone Aug 28, 2021
@mkoeppe

This comment has been minimized.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Aug 28, 2021

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Aug 28, 2021

Commit: 8ea1332

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Aug 28, 2021

comment:3

Initial draft. Needs more work to get integers/rationals to work, and need to include vectors/matrices


Last 10 new commits:

08084b3sage.libs.pari.convert_sage: Move set_integer_from_gen here from sage.rings.integer (set_from_pari_gen)
9986723remove compile time dependency of Integer and Rational on cypari2
c08a8b5remove compile-time dependency on flint from integer
b0ba835Merge #30022
d3479c7remove some of symbolics from sage.geometry
2991f8dMerge #32416
0101366pkgs/sagemath-polyhedra, src/sage/all__sagemath_polyhedra.py: New
bb708f3#29865: Rename all__sage_objects.py, all__sage_categories.py to all__sagemath_objects.py, all__sagemath_categories.py
a301f70build/pkgs/sagemath_polyhedra: New
8ea1332pkgs/sagemath-polyhedra/MANIFEST.in.m4: Include more

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 28, 2021

Changed commit from 8ea1332 to 4085b62

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 28, 2021

Branch pushed to git repo; I updated commit sha1. New commits:

4085b62pkgs/sagemath-polyhedra/MANIFEST.in.m4: Add what we can from sage.matrix

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 28, 2021

Changed commit from 4085b62 to 1d7f906

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 28, 2021

Branch pushed to git repo; I updated commit sha1. New commits:

1d7f906pkgs/sagemath-polyhedra/MANIFEST.in.m4: Add what we can from sage.modules

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Aug 31, 2021

Changed dependencies from #29865, #30022, #32416 to #29865, #30022, #32416, #32441

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Sep 2, 2021

Changed dependencies from #29865, #30022, #32416, #32441 to #29865, #30022, #32416, #32441, #32455

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Sep 3, 2021

comment:8

One of the next issues is use of Matrix_integer_dense in combinatorial_polyhedron.list_of_faces etc.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Sep 19, 2021

Changed dependencies from #29865, #30022, #32416, #32441, #32455 to #29865, #32416, #32441, #32455

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 19, 2021

Changed commit from 1d7f906 to f0dd43d

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 19, 2021

Branch pushed to git repo; I updated commit sha1. This was a forced push. Last 10 new commits:

41df930fix function signatures
90b6f3dMerge #32441
13f9003move pari type detection to convert_sage
e925042Merge #32455
ccbde78pkgs/sagemath-polyhedra, src/sage/all__sagemath_polyhedra.py: New
8baebcfbuild/pkgs/sagemath_polyhedra: New
039f66bpkgs/sagemath-polyhedra/MANIFEST.in.m4: Include more
3dfac9fpkgs/sagemath-polyhedra/MANIFEST.in.m4: Add what we can from sage.matrix
23a49b9pkgs/sagemath-polyhedra/MANIFEST.in.m4: Add what we can from sage.modules
f0dd43dpkgs/sagemath-polyhedra/MANIFEST.in.m4: WIP

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 19, 2021

Changed commit from f0dd43d to 8159516

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 19, 2021

Branch pushed to git repo; I updated commit sha1. New commits:

3983ce5pkgs/sagemath-polyhedra/MANIFEST.in.m4: More&less
5adceb1src/sage/geometry/polyhedron/combinatorial_polyhedron/base.pyx: Avoid imports from .all
8159516src/sage/geometry/polyhedron/combinatorial_polyhedron/base.pyx: Experimental: Remove cimport of Matrix_integer_dense

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 19, 2021

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

685c1fasrc/sage/geometry/polyhedron/combinatorial_polyhedron/: Experimental: Remove cimport of Matrix_integer_dense

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 19, 2021

Changed commit from 8159516 to 685c1fa

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 19, 2021

Branch pushed to git repo; I updated commit sha1. New commits:

64a8ec1pkgs/sagemath-polyhedra/MANIFEST.in.m4: fixup

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 19, 2021

Changed commit from 685c1fa to 64a8ec1

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Sep 19, 2021

comment:14

This version compiles now (I had to butcher combinatorial_polyhedron a bit)
and is able to run (but not pass) doctests

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 19, 2021

Changed commit from 64a8ec1 to 4f76ecf

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 19, 2021

Branch pushed to git repo; I updated commit sha1. Last 10 new commits:

7955111git grep -l 'all import latex' src/sage | xargs sed -i.bak 's/sage[.]misc[.]all import latex *$/sage.misc.latex import latex/'
b693d89git grep -l 'all import vector' src/sage | xargs sed -i.bak 's/sage[.]modules[.]all import vector *$/sage.modules.free_module_element import vector/'
8e357e1git grep -l 'all import matrix' src/sage | xargs sed -i.bak 's/sage[.]matrix[.]all import matrix *$/sage.matrix.constructor import matrix/'
d070bffgit grep -l 'all import RDF' src/sage | xargs sed -i.bak 's/sage[.]rings[.]all import RDF *$/sage.rings.real_double import RDF/'
2344514git grep -l 'all import SR' src/sage | xargs sed -i.bak 's/sage.*[.]all import SR *$/sage.symbolic.ring import SR/'
c254b74Merge #32534
d98d3ccsrc/sage/rings/rational.pyx: Move import of mathml into method
49659b9pkgs/sagemath-polyhedra/MANIFEST.in.m4: Add sage/rings/number_field/number_field_base
459c5e0pkgs/sagemath-polyhedra/MANIFEST.in.m4: Add sage.rings.infinity
4f76ecfsrc/sage/rings/all__sagemath_polyhedra.py: Change order of imports

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Sep 19, 2021

comment:16
    from .rational import Rational
  File "sage/rings/rational.pyx", line 1, in init sage.rings.rational (build/cythonized/sage/rings/rational.cpp:39909)
  File "sage/rings/integer.pyx", line 182, in init sage.rings.integer (build/cythonized/sage/rings/integer.c:53606)
  File "/Users/mkoeppe/s/sage/sage-rebasing/worktree-rebase/pkgs/sagemath-polyhedra/.tox/python/lib/python3.9/site-packages/sage/rings/infinity.py", line 226, in <module>
    import sage.rings.integer_ring
  File "sage/rings/integer_ring.pyx", line 57, in init sage.rings.integer_ring (build/cythonized/sage/rings/integer_ring.c:18098)
ModuleNotFoundError: No module named 'sage.libs.pari'

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Sep 19, 2021

Changed dependencies from #29865, #32416, #32441, #32455 to #29865, #32416, #32441, #32455, #32534

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 19, 2021

Changed commit from 4f76ecf to 5372b70

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Dec 19, 2022

Branch pushed to git repo; I updated commit sha1. Last 10 new commits:

00deebepkgs/sagemath-objects/setup.py: Run finder also for sdist, egg_info, dist_info
39bd748src/sage/dynamics/arithmetic_dynamics/projective_ds.py: Remove unused import of typing_extensions
e229436Merge #34859
2b39b3dMerge #34858
c59622abuild/pkgs/sagemath*/spkg-src: Use build
7fc93d0build/pkgs/sagemath*/spkg-src: Use --skip-dependency-check
4940db4build/make/Makefile.in: Add targets SPKG-src for script packages
573fcfdbuild/make/Makefile.in: Move targets pypi-sdists, wheel, pypi-wheels here; use SPKG-sdist targets
0bd13acbuild/make/Makefile.in: Remove duplicate setting of PYPI_WHEEL_PACKAGES
6bf44ecMerge #34855

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Dec 19, 2022

Changed commit from 4bcb10f to 6bf44ec

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Dec 19, 2022

Changed commit from 6bf44ec to 702ee8d

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Dec 19, 2022

Branch pushed to git repo; I updated commit sha1. New commits:

702ee8dbuild/pkgs/sagemath*/spkg-src: Use build

@mkoeppe mkoeppe modified the milestones: sage-9.8, sage-9.9 Jan 7, 2023
@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jan 23, 2023

Changed dependencies from #32779, #34195, #33011, #34804, #34855 to #32779, #34855, #34849, #32709

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 23, 2023

Branch pushed to git repo; I updated commit sha1. Last 10 new commits:

449b56bpkgs/sagemath*/tox.ini: Fix for tox 4
4a27a3dMerge #34839
95fe89abuild/pkgs/tox/spkg-configure.m4: Check for good tox 3, tox 4 versions separately
cc7196asrc/tox.ini: More allowlist_externals for tox 4
1999bd6src/tox.ini: Quoting fix for tox 4
071c113Merge tag '9.8.beta6' into t/34849/more_fixes_to_support_tox_4
6b8c666Merge #34839
a2eb816tox.ini: Require tox >= 4.2.7
516798aMerge #34849
d857fa0pkgs/sagemath-categories: Add parts of sage.rings.polynomial

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 23, 2023

Changed commit from 702ee8d to d857fa0

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 23, 2023

Changed commit from d857fa0 to 10d3767

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 23, 2023

Branch pushed to git repo; I updated commit sha1. New commits:

7f279d1pkgs/sagemath-polyhedra/tox.ini: Change to allowlist_externals
10d3767pkgs/sagemath-categories/setup.cfg.m4: Add to package_data

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 24, 2023

Branch pushed to git repo; I updated commit sha1. New commits:

c28996dpkgs/sagemath-categories: Add parts of sage.sets

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 24, 2023

Changed commit from 10d3767 to c28996d

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 24, 2023

Changed commit from c28996d to 62da507

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 24, 2023

Branch pushed to git repo; I updated commit sha1. New commits:

7b02fb2sage.structure.element.NumberFieldElement: New ABC
a9dacbeis_NumberFieldElement: Deprecate, replace uses by isinstance
81e875bMerge #34931
1cc09ccReplace some imports of NumberFieldElement classes by ABC
4dfefbfsrc/sage/rings/number_field/number_field_element.pyx: Update doctest with deprecation warning
62da507Merge #34931

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 24, 2023

Changed commit from 62da507 to f084629

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 24, 2023

Branch pushed to git repo; I updated commit sha1. New commits:

f084629pkgs/sagemath-polyhedra/setup.cfg.m4: Allow python 3.11

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 25, 2023

Branch pushed to git repo; I updated commit sha1. New commits:

ba246ffsrc/sage/combinat/all__sagemath_polyhedra.py: New
58f7767Use try..except when importing polynomial implementation classes

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 25, 2023

Changed commit from f084629 to 58f7767

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jan 27, 2023

Changed dependencies from #32779, #34855, #34849, #32709 to #32779, #34855, #34849, #32709, #34849, #34931, #34941

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 27, 2023

Changed commit from 58f7767 to 8270697

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 27, 2023

Branch pushed to git repo; I updated commit sha1. New commits:

c9afec2src/sage/rings/integer.pyx: Mark doctests # optional - sage.libs.pari, sage.rings.number_field, sage.symbolic
a4f7955pkgs/sagemath-categories/MANIFEST.in.m4: Add sage.rings.finite_rings.integer_mod, sage.rings.factorint
e46b5d5src/sage/rings/polynomial/polynomial_element_generic.py: Use try...except for an unpickle_override import
f4730dapkgs/sagemath-categories/MANIFEST.in.m4: Add sage.rings.finite_rings.integer_mod_ring
86f2f74src/sage/geometry/polyhedron: Add # optional - sage.combinat, sage.groups, sage.plot, sage.rings.number_field, sage.symbolic
9b6cb96pkgs/sagemath-polyhedra: Add sage.numerical.mip etc
ad6a466pkgs/sagemath-polyhedra/tox.ini: Add more passing files
131e3bepkgs/sagemath-polyhedra: Add sage.numerical.mip etc (fixup)
25f84e3src/sage/numerical/backends/scip_backend.pyx: Remove unused imports
8270697Merge #34941

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Feb 12, 2023

Removed the branch from the issue description; replaced by #35095

@mkoeppe mkoeppe self-assigned this Feb 12, 2023
vbraun pushed a commit that referenced this issue Mar 26, 2023
…trix_integer_dense`

    
<!-- ^^^^^
Please provide a concise, informative and self-explanatory title.
Don't put issue numbers in there, do this in the PR body below.
For example, instead of "Fixes #1234" use "Introduce new method to
calculate 1+1"
-->
### 📚 Description

<!-- Describe your changes here in detail -->
<!-- Why is this change required? What problem does it solve? -->
This is for the distribution sagemath-polyhedra (#32432) so that it does
not have to depend on the flint library.
<!-- If it resolves an open issue, please link to the issue here. For
example "Closes #1337" -->

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->
<!-- If your change requires a documentation PR, please link it
appropriately -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->

- [x] I have made sure that the title is self-explanatory and the
description concisely explains the PR.
- [ ] I have linked an issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation accordingly.

### ⌛ Dependencies
<!-- List all open pull requests that this PR logically depends on -->
<!--
- #xyz: short description why this is a dependency
- #abc: ...
-->
    
URL: #35135
Reported by: Matthias Köppe
Reviewer(s): Jonathan Kliem, Matthias Köppe
@mkoeppe mkoeppe modified the milestones: sage-10.0, sage-10.1 Apr 30, 2023
@mkoeppe mkoeppe removed this from the sage-10.1 milestone Aug 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment