diff --git a/src/babyyoda/__init__.py b/src/babyyoda/__init__.py index 9c4c389..aee9a8d 100644 --- a/src/babyyoda/__init__.py +++ b/src/babyyoda/__init__.py @@ -5,10 +5,12 @@ from .read import read, read_grogu, read_yoda from .util import loc, overflow, underflow, rebin -from .Histo1D import Histo1D +from .histo1D import Histo1D +from .histo2D import Histo2D __all__ = [ "Histo1D", + "Histo2D", "read", "loc", "overflow", diff --git a/src/babyyoda/cli/main.py b/src/babyyoda/cli/main.py index d821c71..b44c928 100644 --- a/src/babyyoda/cli/main.py +++ b/src/babyyoda/cli/main.py @@ -4,8 +4,8 @@ import re from histoprint import print_hist -from babyyoda.Histo1D import Histo1D -from babyyoda.Histo2D import Histo2D +from babyyoda.histo1D import Histo1D +from babyyoda.histo2D import Histo2D def main(): diff --git a/src/babyyoda/Histo1D.py b/src/babyyoda/histo1D.py similarity index 97% rename from src/babyyoda/Histo1D.py rename to src/babyyoda/histo1D.py index 03cf19b..3d96cf1 100644 --- a/src/babyyoda/Histo1D.py +++ b/src/babyyoda/histo1D.py @@ -35,7 +35,7 @@ def __init__(self, *args, backend=None, **kwargs): backend = yoda.Histo1D except ImportError: - backend = babyyoda.grogu.histo1d_v3 + backend = babyyoda.grogu.Histo1D_v3 target = backend(*args, **kwargs) # unwrap target @@ -269,7 +269,12 @@ def plot(self, *args, binwnorm=1.0, **kwargs): import mplhep as hep hep.histplot( - self, *args, yerr=self.variances() ** 0.5, binwnorm=binwnorm, **kwargs + self, + *args, + yerr=self.variances() ** 0.5, + w2method="sqrt", + binwnorm=binwnorm, + **kwargs, ) def _ipython_display_(self): diff --git a/src/babyyoda/Histo2D.py b/src/babyyoda/histo2D.py similarity index 100% rename from src/babyyoda/Histo2D.py rename to src/babyyoda/histo2D.py diff --git a/src/babyyoda/read.py b/src/babyyoda/read.py index f5e74db..d50cbed 100644 --- a/src/babyyoda/read.py +++ b/src/babyyoda/read.py @@ -1,8 +1,8 @@ import warnings from babyyoda import grogu -from babyyoda.Histo1D import Histo1D -from babyyoda.Histo2D import Histo2D +from babyyoda.histo1D import Histo1D +from babyyoda.histo2D import Histo2D def read(file_path: str): diff --git a/tests/babyyoda/test_histo1d.py b/tests/babyyoda/test_histo1d.py index a7ffc8e..8d3e870 100644 --- a/tests/babyyoda/test_histo1d.py +++ b/tests/babyyoda/test_histo1d.py @@ -1,5 +1,5 @@ import pytest -from babyyoda.Histo1D import Histo1D +from babyyoda.histo1D import Histo1D from babyyoda.test import assert_equal_histo1d import babyyoda.grogu as grogu diff --git a/tests/babyyoda/uhi/test_by_histo1d_access.py b/tests/babyyoda/uhi/test_by_histo1d_access.py index d5ef9ec..a1719bb 100644 --- a/tests/babyyoda/uhi/test_by_histo1d_access.py +++ b/tests/babyyoda/uhi/test_by_histo1d_access.py @@ -1,5 +1,5 @@ import pytest -from babyyoda.Histo1D import Histo1D +from babyyoda.histo1D import Histo1D from babyyoda.test import assert_value1d import babyyoda diff --git a/tests/babyyoda/uhi/test_by_histo1d_slicing.py b/tests/babyyoda/uhi/test_by_histo1d_slicing.py index e0037b2..c972d42 100644 --- a/tests/babyyoda/uhi/test_by_histo1d_slicing.py +++ b/tests/babyyoda/uhi/test_by_histo1d_slicing.py @@ -1,5 +1,5 @@ import pytest -from babyyoda.Histo1D import Histo1D +from babyyoda.histo1D import Histo1D from babyyoda.test import assert_equal_histo1d import babyyoda diff --git a/tests/grogu/uhi/test_gg_histo1d_setting.py b/tests/grogu/uhi/test_gg_histo1d_setting.py index c45c293..1871628 100644 --- a/tests/grogu/uhi/test_gg_histo1d_setting.py +++ b/tests/grogu/uhi/test_gg_histo1d_setting.py @@ -1,4 +1,4 @@ -from babyyoda.Histo1D import Histo1D +from babyyoda.histo1D import Histo1D import babyyoda.grogu as yoda from babyyoda.util import loc, overflow, underflow diff --git a/tests/grogu/uhi/test_gg_histo1d_slicing.py b/tests/grogu/uhi/test_gg_histo1d_slicing.py index c1dc87e..c042446 100644 --- a/tests/grogu/uhi/test_gg_histo1d_slicing.py +++ b/tests/grogu/uhi/test_gg_histo1d_slicing.py @@ -1,4 +1,4 @@ -from babyyoda.Histo1D import Histo1D +from babyyoda.histo1D import Histo1D import babyyoda.grogu as yoda from babyyoda.test import assert_equal_histo1d from babyyoda.util import loc, overflow, underflow diff --git a/tests/yoda/test_yoda_vs_grogu.py b/tests/yoda/test_yoda_vs_grogu.py index 1666650..33353e0 100644 --- a/tests/yoda/test_yoda_vs_grogu.py +++ b/tests/yoda/test_yoda_vs_grogu.py @@ -1,7 +1,7 @@ import pytest import babyyoda as by -from babyyoda.Histo1D import Histo1D -from babyyoda.Histo2D import Histo2D +from babyyoda.histo1D import Histo1D +from babyyoda.histo2D import Histo2D from babyyoda.grogu.histo1d_v2 import GROGU_HISTO1D_V2 from babyyoda.grogu.histo2d_v2 import GROGU_HISTO2D_V2 from babyyoda.test import assert_ao, assert_equal_histo1d, assert_histo2d diff --git a/tests/yoda/uhi/test_yd_histo1d_access.py b/tests/yoda/uhi/test_yd_histo1d_access.py index 1f11785..435f017 100644 --- a/tests/yoda/uhi/test_yd_histo1d_access.py +++ b/tests/yoda/uhi/test_yd_histo1d_access.py @@ -1,5 +1,5 @@ import pytest -from babyyoda.Histo1D import Histo1D +from babyyoda.histo1D import Histo1D from babyyoda.grogu.histo1d_v2 import GROGU_HISTO1D_V2 from babyyoda.test import assert_bin1d, assert_value1d from babyyoda.util import loc, overflow, underflow diff --git a/tests/yoda/uhi/test_yd_histo1d_setting.py b/tests/yoda/uhi/test_yd_histo1d_setting.py index 5e1db85..9d16e93 100644 --- a/tests/yoda/uhi/test_yd_histo1d_setting.py +++ b/tests/yoda/uhi/test_yd_histo1d_setting.py @@ -1,5 +1,5 @@ import pytest -from babyyoda.Histo1D import Histo1D +from babyyoda.histo1D import Histo1D from babyyoda.util import loc, overflow, underflow # YODA1 does not support setting diff --git a/tests/yoda/uhi/test_yd_histo2d_access.py b/tests/yoda/uhi/test_yd_histo2d_access.py index 0367c0e..738cea1 100644 --- a/tests/yoda/uhi/test_yd_histo2d_access.py +++ b/tests/yoda/uhi/test_yd_histo2d_access.py @@ -1,5 +1,5 @@ import pytest -from babyyoda.Histo2D import Histo2D +from babyyoda.histo2D import Histo2D from babyyoda.grogu.histo2d_v2 import GROGU_HISTO2D_V2 from babyyoda.test import assert_bin2d from babyyoda.util import loc