From cc45d295be37adff737df5e890b3bad2adf0b359 Mon Sep 17 00:00:00 2001 From: Andrzej Novak Date: Sun, 17 Sep 2023 09:03:56 +0200 Subject: [PATCH] fix: temp mpl deprec (#443) --- src/mplhep/alice.py | 2 +- src/mplhep/atlas.py | 4 ++-- src/mplhep/cms.py | 2 +- src/mplhep/lhcb.py | 2 +- tests/test_inputs.py | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/mplhep/alice.py b/src/mplhep/alice.py index 2adb8dfb..86d20117 100644 --- a/src/mplhep/alice.py +++ b/src/mplhep/alice.py @@ -2,7 +2,7 @@ import inspect -from matplotlib import docstring +from matplotlib import _docstring as docstring import mplhep diff --git a/src/mplhep/atlas.py b/src/mplhep/atlas.py index 07c893a4..f5130772 100644 --- a/src/mplhep/atlas.py +++ b/src/mplhep/atlas.py @@ -15,7 +15,7 @@ __all__ = ("style", "lumitext") -@mpl.docstring.copy(label_base.exp_text) +@mpl._docstring.copy(label_base.exp_text) def text(text="", **kwargs): for key, value in dict(mplhep.rcParams.text._get_kwargs()).items(): if ( @@ -29,7 +29,7 @@ def text(text="", **kwargs): return label_base.exp_text("ATLAS", text=text, **kwargs) -@mpl.docstring.copy(label_base.exp_label) +@mpl._docstring.copy(label_base.exp_label) def label(label=None, **kwargs): for key, value in dict(mplhep.rcParams.label._get_kwargs()).items(): if ( diff --git a/src/mplhep/cms.py b/src/mplhep/cms.py index 15c5bee9..ef2ddcbe 100644 --- a/src/mplhep/cms.py +++ b/src/mplhep/cms.py @@ -2,7 +2,7 @@ import inspect -from matplotlib import docstring +from matplotlib import _docstring as docstring import mplhep diff --git a/src/mplhep/lhcb.py b/src/mplhep/lhcb.py index 98eb09a0..40633689 100644 --- a/src/mplhep/lhcb.py +++ b/src/mplhep/lhcb.py @@ -20,7 +20,7 @@ import inspect -from matplotlib import docstring +from matplotlib import _docstring as docstring import mplhep from mplhep import label as label_base diff --git a/tests/test_inputs.py b/tests/test_inputs.py index 5f9b571f..6bcc59a7 100644 --- a/tests/test_inputs.py +++ b/tests/test_inputs.py @@ -101,7 +101,7 @@ def test_inputs_bh_cat(): bh.axis.IntCategory(range(10)), bh.axis.StrCategory("", growth=True) ) - x = np.round(np.random.normal(5, 3, 1000)) + x = np.round(np.random.normal(5, 3, 1000)).astype(int) A, Z = np.array(["A", "Z"]).view("int32") y = list( np.random.randint(low=A, high=Z, size=1000, dtype="int32").view(f"U{1000}")[0]