Refactored codebase for improved clarity and readability#2
Open
Georges-Procurified wants to merge 5 commits intohttpie:mainfrom
Open
Refactored codebase for improved clarity and readability#2Georges-Procurified wants to merge 5 commits intohttpie:mainfrom
Georges-Procurified wants to merge 5 commits intohttpie:mainfrom
Conversation
Reordered the functions to follow a chronological order
Refactor and improve code readability for order key generation - Improved function and variable naming for clarity (e.g., renamed `a`, `b`, `x`, `i` to `start_key`, `end_key`, `integer_str`, `integer_length`). - Added comprehensive and consistent docstrings to all functions, providing better explanations for inputs, outputs, and behavior. - Refactored `midpoint` logic to simplify complex calculations, improving readability and modularity. - Broke down parts of `increment_integer` and `decrement_integer` into clearer steps. - Applied input validation for functions to ensure robustness and better error handling (e.g., added checks in `generate_key_between`). - Simplified redundant checks for `None` values across multiple functions by consolidating logic. - Enhanced error messages in `OrderKeyError` for better debugging clarity. - Applied type hints consistently across all functions.
- Added type hints across all functions - renamed parameter n to number_of_keys - renamed function midpoint to find_middle_key
- moved helper functions out of main fractional_indexing.py - updated tests.py with new imports and error name
- moved handlers to main due to circular imports - adjusted imports to be local, not relative
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.
Hello! I want to start by saying I love this project—it's been incredibly useful to me! I would love to contribute by performing some refactoring and cleanup to make the code more intuitive and self-documenting.
Here’s a summary of the changes I made:
fractional_indexing.pyinto separate modules for better organization.All changes were tested locally, and I'm happy to report that 100% of the tests passed, maintaining the original functionality.
I’d love to know how I can contribute these changes back to the project. Could you guide me through the process?
Looking forward to your response!
Best regards,
Georges