feat: Allow some random access to OEIS sequence data#158
Draft
gwhitney wants to merge 3 commits intonumberscope:mainfrom
Draft
feat: Allow some random access to OEIS sequence data#158gwhitney wants to merge 3 commits intonumberscope:mainfrom
gwhitney wants to merge 3 commits intonumberscope:mainfrom
Conversation
Member
|
I will try to get to this soon, but fair warning -- I had to reinstall ubuntu from scratch so it may take a little longer to get up and running with backscope again. I'm travelling in europe this week. So if @Vectornaut can get to it, that would be great. |
Collaborator
Author
|
Aaron and I discussed at meeting. I will switch to parsing the OEIS-text format and if the first link does not describe the b-file, I will just download the b-file itself (and log how many terms are found). Converting to draft until done. |
This will be more useful when we change over to having a clone of the git repository version of the OEIS, anyway. Sometimes there is no link describing the bounds of the sequence. We believe such cases only occur for sequences short enough that the only known terms are the ones in the sequence entry itself. I.e., these are very short sequences. Hence in such cases we fall back to just fetching all of the values.
Collaborator
Author
|
Done as discussed, please continue with review @Vectornaut. Thanks! |
Collaborator
Author
|
Awaiting Aaron's bugfix PR, so marking as draft again. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prior to this PR, the only endpoints for obtaining sequence values were cumulative from the beginning of the sequence to some point. This PR adds "chunked" access to sequences, in which one can use the new
get_oeis_headerendpoint to obtain the chunk size for a given sequence, and then useget_oeis_chunkto receive the Nth bundle of (at most) that many entries.Adds docs and tests for the new endpoints as well. Apparently required to complete numberscope/frontscope#420 (although it will be hard to be certain until frontscope is reconfigured to use this -- but presumably
we eventually need this, especially if/when we want to use the 100K-long entry a000040.txt for primes, for example.