sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.39k stars 473 forks source link

Lazy OEIS sequences #28627

Closed edd8e884-f507-429a-b577-5d554626c0fe closed 4 years ago

edd8e884-f507-429a-b577-5d554626c0fe commented 5 years ago

We make the OEISSequences be (uniquely) defined as long as their ID (A-number) is known, and connect to the internet as late as possible.

CC: @fchapoton @mo271 @videlec @seblabbe

Component: combinatorics

Author: Thierry Monteil

Branch/Commit: ecd06dd

Reviewer: Sébastien Labbé

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

edd8e884-f507-429a-b577-5d554626c0fe commented 5 years ago

Branch: u/tmonteil/lazy_oeis_sequences

edd8e884-f507-429a-b577-5d554626c0fe commented 5 years ago

Commit: 446af98

edd8e884-f507-429a-b577-5d554626c0fe commented 5 years ago

New commits:

13bc675#28627 : lazy creation of OEIS sequences based only on their A-number
203f63e#28627 : different imaginary sequences must have different A-numbers
0ce1c0b#28627 : dedicated handling of dead sequences
afa2833#28627 : replace obsolete warning with a note
446af98#28627 : examples are intended for humans
edd8e884-f507-429a-b577-5d554626c0fe commented 5 years ago
comment:3

I tried to cut the changes into meaningful commits, however the block

+        TESTS::
+
+        sage: s = oeis._imaginary_sequence(ident='A004238')
+        sage: s
+        A004238: The characteristic sequence of 42 plus one, starting from 38.
+        sage: s.online_update()                         # optional -- internet
+        sage: s                                         # optional -- internet
+        A004238: a(n) = 100*log(n) rounded to nearest integer.

should appear in the second commit, not the first, since at this stage ident parameter is not defined for imaginary sequences.

You should test the whole branch, the commits are made to ease human review.

edd8e884-f507-429a-b577-5d554626c0fe commented 5 years ago
comment:4

Patchbot complains about doctest coverage regression.

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 5 years ago

Changed commit from 446af98 to ecd06dd

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 5 years ago

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

ecd06dd#28627 : fix coverage regression
edd8e884-f507-429a-b577-5d554626c0fe commented 4 years ago
comment:7

If some of the people who already handled oeis code could have a look, it will allow to move forward.

seblabbe commented 4 years ago
comment:8

Works for me. All tests passed related to oeis.

seblabbe commented 4 years ago

Reviewer: Sébastien Labbé

vbraun commented 4 years ago

Changed branch from u/tmonteil/lazy_oeis_sequences to ecd06dd