Skip to content

Commit 7be4f06

Browse files
authored
Merge pull request #701 from scipp/replace-bins-is-none
Use is_binned property instead of bins is [not] None
2 parents d8a03d5 + b634b34 commit 7be4f06

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ dependencies = [
3939
"numpy>=1.20",
4040
"plopp>=26.4.1",
4141
"pydantic>=2",
42-
"scipp>=25.8.0",
42+
"scipp>=25.11.0",
4343
"scippnexus>=23.11.0",
4444
"scipy>=1.7.0",
4545
]

requirements/base.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ mpltoolbox>=24.6.0
1010
numpy>=1.20
1111
plopp>=26.4.1
1212
pydantic>=2
13-
scipp>=25.8.0
13+
scipp>=25.11.0
1414
scippnexus>=23.11.0
1515
scipy>=1.7.0

src/scippneutron/_utils/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010

1111

1212
def elem_unit(var: VariableLike) -> sc.Unit:
13-
return var.bins.unit if var.bins is not None else var.unit
13+
return var.bins.unit if var.is_binned else var.unit
1414

1515

1616
def elem_dtype(var: VariableLike) -> sc.DType:
17-
return var.bins.constituents['data'].dtype if var.bins is not None else var.dtype
17+
return var.bins.constituents['data'].dtype if var.is_binned else var.dtype
1818

1919

2020
def float_dtype(var: VariableLike) -> sc.DType:

src/scippneutron/peaks/_fit_peaks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,7 @@ def _assert_data_is_supported(data: sc.DataArray) -> None:
736736
raise sc.DimensionError(
737737
f'`fit_peaks` requires 1d data, got {data.ndim} dimensions'
738738
)
739-
if data.bins is not None:
739+
if data.is_binned:
740740
raise sc.DTypeError('`fit_peaks` does not support binned data')
741741
if data.coords.is_edges(data.dim):
742742
raise sc.CoordError(

0 commit comments

Comments
 (0)