-
Notifications
You must be signed in to change notification settings - Fork 143
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
API refactor proposition #417
base: main
Are you sure you want to change the base?
Conversation
# Conflicts: # prepline_general/api/app.py # prepline_general/api/general.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'd feel better about a large refactor change like thais after we had a multi-thousand doc release candidate test in place, since basically right now, prod is inadvertently serving as our QA env as well.
not saying don't do it, but need to be super cautious.
Yes I agree, having tests when making refactors is crucial. Here the situation is simpler, as the only changes are moving functions between files. So no changes in logic. All existing tests pass. |
It aims to make the code structure easier to understand, navigate and modify, by:
shortening long files -
general.py
had 849 lines, now 553.by moving common functionality to separate files - endpoints.py, logging.py, validation.py, memory_protection.py
In both cases, it still could be improved (general.py shorteneded by about 300 lines, and functions moved to new files like pdf_splits.py, pipeline.py) , but had some problems with monkeypatching expecting functions in certain places, and didn't want to spend more time on it.
No other changes than moving functions betweeen files were made in this PR.