Skip to content

Refactor histogram bin calculation to consistently respect max_bins#1846

Open
shreya975 wants to merge 1 commit intoData-Centric-AI-Community:developfrom
shreya975:fix-memory-usage
Open

Refactor histogram bin calculation to consistently respect max_bins#1846
shreya975 wants to merge 1 commit intoData-Centric-AI-Community:developfrom
shreya975:fix-memory-usage

Conversation

@shreya975
Copy link
Copy Markdown

Summary

This PR refactors the histogram bin calculation logic in histogram_compute to ensure consistent handling of the max_bins configuration.

Changes

  • Removed reliance on NumPy's "auto" binning strategy
  • Simplified bin calculation logic for better readability
  • Ensured bins are always capped by max_bins
  • Removed redundant fallback condition

Why

The previous implementation could lead to inconsistent bin sizes due to NumPy’s automatic bin selection. This update ensures predictable and controlled histogram behavior.

Impact

  • Improves consistency of histogram generation
  • Enhances readability and maintainability of the code
  • No breaking changes expected

@shreya975
Copy link
Copy Markdown
Author

Hi, I’ve simplified the histogram bin calculation to ensure it consistently respects max_bins and removed redundant logic. Please review and let me know if any changes are needed.

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.

1 participant