feat!: automatic bin number calculation for variable registry#232
feat!: automatic bin number calculation for variable registry#2320ctagon merged 11 commits into8-hat:mainfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds automatic bin number calculation functionality to the variable registry system. It introduces the update_variable_registry_binning function that calculates optimal bin numbers using numpy's "auto" binning algorithm instead of the default 50 bins.
- Implements
update_variable_registry_binningfunction using numpy's histogram_bin_edges with "auto" option - Updates documentation and examples to demonstrate the new binning functionality
- Adds comprehensive test coverage for the new function including error cases and edge conditions
Reviewed Changes
Copilot reviewed 5 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/plothist/variable_registry.py | Adds the core update_variable_registry_binning function implementation |
| src/plothist/init.py | Exports the new function in the public API |
| tests/test_variable_registry.py | Comprehensive test suite for the new binning functionality |
| docs/basics/variable_registry.rst | Documentation updates explaining the new binning feature |
| src/plothist/examples/2d_hist/2d_hist_correlations.py | Example usage of the new binning function |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
0ctagon
left a comment
There was a problem hiding this comment.
Thank you for this contribution!
…le_registry_binning` functions, and
|
After discussion with @0ctagon and based on his comments, we decided to merge both |
…r` in the `update_variable_registry_binning` function
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 5 out of 8 changed files in this pull request and generated 3 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
…istency in variable registry functions
cyrraz
left a comment
There was a problem hiding this comment.
Thank you for the PR! I left a comment.
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 5 out of 8 changed files in this pull request and generated 2 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
cyrraz
left a comment
There was a problem hiding this comment.
Looks good to me. Please check my new comment.
0ctagon
left a comment
There was a problem hiding this comment.
See the small comment. PR is good for me to be merged. Don't forget to add ! in the name of the squashed commit ;)
Added the automatic bin number calculation for variable registry as suggested by the eponymous issue and updated the docs+examples.
The function work similarly to
update_variable_registry_rangesand is calledupdate_variable_registry_binning.Attached are the comparisons between the previous default binning (50) and the automatic binning using
numpy.histogram_bin_edgeswith option "auto" for thebinsvariable.Test auto-binning with 100k events:
Test_binnings_variable_0.pdf

Test auto-binning with 1k event:
Test_binnings_variable_0_1k.pdf
