[sage-devel] Standard/Recommended practices for adding codes with third-party libraries into Sage codebase?
Dear all, In the past few months I have been working on a Sage library for counting graph homomorphisms: https://github.com/guojing0/count-graph-homs (It's still updating, hence not 100% complete) In `concurrent_hom_count.py`, I use third-party libraries, such as `numba`, `dask`, and `numpy`. For numpy, I think it's already in Sage. So I was wondering what would be the standard/best/recommended practices if I want to contribute this code to Sage, which I suppose does not support either `numba` or `dask` (searching in the codebase returns nothing)? Thank you! Jing -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/70e34b93-4664-46d9-8591-72a4d29bb44bn%40googlegroups.com.
[sage-devel] Re: CI Is (Generally) Broken
I've now set https://github.com/sagemath/sage/pull/37998 back to "need work" for the following reasons: - Needs to be tested on all 6 os/python version combinations - Updates of the conda lock files should never require additions to the "known bugs" exclusions. If a certain version upgrade results in problems, add a version constraint to the conda files to exclude that particular version. - The changes related to "-latest" in ci-conda are no improvement - The renaming of the macos lock files are now inconsistent with the naming of the linux lock files. We should not orient ourselves on what github actions use as the default, but what is the most common system - these files are primarily intended to be used by users, and not for the ci. On Saturday, May 18, 2024 at 10:58:37 AM UTC+8 Matthias Koeppe wrote: > More to review: > - https://github.com/sagemath/sage/pull/37988 > - https://github.com/sagemath/sage/pull/37902 > - https://github.com/sagemath/sage/pull/37919 > - https://github.com/sagemath/sage/pull/37620 > - https://github.com/sagemath/sage/pull/37834 > - https://github.com/sagemath/sage/pull/37857 > > > On Wednesday, May 15, 2024 at 6:43:36 PM UTC-7 Matthias Koeppe wrote: > >> Yes, various parts of the CI are broken. >> >> Fixes for the CI ready for review: >> - "Makefile, .ci/write-dockerfile.sh: Update for src/pyproject.toml after >> #36982" (https://github.com/sagemath/sage/pull/37926) >> - "Update conda-lock files, rename macOS conda-lock files to match CI >> Conda" (https://github.com/sagemath/sage/pull/37998) >> >> Other infrastructure PRs ready for review: >> - https://github.com/sagemath/sage/pull/37973 >> - "GH Actions: Fix build of macOS x86_64 wheels, build wheels for >> sagemath-{bliss,coxeter3,mcqd,tdlib} for PyPI" ( >> https://github.com/sagemath/sage/pull/36525) >> - https://github.com/sagemath/sage/pull/37959 >> - https://github.com/sagemath/sage/pull/37453 >> - https://github.com/sagemath/sage/pull/37009 >> >> -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/15af29b3-2eb9-4461-99a9-7447b8b21c44n%40googlegroups.com.
[sage-devel] Re: Standard/Recommended practices for adding codes with third-party libraries into Sage codebase?
On Sunday, May 19, 2024 at 12:53:25 PM UTC-7 Jing Guo wrote: In the past few months I have been working on a Sage library for counting graph homomorphisms: https://github.com/guojing0/count-graph-homs (It's still updating, hence not 100% complete) In `concurrent_hom_count.py`, I use third-party libraries, such as `numba`, `dask`, and `numpy`. For numpy, I think it's already in Sage. So I was wondering what would be the standard/best/recommended practices if I want to contribute this code to Sage, which I suppose does not support either `numba` or `dask` (searching in the codebase returns nothing)? It depends on the intended degree of integration into Sage. The loosest integration: Prepare it as a pip-installable package (which declares its dependencies using the standard Python packaging practices); then add it as an optional "pip" package to the Sage disitribution. See Meta-ticket: Add external user packages as optional/experimental packages (https://github.com/sagemath/sage/issues/31164) for examples and pointers to documentation. -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/d29caf89-d6b5-4896-94b1-b4703218e857n%40googlegroups.com.
[sage-devel] Re: collect names of all optional arguments used in sage
I could imagine that such a reference would be valuable as an additional index to our reference manual. I would suggest to look into implementing it as a Sphinx extension (after checking whether something like this already exists). Sage already uses a custom version of the Sphinx autodoc extension: https://github.com/sagemath/sage/blob/develop/src/sage_docbuild/ext/sage_autodoc.py On Monday, May 6, 2024 at 2:21:24 AM UTC-7 Martin R wrote: > Dear all! > > I thought it may make sense to have an easy way to find the names of all > optional (i.e., keyword) arguments used in sage, ideally as a dictionary > mapping names to the methods where they are used. > > So, for example, one entry might be (schematically) > > (' rank', [random_subspaces_matrix, BasisExchangeMatroid.__init__, > Lfunction.find_zeros_via_N, mult_schubert, BasisMatroid.__init__, > TrivialBundle, SheafLibrary.trivial_bundle]) > > I would find that useful to make informed decisions about how to name my > keyword arguments. > > Has anybody done this yet? > > Note that there is a very short list of such "Common function keyword > arguments" at > > > https://doc.sagemath.org/html/en/developer/coding_basics.html#miscellaneous-minor-things > > I realize that this is a bit of bikeshedding. With what I have I found > only few potential mergers (file and filename; vars and variables, verify > and check), but quite a lot of rather obscure names (infamous example: > desolvers.py). > > Best wishes, > > Martin > -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/70ad94c3-0da2-49d3-b438-ad4b64c5b816n%40googlegroups.com.
[sage-devel] Re: Build from source on Apple Silicon M3
You'll need: - https://github.com/sagemath/sage/pull/38025 - https://github.com/sagemath/sage/pull/38008 - https://github.com/sagemath/sage/pull/37919 - https://github.com/sagemath/sage/pull/38021 On Sunday, May 19, 2024 at 7:04:58 PM UTC-7 Trevor Karn wrote: > Hi all, > > I am trying to build from source on Apple Silicon M3. As predicted by > several sources (below), `gfortran` fails to build on Apple Silicon. > > After running `./configure` from SAGE_ROOT, I see the line: > > gfortran: no suitable system package; standard, SPKG > version 12.2.0 will be installed > Then when I `make`, the build fails with output: > > [gfortran-12.2.0] > > > [gfortran-12.2.0] Error building gfortran-12.2.0 > > [gfortran-12.2.0] > > > [gfortran-12.2.0] > > [gfortran-12.2.0] real 0m49.588s > > [gfortran-12.2.0] user 2m35.894s > > [gfortran-12.2.0] sys 1m22.419s > > [gfortran-12.2.0] > > > [gfortran-12.2.0] Error building package gfortran-12.2.0 > > [gfortran-12.2.0] > > > The following lines in config.log seems relevant: > > ## Checking whether SageMath should install SPKG gfortran... ## > configure:18136: checking the version of gfortran > configure:18172: Installing gfortran because gfortran is version 14, which > is too recent for this version of Sage > configure:18206: no suitable system package found for SPKG gfortran > configure:18331: checking whether any of gfortran is installed as or will > be installed as SPKG > configure:110356: result: gfortran: no suitable > system package; standard, SPKG version 12.2.0 will be installed > > Since the build wanted to install SPKG version 12.2.0 and thought 14 was > "too recent for this version of Sage" I thought I would try `brew install > gcc@12`, so that a "suitable system package" would be available. After > running `./configure` again I still see > > gfortran: no suitable system package; standard, SPKG > version 12.2.0 will be installed > > Then `make` fails again as predicted. > > How can I use either the homebrew gcc@12 or gcc@14 in the build process? > Is this done by setting the `FC` environment variable? If so, to what value > should I set it? (I tried FC=gcc@12, and still had the same problem.) > > Log files are attached. > > Thanks! > > -Trevor > > Sources predicting that `gfortran` installation will fail: > https://github.com/sagemath/sage/wiki/Sage-9.6-Release-Tour > > https://ask.sagemath.org/question/63142/cannot-build-sage-from-source-on-m1-mac/ > > https://github.com/sagemath/sage/?tab=readme-ov-file#macos-preparing-the-platform > -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/6e3e0b71-78c0-4c80-9d77-a37bbafb8fb8n%40googlegroups.com.
[sage-devel] Re: Build from source on Apple Silicon M3
Thanks Matthias! I can build off of commit a8a8dd875a On Sunday, May 19, 2024 at 9:44:20 PM UTC-5 Matthias Koeppe wrote: > You'll need: > - https://github.com/sagemath/sage/pull/38025 > - https://github.com/sagemath/sage/pull/38008 > - https://github.com/sagemath/sage/pull/37919 > - https://github.com/sagemath/sage/pull/38021 > > On Sunday, May 19, 2024 at 7:04:58 PM UTC-7 Trevor Karn wrote: > >> Hi all, >> >> I am trying to build from source on Apple Silicon M3. As predicted by >> several sources (below), `gfortran` fails to build on Apple Silicon. >> >> After running `./configure` from SAGE_ROOT, I see the line: >> >> gfortran: no suitable system package; standard, >> SPKG version 12.2.0 will be installed >> Then when I `make`, the build fails with output: >> >> [gfortran-12.2.0] >> >> >> [gfortran-12.2.0] Error building gfortran-12.2.0 >> >> [gfortran-12.2.0] >> >> >> [gfortran-12.2.0] >> >> [gfortran-12.2.0] real 0m49.588s >> >> [gfortran-12.2.0] user 2m35.894s >> >> [gfortran-12.2.0] sys 1m22.419s >> >> [gfortran-12.2.0] >> >> >> [gfortran-12.2.0] Error building package gfortran-12.2.0 >> >> [gfortran-12.2.0] >> >> >> The following lines in config.log seems relevant: >> >> ## Checking whether SageMath should install SPKG gfortran... ## >> configure:18136: checking the version of gfortran >> configure:18172: Installing gfortran because gfortran is version 14, >> which is too recent for this version of Sage >> configure:18206: no suitable system package found for SPKG gfortran >> configure:18331: checking whether any of gfortran is installed as or will >> be installed as SPKG >> configure:110356: result: gfortran: no suitable >> system package; standard, SPKG version 12.2.0 will be installed >> >> Since the build wanted to install SPKG version 12.2.0 and thought 14 was >> "too recent for this version of Sage" I thought I would try `brew install >> gcc@12`, so that a "suitable system package" would be available. After >> running `./configure` again I still see >> >> gfortran: no suitable system package; standard, >> SPKG version 12.2.0 will be installed >> >> Then `make` fails again as predicted. >> >> How can I use either the homebrew gcc@12 or gcc@14 in the build process? >> Is this done by setting the `FC` environment variable? If so, to what value >> should I set it? (I tried FC=gcc@12, and still had the same problem.) >> >> Log files are attached. >> >> Thanks! >> >> -Trevor >> >> Sources predicting that `gfortran` installation will fail: >> https://github.com/sagemath/sage/wiki/Sage-9.6-Release-Tour >> >> https://ask.sagemath.org/question/63142/cannot-build-sage-from-source-on-m1-mac/ >> >> https://github.com/sagemath/sage/?tab=readme-ov-file#macos-preparing-the-platform >> > -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/59fb06e0-a649-45aa-94a1-b1ba8c3dbc2fn%40googlegroups.com.
[sage-devel] OT Efficient probabilistic factorization of F(x,y)=g(x,y) f(x,y) modulo composite integers n assuming the solution is unique
Sorry for offtopic. We give efficient probabilistic factorization of F(x,y)=g(x,y) f(x,y) modulo composite integers n assuming the solution is unique. The main contribution is the observation that `Ideal(J).groebner_basis()` is efficient for overdetermined `J` and it works modulo n The preprint is at [1] and the code is at [2] Sage session: sage: %runfile factor_groebner2.sage sage: set_random_seed(1);p1=random_prime(2**1000);p2=random_prime(p1);n=p1*p2 sage: Kxy.=Integers(n)[] sage: D2,D3=2,3 sage: g2=Kxy.random_element(degree=D2);f2=Kxy.random_element(degree=D3);F2=g2*f2 : sage: time gg=factorgroebner2(F2,D2,D3) CPU times: user 232 ms, sys: 12.8 ms, total: 245 ms Wall time: 2.68 s sage: gg[0]*gg[1]==F2 True sage: gg[0].degree(),gg[1].degree() (2, 3) [1] https://www.researchgate.net/publication/380720202_Efficient_probabilistic_algorithm_for_factoring_bivariate_polynomials_modulo_composite_integers_with_unknown_factorization_assuming_the_solution_Fxygxy_fxy_is_unique [2] https://www.guninski.com/factor_groebner2.sage -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/CAGUWgD9xxLe5vkmFp40hesFbNrdnOz_rh2gpsWMEMDZsLm51uA%40mail.gmail.com.