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

Move filterwarnings calls from sage.all to sage.all__sagemath_repl #35160

Merged
merged 2 commits into from
Mar 26, 2023

Conversation

mkoeppe
Copy link
Contributor

@mkoeppe mkoeppe commented Feb 19, 2023

📚 Description

We can use sage -t to test with a top-level environment other than sage.all using the parameter --environment=sage.all__sagemath_categories etc.

To make sure that the warnings configuration is also set up in this case, we move the filterwarnings calls from sage.all to sage.all__sagemath_repl. (The doctester loads sage.repl.)

📝 Checklist

  • 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

@codecov-commenter
Copy link

codecov-commenter commented Feb 19, 2023

Codecov Report

Base: 88.60% // Head: 88.58% // Decreases project coverage by -0.02% ⚠️

Coverage data is based on head (a2c64dc) compared to base (8f5bbd2).
Patch coverage: 86.95% of modified lines in pull request are covered.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #35160      +/-   ##
===========================================
- Coverage    88.60%   88.58%   -0.02%     
===========================================
  Files         2140     2140              
  Lines       397273   397271       -2     
===========================================
- Hits        352004   351940      -64     
- Misses       45269    45331      +62     
Impacted Files Coverage Δ
src/sage/all__sagemath_repl.py 89.65% <86.36%> (+89.65%) ⬆️
src/sage/all.py 97.24% <100.00%> (+1.75%) ⬆️
...e/combinat/cluster_algebra_quiver/mutation_type.py 49.76% <0.00%> (-3.21%) ⬇️
src/sage/interfaces/qsieve.py 71.30% <0.00%> (-2.61%) ⬇️
src/sage/modular/local_comp/liftings.py 98.33% <0.00%> (-1.67%) ⬇️
src/sage/cpython/_py2_random.py 75.20% <0.00%> (-1.24%) ⬇️
src/sage/schemes/elliptic_curves/hom_velusqrt.py 94.09% <0.00%> (-1.19%) ⬇️
src/sage/modular/modform/numerical.py 94.19% <0.00%> (-0.65%) ⬇️
...sage/geometry/hyperbolic_space/hyperbolic_model.py 88.95% <0.00%> (-0.62%) ⬇️
src/sage/modular/arithgroup/congroup_gamma0.py 94.41% <0.00%> (-0.56%) ⬇️
... and 21 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@github-actions
Copy link

Documentation preview for this PR is ready! 🎉
Built with commit: a2c64dc

@mkoeppe mkoeppe requested a review from tornaria February 24, 2023 06:22
@tornaria
Copy link
Contributor

I guess this is unrelated to the current PR, I copy it here so it won't get lost.

sage -t --random-seed=46211102795342700483820211214572761418 sage/schemes/elliptic_curves/ell_field.py
**********************************************************************
File "sage/schemes/elliptic_curves/ell_field.py", line 1345, in sage.schemes.elliptic_curves.ell_field.EllipticCurve_field.isogenies_prime_degree
Failed example:
    E.isogenies_prime_degree(max_l=3)
Exception raised:
    Traceback (most recent call last):
      File "sage/structure/category_object.pyx", line 839, in sage.structure.category_object.CategoryObject.getattr_from_category
        return self.__cached_methods[name]
    KeyError: 'point_homset'

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/__w/sage/sage/src/sage/schemes/projective/projective_subscheme.py", line 122, in point
        return self._point(self.point_homset(), v, check=check)
      File "/__w/sage/sage/src/sage/schemes/elliptic_curves/ell_point.py", line 256, in __init__
        point_homset = curve.point_homset()
      File "sage/structure/category_object.pyx", line 833, in sage.structure.category_object.CategoryObject.__getattr__
        return self.getattr_from_category(name)
      File "sage/structure/category_object.pyx", line 848, in sage.structure.category_object.CategoryObject.getattr_from_category
        attr = getattr_from_other_class(self, cls, name)
      File "sage/cpython/getattr.pyx", line 356, in sage.cpython.getattr.getattr_from_other_class
        raise AttributeError(dummy_error_message)
    AttributeError: 'sage.rings.polynomial.polynomial_zz_pex.Polynomial_ZZ_pEX' object has no attribute '__custom_name'

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/__w/sage/sage/src/sage/doctest/forker.py", line 695, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/__w/sage/sage/src/sage/doctest/forker.py", line 1093, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.schemes.elliptic_curves.ell_field.EllipticCurve_field.isogenies_prime_degree[15]>", line 1, in <module>
        E.isogenies_prime_degree(max_l=Integer(3))
      File "/__w/sage/sage/src/sage/schemes/elliptic_curves/ell_field.py", line 1448, in isogenies_prime_degree
        return sum([isogenies_prime_degree(self, d) for d in L], [])
      File "/__w/sage/sage/src/sage/schemes/elliptic_curves/ell_field.py", line 1448, in <listcomp>
        return sum([isogenies_prime_degree(self, d) for d in L], [])
      File "/__w/sage/sage/src/sage/schemes/elliptic_curves/isogeny_small_degree.py", line 2337, in isogenies_prime_degree
        return isogenies_3(E, minimal_models=minimal_models)
      File "/__w/sage/sage/src/sage/schemes/elliptic_curves/isogeny_small_degree.py", line 756, in isogenies_3
        isogs = [E.isogeny(f, model=model) for f in ff]
      File "/__w/sage/sage/src/sage/schemes/elliptic_curves/isogeny_small_degree.py", line 756, in <listcomp>
        isogs = [E.isogeny(f, model=model) for f in ff]
      File "/__w/sage/sage/src/sage/schemes/elliptic_curves/ell_field.py", line 1215, in isogeny
        return EllipticCurveIsogeny(self, kernel, codomain, degree, model, check=check)
      File "/__w/sage/sage/src/sage/schemes/elliptic_curves/ell_curve_isogeny.py", line 974, in __init__
        if not isinstance(kernel, list) and kernel in E:
      File "/__w/sage/sage/src/sage/schemes/elliptic_curves/ell_generic.py", line 442, in __contains__
        P = self(P)
      File "/__w/sage/sage/src/sage/schemes/elliptic_curves/ell_generic.py", line 570, in __call__
        return plane_curve.ProjectivePlaneCurve.__call__(self, *args, **kwds)
      File "/__w/sage/sage/src/sage/schemes/generic/scheme.py", line 266, in __call__
        return self.point(args)
      File "/__w/sage/sage/src/sage/schemes/projective/projective_subscheme.py", line 124, in point
        return self._point(self, v, check=check)
      File "/__w/sage/sage/src/sage/schemes/elliptic_curves/ell_point.py", line 268, in __init__
        raise TypeError("v (=%s) must have %s components" % (v, d))
      File "sage/structure/sage_object.pyx", line 194, in sage.structure.sage_object.SageObject.__repr__
        result = reprfunc()
      File "sage/rings/polynomial/polynomial_element.pyx", line 2696, in sage.rings.polynomial.polynomial_element.Polynomial._repr_
        return self._repr()
      File "sage/rings/polynomial/polynomial_element.pyx", line 2648, in sage.rings.polynomial.polynomial_element.Polynomial._repr
        coeffs = self.list(copy=False)
      File "sage/rings/polynomial/polynomial_zz_pex.pyx", line 201, in sage.rings.polynomial.polynomial_zz_pex.Polynomial_ZZ_pEX.list
        return [K(ZZ_pE_c_to_list(ZZ_pEX_coeff(self.x, i)))
      File "sage/structure/parent.pyx", line 896, in sage.structure.parent.Parent.__call__
        return mor._call_(x)
      File "sage/structure/coerce_maps.pyx", line 161, in sage.structure.coerce_maps.DefaultConvertMap_unique._call_
        raise
      File "sage/structure/coerce_maps.pyx", line 156, in sage.structure.coerce_maps.DefaultConvertMap_unique._call_
        return C._element_constructor(x)
      File "/__w/sage/sage/src/sage/categories/sets_cat.py", line 1010, in _element_constructor_from_element_class
        return self.element_class(self, *args, **keywords)
      File "sage/rings/finite_rings/element_pari_ffelt.pyx", line 335, in sage.rings.finite_rings.element_pari_ffelt.FiniteFieldElement_pari_ffelt.__init__
        self.construct_from(x)
      File "sage/rings/finite_rings/element_pari_ffelt.pyx", line 503, in sage.rings.finite_rings.element_pari_ffelt.FiniteFieldElement_pari_ffelt.construct_from
        self.construct_from(self._parent.polynomial_ring()([Fp(y) for y in x]))
      File "sage/rings/finite_rings/element_pari_ffelt.pyx", line 493, in sage.rings.finite_rings.element_pari_ffelt.FiniteFieldElement_pari_ffelt.construct_from
        self.construct_from(x.substitute(self._parent.gen()))
      File "sage/rings/polynomial/polynomial_element.pyx", line 438, in sage.rings.polynomial.polynomial_element.Polynomial.subs
        return self(*x, **kwds)
      File "sage/rings/polynomial/polynomial_zmod_flint.pyx", line 327, in sage.rings.polynomial.polynomial_zmod_flint.Polynomial_zmod_flint.__call__
        return Polynomial.__call__(self, *x, **kwds)
      File "sage/rings/polynomial/polynomial_element.pyx", line 876, in sage.rings.polynomial.polynomial_element.Polynomial.__call__
        cst, aa = coercion_model.canonical_coercion(cst, a)
      File "sage/structure/coerce.pyx", line 1311, in sage.structure.coerce.CoercionModel.canonical_coercion
        x_elt = (<Map>x_map)._call_(x)
      File "sage/rings/finite_rings/hom_prime_finite_field.pyx", line 94, in sage.rings.finite_rings.hom_prime_finite_field.FiniteFieldHomomorphism_prime._call_
        return self._codomain._element_constructor(x)
      File "/__w/sage/sage/src/sage/categories/sets_cat.py", line 1010, in _element_constructor_from_element_class
        return self.element_class(self, *args, **keywords)
      File "sage/rings/finite_rings/element_pari_ffelt.pyx", line 335, in sage.rings.finite_rings.element_pari_ffelt.FiniteFieldElement_pari_ffelt.__init__
        self.construct_from(x)
      File "sage/rings/finite_rings/element_pari_ffelt.pyx", line 409, in sage.rings.finite_rings.element_pari_ffelt.FiniteFieldElement_pari_ffelt.construct_from
        sig_on()
    SystemError: calling remove_from_pari_stack() inside sig_on()
**********************************************************************
1 item had failures:
   1 of  43 in sage.schemes.elliptic_curves.ell_field.EllipticCurve_field.isogenies_prime_degree
    [323 tests, 1 failure, 7.77 s]

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Feb 24, 2023

I agree, it's unrelated; just more trouble with PARI

@tornaria
Copy link
Contributor

Works for me, tested in void linux x86_64.

I wonder:;

  • what is the process to remove stuff from filterwarnings?
  • how can we check which deprecation warnings are being dealt with?

I just worry that we silence deprecation warnings and miss the chance to fix the issues before functionality is removed.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Feb 25, 2023

Thank you!

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Feb 25, 2023

I wonder:

  • what is the process to remove stuff from filterwarnings?
  • how can we check which deprecation warnings are being dealt with?

I just worry that we silence deprecation warnings and miss the chance to fix the issues before functionality is removed.

It would probably be a good idea to create an Issue whenever such a deprecation warning is silenced.

I think most of the filtered warnings are/were coming from upstream packages that had not been updated yet. Instead of attempting to patch the packages, we'd just add the filter.

@vbraun vbraun merged commit 366d0cf into sagemath:develop Mar 26, 2023
@mkoeppe mkoeppe added this to the sage-10.0 milestone Mar 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants