Skip to content

Commit da705af

Browse files
henryiiiHDembinski
authored andcommitted
Adding FutureWarning (#232)
1 parent c2078b7 commit da705af

File tree

4 files changed

+14
-12
lines changed

4 files changed

+14
-12
lines changed

boost_histogram/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,5 @@ class histogram(Histogram):
4848
def __init__(self, *args, **kwargs):
4949
import warnings
5050

51-
warnings.warn("Use Histogram instead of histogram")
51+
warnings.warn("Use Histogram instead of histogram", FutureWarning)
5252
super(histogram, self).__init__(*args, **kwargs)

boost_histogram/_internal/axis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ def Category(categories, **kwargs):
598598
Deprecated: Use IntCategory or StrCategory instead.
599599
This shortcut may return eventually.
600600
"""
601-
warnings.warn("Use IntCategory or StrCategory instead of Category")
601+
warnings.warn("Use IntCategory or StrCategory instead of Category", FutureWarning)
602602

603603
if len(categories) < 1:
604604
raise TypeError(

boost_histogram/_internal/hist.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,14 +295,14 @@ def axis(self, i):
295295
"""
296296
Deprecated: Use axes[] instead.
297297
"""
298-
warnings.warn("Use axes[] instead of axis()")
298+
warnings.warn("Use axes[] instead of axis()", FutureWarning)
299299
return self._axis(i)
300300

301301
def at(self, *args):
302302
"""
303303
Deprecated: Use [] instead.
304304
"""
305-
warnings.warn("Use [] indexing instead.")
305+
warnings.warn("Use [] indexing instead.", FutureWarning)
306306
return self._hist.at(*args)
307307

308308
def to_numpy(self, flow=False):

boost_histogram/axis/__init__.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
@_register()
2626
class regular(Regular):
2727
def __init__(self, *args, **kwargs):
28-
_warnings.warn("Use Regular instead")
28+
_warnings.warn("Use Regular instead", FutureWarning)
2929
return super(regular, self).__init__(*args, **kwargs)
3030

3131

@@ -34,7 +34,7 @@ class variable(Variable):
3434
_CLASSES = set()
3535

3636
def __init__(self, *args, **kwargs):
37-
_warnings.warn("Use Variable instead")
37+
_warnings.warn("Use Variable instead", FutureWarning)
3838
return super(variable, self).__init__(*args, **kwargs)
3939

4040

@@ -43,30 +43,32 @@ class integer(Integer):
4343
_CLASSES = set()
4444

4545
def __init__(self, *args, **kwargs):
46-
_warnings.warn("Use Integer instead")
46+
_warnings.warn("Use Integer instead", FutureWarning)
4747
return super(integer, self).__init__(*args, **kwargs)
4848

4949

5050
def category(*args, **kwargs):
51-
_warnings.warn("Use IntCategory or StrCategory instead")
51+
_warnings.warn("Use IntCategory or StrCategory instead", FutureWarning)
5252
return Category(*args, **kwargs)
5353

5454

5555
def regular_log(*args, **kwargs):
56-
_warnings.warn("Use transform=axis.transform.Log() instead")
56+
_warnings.warn("Use transform=axis.transform.Log() instead", FutureWarning)
5757
return Regular(*args, transform=Transform.Log, **kwargs)
5858

5959

6060
def regular_sqrt(*args, **kwargs):
61-
_warnings.warn("Use transform=axis.transform.Sqrt() instead")
61+
_warnings.warn("Use transform=axis.transform.Sqrt() instead", FutureWarning)
6262
return Regular(*args, transform=transform.Sqrt, **kwargs)
6363

6464

6565
def regular_pow(bins, start, stop, power, **kwargs):
66-
_warnings.warn("Use transform=axis.transform.Pow({0}) instead".format(power))
66+
_warnings.warn(
67+
"Use transform=axis.transform.Pow({0}) instead".format(power), FutureWarning
68+
)
6769
return Regular(bins, start, stop, transform=transform.Pow(power), **kwargs)
6870

6971

7072
def circular(*args, **kwargs):
71-
_warnings.warn("Use circular=True instead")
73+
_warnings.warn("Use circular=True instead", FutureWarning)
7274
return Regular(*args, circular=True, **kwargs)

0 commit comments

Comments
 (0)