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

feat: Allow some random access to OEIS sequence data #158

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

gwhitney
Copy link
Collaborator

@gwhitney gwhitney commented Sep 9, 2024

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_header endpoint to obtain the chunk size for a given sequence, and then use get_oeis_chunk to 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.

@katestange
Copy link
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.

@gwhitney
Copy link
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.

@gwhitney gwhitney marked this pull request as draft September 10, 2024 23:06
  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.
@gwhitney gwhitney marked this pull request as ready for review September 18, 2024 23:56
@gwhitney
Copy link
Collaborator Author

Done as discussed, please continue with review @Vectornaut. Thanks!

@gwhitney
Copy link
Collaborator Author

Awaiting Aaron's bugfix PR, so marking as draft again.

@gwhitney gwhitney marked this pull request as draft September 24, 2024 23:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants