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

API refactor proposition #417

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Conversation

hubert-rutkowski85
Copy link
Contributor

@hubert-rutkowski85 hubert-rutkowski85 commented May 23, 2024

It aims to make the code structure easier to understand, navigate and modify, by:

  1. shortening long files - general.py had 849 lines, now 553.

  2. 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.

@hubert-rutkowski85 hubert-rutkowski85 marked this pull request as ready for review May 23, 2024 12:16
# Conflicts:
#	prepline_general/api/app.py
#	prepline_general/api/general.py
Copy link
Contributor

@cragwolfe cragwolfe left a 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.

@hubert-rutkowski85
Copy link
Contributor Author

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.

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.

4 participants