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

Adapt to deprecation of seeding based on hashing in Python 3.9 #30765

Closed
slel opened this issue Oct 13, 2020 · 20 comments
Closed

Adapt to deprecation of seeding based on hashing in Python 3.9 #30765

slel opened this issue Oct 13, 2020 · 20 comments

Comments

@slel
Copy link
Member

slel commented Oct 13, 2020

Python 3.9 deprecates seeding based on hashing.

This causes a doctest failure in Sage 9.2.rc0 using Python 3.9:

sage -t --long --random-seed=0 src/sage/rings/polynomial/pbori/randompoly.py
**********************************************************************
File "src/sage/rings/polynomial/pbori/randompoly.py", line 46, in sage.rings.polynomial.pbori.randompoly.?
Failed example:
    s=sparse_random_system(r, number_of_polynomials = 20, variables_per_polynomial = 3, degree=2, random_seed=123)
    DeprecationWarning: Seeding based on hashing is deprecated
    since Python 3.9 and will be removed in a subsequent version. The only 
    supported seed types are: None, int, float, str, bytes, and bytearray.

First discussed at #30184 (comments 25, 33, 40, 55).

CC: @kiwifb @mkoeppe @slel

Component: refactoring

Keywords: seed, hash, pbori, polybori, randompoly, deprecation

Author: Frédéric Chapoton

Branch/Commit: de815db

Reviewer: Dima Pasechnik

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

@slel slel added this to the sage-9.2 milestone Oct 13, 2020
@slel

This comment has been minimized.

@slel
Copy link
Member Author

slel commented Oct 13, 2020

comment:1

Possible workaround: silence the deprecation warning for now,
as we did in other cases.

See for instance:

@mkoeppe mkoeppe modified the milestones: sage-9.2, sage-9.3 Oct 24, 2020
@fchapoton
Copy link
Contributor

Commit: c53d261

@fchapoton
Copy link
Contributor

Author: Frédéric Chapoton

@fchapoton
Copy link
Contributor

Branch: u/chapoton/30765

@fchapoton
Copy link
Contributor

comment:3

I have made some general cleanup of pbori/

I have forced the seeds to be int. Would you please tell me if this removes the warning ?


New commits:

c53d261some cleanup in pbori

@dimpase
Copy link
Member

dimpase commented Nov 6, 2020

comment:5

this does work with Python 3.9.0 - it does fix that warning.

@dimpase
Copy link
Member

dimpase commented Nov 6, 2020

Reviewer: Dima Pasechnik

@dimpase
Copy link
Member

dimpase commented Nov 6, 2020

comment:6

lgtm

@vbraun
Copy link
Member

vbraun commented Nov 7, 2020

comment:7

Merge conflict

@dimpase
Copy link
Member

dimpase commented Nov 7, 2020

Changed commit from c53d261 to f291ad0

@dimpase
Copy link
Member

dimpase commented Nov 7, 2020

comment:8

rebased over the latest beta


New commits:

f291ad0some cleanup in pbori

@dimpase
Copy link
Member

dimpase commented Nov 7, 2020

Changed branch from u/chapoton/30765 to public/30765

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Nov 8, 2020

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

07b868bsome doc details in fglm.py

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Nov 8, 2020

Changed commit from f291ad0 to 07b868b

@fchapoton
Copy link
Contributor

comment:10

ok, I changed a few more details in the doc of fglm.

I will allow myself to set this back to positive.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Nov 8, 2020

Changed commit from 07b868b to de815db

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Nov 8, 2020

Branch pushed to git repo; I updated commit sha1 and set ticket back to needs_review. New commits:

de815dbfurther docstring improvement, ref. added

@dimpase
Copy link
Member

dimpase commented Nov 8, 2020

comment:12

ok, this works, too.

@vbraun
Copy link
Member

vbraun commented Nov 20, 2020

Changed branch from public/30765 to de815db

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants