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
{{ message }}
Repository navigation
Switch to using numpy to calculate bin edges in histogram where possible and calculate bin edges in consistent way #8011
numpy now has several methods for estimating bin widths. Some are the same as those in astropy, some are different. When possible, we should use the numpy methods (e.g. for 'scott' and 'freedman' (which numpy calls 'fd')).
I opened #17391 to address the bug part.
Relying on numpy more (for freedman and scott) seems doable but I noted that it also gives slightly different bin edges (at least for the scott estimator). Given that tests use assert_allclose for bin edges I'd assume that we may not need to guarantee exact backward compatibility in this area but maybe I'm being overly optimistic.
Activity
bsipocz commentedon Oct 28, 2018
These methods got added to numpy 1.11, so we're all in the clear to switch to those given they are available in all numpy versions we support.
TST: add regression tests for astropygh-8011
neutrinoceros commentedon Nov 14, 2024
I opened #17391 to address the bug part.
Relying on numpy more (for
freedmanandscott) seems doable but I noted that it also gives slightly different bin edges (at least for thescottestimator). Given that tests useassert_allclosefor bin edges I'd assume that we may not need to guarantee exact backward compatibility in this area but maybe I'm being overly optimistic.TST: add regression tests for astropygh-8011