Closed benjaminpkane closed 1 week ago
The pull request modifies the sizeBytesEstimate
function and its corresponding test suite. The function's logic is updated to ensure it returns a minimum value of 1, even if the computed size is zero. Additionally, the test suite is adjusted to reflect this change, specifically updating the expected output for a test case involving non-object inputs. All other tests remain unchanged.
File Path | Change Summary |
---|---|
app/packages/utilities/src/size-bytes-estimate.test.ts | Updated expected output for a test case with non-object input, changing the expectation from 0 to 1 . |
app/packages/utilities/src/size-bytes-estimate.ts | Modified return statement to use Math.max(sizer(object), 1) to ensure a minimum return value of 1 . |
sizeBytesEstimate
function's behavior and expected outputs as modified in the main PR.In the land of bytes where rabbits play,
A function changed its tune today.
No more zeros, just a one,
Non-object inputs now have fun!
Hopping through tests, we celebrate,
Size estimates now feel just great! 🐇✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
What changes are proposed in this pull request?
Size estimates for LRU cache must be > 0
How is this patch tested? If it is not, please explain why.
Unit test
Release Notes
What areas of FiftyOne does this PR affect?
fiftyone
Python library changesSummary by CodeRabbit
New Features
sizeBytesEstimate
function to ensure it returns a minimum value of 1 for non-object inputs, enhancing the function's reliability.Bug Fixes