-
Notifications
You must be signed in to change notification settings - Fork 9
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: add the Grand Unified PR (gupr) #76
base: main
Are you sure you want to change the base?
Conversation
This PR does the following: - adds a code formatter (Black) - adds a linter (ruff) - adds tests (Pytest) - documents code by adding Python docstring comments to functions and methods - attempts to address #69 - attempts to address some of the feedback in #74 There are some minor changes that aren't worth delving into in the commit message. The API has changed somewhat, so if we were using Semantic Versioning, this would be a breaking change / major version upgrade. I will go into more detail in the pull request description on GitHub.
I am super grateful for all of your effort, Liam. But at the moment I don't personally see how this PR is reviewable/mergeable. It's tantamount to a full rewrite: numerous files are deleted and new ones are created -- github at least isn't tracking whether these are just renamings or if the functionality has been split up differently. It folds in numerous independent features into a single PR: there's absolutely no reason that linting needs to be added at the same time as testing, for example. It has documentation, testing, bug fixes, and refactoring all mixed together. I appreciate that at the end of your term with Numberscope, you have a lot of different improvements you want to get in before you go, but unfortunately I don't think this single-PR approach is the fastest way to get that all accomplished. And finally, it has at least one major change in behavior (not scheduling the download of metadata and references when values are requested) that was not ever discussed as a group. I appreciate the desire to have fewer side effects, but how are we going to restore this important type of behavior? It can't possibly be the front-end's responsibility to direct the back-end to preload data that a user might want. So there has to be some mechanism in the back-end that observes the incoming requests and decides what data to pre-load. Getting the metadata and references for a sequence when its values are requested is admittedly a very elementary version of such a strategy, and one could imagine a different mechanism like a "backend supervisor demon" that looks at the request stream and decides what to preload: maybe if references are requested for a sequence, the values for all related sequences are preloaded, for example. But this PR does not supply any mechanism for cleverer preloading or any preloading at all, so in addition to everything else, it is simply removing functionality. Of course we should wait for Kate's thoughts on the matter, but I think the most efficient way for the Numberscope project to assimilate the numerous excellent improvements contained in this PR is mark this as "do not merge," and look at it as a template/roadmap for a series of more focused PRs (which likely we will have to generate on our own). If that strategy is adopted, we'd appreciate your thoughts, Liam, on the pieces this could be decomposed into and in what order they might best be merged. Also if you have any comments on the motivation/value of the significant renaming of the code files and refactoring of which bits of code go in which file, that would help us decide whether that renaming is worth doing as one step in the PR series. Thanks so much for taking the initiative to pursue so many different aspects of improving backscope. I hope we will be able ultimately to incorporate all or at least almost all of them. |
Glen wrote "I think the most efficient way for the Numberscope project to assimilate the numerous excellent improvements contained in this PR is mark this as "do not merge," and look at it as a template/roadmap for a series of more focused PRs (which likely we will have to generate on our own)." I agree that these are a lot of excellent improvements, and also that it makes sense to break it up, so maybe before you head out, you could suggest a structure for doing this, and we can work through it that way. If you can provide a bit of a roadmap for a natural order in which to do this, that would be great. |
I understand! You're right, @gwhitney, it's basically a rewrite. However, I will point that the API is almost the same. It could be pretty easily modified to be exactly the same. It also think it would be easy to add a commit to schedule getting metadata and factors. If you want to implement the things that were added in this PR in separate PRs, here's the order I'd suggest: Simplify the README / put Ubuntu installation steps in the
|
I think that is the most critical separation: refactorings should have zero behavior change, and behavior modifications should be associated with the minimal code change possible. Anyhow, thanks for the suggested outline, and when Kate and I get back to it we will try to pull code from this PR in the chunks you suggest. Best of luck in your new position! |
I am in process trying to just extract the documentation updates from this PR. It's tricky because many of the changes that were in this PR are documented (as they should have been for a fully self-consistent PR). So when extracting just the documentation improvements on main as it exists now, many of the documentation changes have to be eliminated. In any case, going through this led me to discover one other significant organizational change that this PR attempted to institute, namely permanently recording and checking in database migrations (as opposed to the procedure in main, which is to reinitialize the database from scratch whenever the schema changes). I'll add that item to the discussion on backscope's trajectory. |
The situation is similar for migrating from |
This PR does the following:
README
with comprehensive install steps #74User
codeAfter I tested a bit, I don't think this PR addresses the issue of the OEIS sequence offset never being set. We still need to obtain the offset and store it in the DB.
The API has changed somewhat, so if we were using Semantic Versioning, this would be a breaking change / major version upgrade. Specifically, the API functions
get_oeis_values
,get_oeis_metadata
, andget_oeis_factors
have been changed. It adds an API functionget_oeis_sequence
that grabs a sequence object from the database and returns it as JSON. This API function might be useful for debugging.I tried to simplify the code where I could, and I tried to eliminate side-effects. This might be a controversial decision because, for instance, hitting the
get_oeis_values
route no longer schedules getting metadata and factors. On the one hand, this is eliminating a side-effect, but on the other hand, it makes the API caller deal with the complexity of issuing a request when they want metadata or factors rather than having them eagerly scheduled.I am sure there are more changes and decisions I made that I made that aren't covered in this summary. Please ask questions when they arise. I apologize for the scope of this PR. I know it's huge. Please feel free to ask me to change things. I know it will take a long time to review this, and I appreciate your time, @katestange and @gwhitney. Also, I want to say thank you one more time to you both. I've learned a lot from working on Numberscope, and I am very grateful for your mentorship and your patience with me as a newbie software developer! :)