-
Notifications
You must be signed in to change notification settings - Fork 71
Scheduler refactor [utils]: functions, mixins, statistics, text #290
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
Scheduler refactor [utils]: functions, mixins, statistics, text #290
Conversation
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.
Pull Request Overview
This PR implements a comprehensive refactor that consolidates statistical analysis utilities and introduces new defensive programming utilities for the GuideLLM scheduler system. The refactor moves statistics classes from the objects
package to utils
and adds new modules for safe operations, object introspection, and enhanced text processing.
- Relocates statistical analysis classes from
guidellm.objects.statistics
toguidellm.utils.statistics
- Adds new utility modules including
functions.py
for safe operations,mixins.py
for object metadata extraction, and enhancedtext.py
with display formatting - Introduces comprehensive test coverage for all new utility modules and maintains backward compatibility through import updates
Reviewed Changes
Copilot reviewed 15 out of 17 changed files in this pull request and generated 12 comments.
Show a summary per file
File | Description |
---|---|
tests/unit/utils/test_text.py | Comprehensive test suite for text processing utilities including loading, filtering, and endless text generation |
tests/unit/utils/test_statistics.py | Complete test coverage for statistical analysis utilities moved from objects package |
tests/unit/utils/test_singleton.py | Test suite for singleton pattern implementations with thread safety validation |
tests/unit/utils/test_registry.py | Tests for registry-based object discovery and registration system |
tests/unit/utils/test_pydantic_utils.py | Test coverage for Pydantic model utilities and polymorphic serialization |
tests/unit/utils/test_mixins.py | Tests for InfoMixin object introspection capabilities |
tests/unit/utils/test_functions.py | Test suite for defensive programming utilities and safe operations |
tests/unit/utils/test_auto_importer.py | Tests for automatic module importing and discovery mechanisms |
Multiple source files | Implementation of new utility modules and import path updates for statistics classes |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
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.
Once my concerns and Samuel's concerns are addressed, I think this is ready for merging.
I want to confirm that we're okay with switching to Python 3.10. Otherwise these changes would need to be revised. I don't love the idea of moving to 3.10.
d463e77
to
02f97ff
Compare
Co-authored-by: Copilot <[email protected]> Signed-off-by: Mark Kurtz <[email protected]>
… for the scheduler refactor
Co-authored-by: Copilot <[email protected]> Signed-off-by: Mark Kurtz <[email protected]>
Co-authored-by: Samuel Monson <[email protected]> Signed-off-by: Mark Kurtz <[email protected]>
Co-authored-by: Samuel Monson <[email protected]> Signed-off-by: Mark Kurtz <[email protected]>
Co-authored-by: Samuel Monson <[email protected]> Signed-off-by: Mark Kurtz <[email protected]>
fc47105
to
b70ee98
Compare
Summary
This PR adds new utility modules for safe math function operations, object info extraction, and reorganizes to consolidate into the utils package.
Details
objects
toutils
: RelocatesDistributionSummary
,Percentiles
,RunningStats
,StatusDistributionSummary
, andTimeRunningStats
fromguidellm.objects.statistics
toguidellm.utils.statistics
functions.py
module: Implements defensive programming utilities includingsafe_getattr
,safe_divide
,safe_multiply
,safe_add
,safe_format_timestamp
, andall_defined
for handling None values and edge casesmixins.py
module: ProvidesInfoMixin
class for standardized metadata extraction and object introspection across different class hierarchiestext.py
module: Adds comprehensive documentation,format_value_display
function for consistent metric formatting, and improved text processing utilitiesbenchmark
,presentation
) to import statistics classes from their new location inutils
objects
package: Deletes the now-emptyobjects
directory and associated test filesfunctions.py
,mixins.py
, andstatistics.py
__init__.py
exports: Adds new utility functions and classes to the main utils package exports for easy accessTest Plan
Related Issues
Use of AI
## WRITTEN BY AI ##
)