-
Notifications
You must be signed in to change notification settings - Fork 23
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
Allow for irregular bin widths in hist.plot.plot_pull_array
#369
base: main
Are you sure you want to change the base?
Allow for irregular bin widths in hist.plot.plot_pull_array
#369
Commits on Jan 27, 2022
-
Allow for irregular pull widths
Assuming the axis has an `edges` attribute, I assume it should also have a `widths` attribute, so I thought we can just use that for the pull bar widths instead of calculating our own assuming a regular spacing (which might not be true). For the patch-width, we just use `right_edge - left_edge`, instead of what was done before, which dividing this difference by the number of pulls and then multiplying them again with the same number.
Configuration menu - View commit details
-
Copy full SHA for f9d5961 - Browse repository at this point
Copy the full SHA f9d5961View commit details
Commits on Feb 15, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 62c477d - Browse repository at this point
Copy the full SHA 62c477dView commit details -
Configuration menu - View commit details
-
Copy full SHA for ef4d45e - Browse repository at this point
Copy the full SHA ef4d45eView commit details
Commits on Feb 16, 2022
-
Correct values with bin width when fitting curve to hist
Necessary when doing pull plots for histograms with an axis of type `hist.axis.Variable` with varying bin widths.
Configuration menu - View commit details
-
Copy full SHA for 37b6d3d - Browse repository at this point
Copy the full SHA 37b6d3dView commit details -
Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for f697e9e - Browse repository at this point
Copy the full SHA f697e9eView commit details -
Configuration menu - View commit details
-
Copy full SHA for e764997 - Browse repository at this point
Copy the full SHA e764997View commit details -
Configuration menu - View commit details
-
Copy full SHA for 471d727 - Browse repository at this point
Copy the full SHA 471d727View commit details -
Refactor: Use mean instead of sum divided by length
Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 658e2ba - Browse repository at this point
Copy the full SHA 658e2baView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3f0e7a3 - Browse repository at this point
Copy the full SHA 3f0e7a3View commit details
Commits on Mar 11, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 8a470df - Browse repository at this point
Copy the full SHA 8a470dfView commit details
Commits on Mar 14, 2022
-
Merge remote-tracking branch 'origin/main' into feature/allow-for-irr…
…egular-pull-widths
Configuration menu - View commit details
-
Copy full SHA for 18ba205 - Browse repository at this point
Copy the full SHA 18ba205View commit details -
Test
ratio_plot
with variably-binned axes with a callableI add 2 tests - `test_image_plot_ratio_variable_axis_with_regular_bins`: Same as `test_image_plot_ratio_callable`, but use an `axis.Variable`, but set the bin edges to be regular, same as former test with `axis.Regular`. With this I just check that the plot doesn't depend on the axis type. For this we re-use the existing baseline plot. - `test_image_plot_ratio_callable_bayesian_blocks_bins`: Actually try the ratio plot with variable bin widths. For this I ran the bayesian blocks algorithm on 5000 random numbers. I used that instead of 1000 numbers because for 1000 the binning seemed very coarse for me and the fit plots just looked like a triangle. For this we create a new baseline plot. Also I added a helper function to create these `plot_ratio_callable` test for different axes/binnings in order to avoid code duplication. TODO: The baseline plots for `test_image_plot_ratio_callable_bayesian_blocks_bins` looks like something is off, the centre pull is much larger than the pull errorbars. I have to check that the bin widths are correctly taken into account in the errorbars and ratios.
Configuration menu - View commit details
-
Copy full SHA for 2d598a8 - Browse repository at this point
Copy the full SHA 2d598a8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0ac80f9 - Browse repository at this point
Copy the full SHA 0ac80f9View commit details -
Fix the tests by using re-seeding the global bit-generator
Most tests use `np.random.seed(42)` to re-seed the global RNG. Initially I didn't follow this in my tests, because according to its documentation it is not best-practice and a legacy function. > The best practice is to not reseed a BitGenerator, rather to recreate a new > one. This method is here for legacy reasons. Instead, I created a custom RNG with a seed and used that to generate my random numbers. However, the tests failed and I noticed that the random seed not only affects the numbers to fill the histogram with, but also the fit, which I can't affect via a custom RNG, so I have to re-seed the global RNG. Therefore, I fall back to using `np.random.normal`.
Configuration menu - View commit details
-
Copy full SHA for 6172c7e - Browse repository at this point
Copy the full SHA 6172c7eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 46c372c - Browse repository at this point
Copy the full SHA 46c372cView commit details
Commits on Mar 15, 2022
-
Fix: Take into account variable bin widths in _plot_ratiolike
Also update baseline with fix
Configuration menu - View commit details
-
Copy full SHA for f8bb460 - Browse repository at this point
Copy the full SHA f8bb460View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2baa648 - Browse repository at this point
Copy the full SHA 2baa648View commit details