You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Replace the generic else with an explicit days check and add a final fallback to error on unexpected units. This ensures only "day"/"days" are handled in this branch and guards against future unit mismatches.
Why: This change replaces a catch-all else with a specific elif units in {"day", "days"} and adds a fallback ValueError, preventing unexpected unit values from being silently treated as days.
while you're here, add a console.rule() in codeflash/discovery/functions_to_optimize.py before this block
logger.info(
f"It might take about {humanize_runtime(functions_count*three_min_in_ns)} to fully optimize this project. Codeflash "f"will keep opening pull requests as it finds optimizations."
)
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
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.
User description
Days output when converting from nanoseconds
PR Type
Enhancement, Tests
Description
Add days unit support in humanize_runtime
Explicitly handle "hour" and "hours" units
Add tests for singular and plural days
Changes walkthrough 📝
time_utils.py
Support days conversion in humanize_runtimecodeflash/code_utils/time_utils.py
elif units in {"hour","hours"}elsebranch handling"day"and"days"time_micro/(24*3600*1000**2)test_humanize_time.py
Test day(s) conversiontests/test_humanize_time.py
"day"output"days"output