Opened 2 years ago
Closed 2 years ago
#28627 closed enhancement (fixed)
Lazy OEIS sequences
Reported by:  tmonteil  Owned by:  

Priority:  major  Milestone:  sage9.0 
Component:  combinatorics  Keywords:  
Cc:  chapoton, moritz, vdelecroix, slabbe  Merged in:  
Authors:  Thierry Monteil  Reviewers:  Sébastien Labbé 
Report Upstream:  N/A  Work issues:  
Branch:  ecd06dd (Commits, GitHub, GitLab)  Commit:  ecd06dd657ce0f97145af394fb2724565751f0fc 
Dependencies:  Stopgaps: 
Description
We make the OEISSequences
be (uniquely) defined as long as their ID (Anumber) is known, and connect to the internet as late as possible.
Change History (9)
comment:1 Changed 2 years ago by
 Branch set to u/tmonteil/lazy_oeis_sequences
comment:2 Changed 2 years ago by
 Commit set to 446af9801c51e8b9d20cd5176bad6d9d494e57ce
 Status changed from new to needs_review
comment:3 Changed 2 years ago by
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.
comment:4 Changed 2 years ago by
 Status changed from needs_review to needs_work
Patchbot complains about doctest coverage regression.
comment:5 Changed 2 years ago by
 Commit changed from 446af9801c51e8b9d20cd5176bad6d9d494e57ce to ecd06dd657ce0f97145af394fb2724565751f0fc
Branch pushed to git repo; I updated commit sha1. New commits:
ecd06dd  #28627 : fix coverage regression

comment:6 Changed 2 years ago by
 Status changed from needs_work to needs_review
comment:7 Changed 2 years ago by
 Cc chapoton moritz vdelecroix slabbe added
If some of the people who already handled oeis code could have a look, it will allow to move forward.
comment:8 Changed 2 years ago by
 Reviewers set to Sébastien Labbé
 Status changed from needs_review to positive_review
Works for me. All tests passed related to oeis.
comment:9 Changed 2 years ago by
 Branch changed from u/tmonteil/lazy_oeis_sequences to ecd06dd657ce0f97145af394fb2724565751f0fc
 Resolution set to fixed
 Status changed from positive_review to closed
New commits:
#28627 : lazy creation of OEIS sequences based only on their Anumber
#28627 : different imaginary sequences must have different Anumbers
#28627 : dedicated handling of dead sequences
#28627 : replace obsolete warning with a note
#28627 : examples are intended for humans