Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ dependencies = [
"plopp",
"pythreejs",
"sciline>=24.06.0",
"scipp>=23.8.0",
"scipp>=24.09.1", # Fixed new hist/bin API
"scippneutron>=24.5.0",
"scippnexus>=23.12.0",
]
Expand Down
2 changes: 1 addition & 1 deletion requirements/base.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ numpy
plopp
pythreejs
sciline>=24.06.0
scipp>=23.8.0
scipp>=24.09.1
scippneutron>=24.5.0
scippnexus>=23.12.0
26 changes: 17 additions & 9 deletions requirements/base.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SHA1:2ff97b6a96b750574b258e7cfc322df8621ef521
# SHA1:6ce1bbccfc85ced70dedc62a2266b339f1e7c814
#
# This file is autogenerated by pip-compile-multi
# To update, run:
Expand All @@ -13,19 +13,21 @@ cloudpickle==3.0.0
# via dask
comm==0.2.2
# via ipywidgets
contourpy==1.2.1
contourpy==1.3.0
# via matplotlib
cyclebane==24.6.0
# via sciline
cycler==0.12.1
# via matplotlib
dask==2024.8.1
dask==2024.8.2
# via -r base.in
decorator==5.1.1
# via ipython
essreduce==24.8.2
essreduce==24.9.0
# via -r base.in
executing==2.0.1
exceptiongroup==1.2.2
# via ipython
executing==2.1.0
# via stack-data
fonttools==4.53.1
# via matplotlib
Expand All @@ -37,9 +39,11 @@ h5py==3.11.0
# via
# scippneutron
# scippnexus
importlib-metadata==8.4.0
# via dask
ipydatawidgets==4.3.5
# via pythreejs
ipython==8.26.0
ipython==8.27.0
# via ipywidgets
ipywidgets==8.1.5
# via
Expand All @@ -49,7 +53,7 @@ jedi==0.19.1
# via ipython
jupyterlab-widgets==3.0.13
# via ipywidgets
kiwisolver==1.4.5
kiwisolver==1.4.6
# via matplotlib
locket==1.0.0
# via partd
Expand All @@ -63,7 +67,7 @@ mpltoolbox==24.5.1
# via scippneutron
networkx==3.3
# via cyclebane
numpy==2.1.0
numpy==2.1.1
# via
# -r base.in
# contourpy
Expand Down Expand Up @@ -109,7 +113,7 @@ pythreejs==2.4.2
# via -r base.in
pyyaml==6.0.2
# via dask
sciline==24.6.2
sciline==24.6.3
# via
# -r base.in
# essreduce
Expand Down Expand Up @@ -150,7 +154,11 @@ traitlets==5.14.3
# traittypes
traittypes==0.2.1
# via ipydatawidgets
typing-extensions==4.12.2
# via ipython
wcwidth==0.2.13
# via prompt-toolkit
widgetsnbextension==4.0.13
# via ipywidgets
zipp==3.20.1
# via importlib-metadata
4 changes: 2 additions & 2 deletions requirements/basetest.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#
# pip-compile-multi
#
certifi==2024.7.4
certifi==2024.8.30
# via requests
charset-normalizer==3.3.2
# via requests
Expand All @@ -15,7 +15,7 @@ idna==3.8
# via requests
iniconfig==2.0.0
# via pytest
numpy==2.1.0
numpy==2.1.1
# via
# -r basetest.in
# pandas
Expand Down
2 changes: 1 addition & 1 deletion requirements/ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#
cachetools==5.5.0
# via tox
certifi==2024.7.4
certifi==2024.8.30
# via requests
chardet==5.2.0
# via tox
Expand Down
4 changes: 2 additions & 2 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ h11==0.14.0
# via httpcore
httpcore==1.0.5
# via httpx
httpx==0.27.0
httpx==0.27.2
# via jupyterlab
isoduration==20.11.0
# via jsonschema
Expand All @@ -67,7 +67,7 @@ jupyter-server==2.14.2
# notebook-shim
jupyter-server-terminals==0.5.3
# via jupyter-server
jupyterlab==4.2.4
jupyterlab==4.2.5
# via -r dev.in
jupyterlab-server==2.27.3
# via jupyterlab
Expand Down
4 changes: 2 additions & 2 deletions requirements/docs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ beautifulsoup4==4.12.3
# pydata-sphinx-theme
bleach==6.1.0
# via nbconvert
certifi==2024.7.4
certifi==2024.8.30
# via requests
charset-normalizer==3.3.2
# via requests
Expand Down Expand Up @@ -160,7 +160,7 @@ sphinx==8.0.2
# sphinx-copybutton
# sphinx-design
# sphinxcontrib-bibtex
sphinx-autodoc-typehints==2.2.3
sphinx-autodoc-typehints==2.3.0
# via -r docs.in
sphinx-copybutton==0.5.2
# via -r docs.in
Expand Down
12 changes: 6 additions & 6 deletions requirements/nightly.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ cloudpickle==3.0.0
# via dask
comm==0.2.2
# via ipywidgets
contourpy==1.2.1
contourpy==1.3.0
# via matplotlib
cyclebane==24.6.0
# via sciline
cycler==0.12.1
# via matplotlib
dask==2024.8.1
dask==2024.8.2
# via -r nightly.in
decorator==5.1.1
# via ipython
essreduce @ git+https://github.com/scipp/essreduce@main
# via -r nightly.in
executing==2.0.1
executing==2.1.0
# via stack-data
fonttools==4.53.1
# via matplotlib
Expand All @@ -42,7 +42,7 @@ importlib-metadata==8.4.0
# via dask
ipydatawidgets==4.3.5
# via pythreejs
ipython==8.26.0
ipython==8.27.0
# via ipywidgets
ipywidgets==8.1.5
# via
Expand All @@ -52,7 +52,7 @@ jedi==0.19.1
# via ipython
jupyterlab-widgets==3.0.13
# via ipywidgets
kiwisolver==1.4.5
kiwisolver==1.4.6
# via matplotlib
locket==1.0.0
# via partd
Expand Down Expand Up @@ -135,5 +135,5 @@ wcwidth==0.2.13
# via prompt-toolkit
widgetsnbextension==4.0.13
# via ipywidgets
zipp==3.20.0
zipp==3.20.1
# via importlib-metadata
25 changes: 2 additions & 23 deletions src/ess/powder/grouping.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
# Copyright (c) 2023 Scipp contributors (https://github.com/scipp)
"""Grouping and merging of pixels / voxels."""

import scipp as sc

from .types import (
DspacingBins,
DspacingData,
Expand All @@ -14,28 +12,11 @@
)


def _drop_grouping_and_bin(
data: sc.DataArray, *, dims_to_reduce: tuple[str, ...] | None = None, edges: dict
) -> sc.DataArray:
all_pixels = data if dims_to_reduce == () else data.bins.concat(dims_to_reduce)
# all_pixels may just have a single bin now, which currently yields
# inferior performance when binning (no/bad multi-threading?).
# We operate on the content buffer for better multi-threaded performance.
if all_pixels.ndim == 0:
return (
all_pixels.value.bin(**edges)
.assign_coords(all_pixels.coords)
.assign_masks(all_pixels.masks)
)
else:
return all_pixels.bin(**edges)


def focus_data_dspacing(
data: DspacingData[RunType], dspacing_bins: DspacingBins
) -> FocussedDataDspacing[RunType]:
return FocussedDataDspacing[RunType](
_drop_grouping_and_bin(data, edges={dspacing_bins.dim: dspacing_bins})
data.bin({dspacing_bins.dim: dspacing_bins}, dim=data.dims)
)


Expand All @@ -45,9 +26,7 @@ def focus_data_dspacing_and_two_theta(
twotheta_bins: TwoThetaBins,
) -> FocussedDataDspacingTwoTheta[RunType]:
return FocussedDataDspacingTwoTheta[RunType](
data.bin({twotheta_bins.dim: twotheta_bins}).bin(
{dspacing_bins.dim: dspacing_bins}
)
data.bin({twotheta_bins.dim: twotheta_bins, dspacing_bins.dim: dspacing_bins})
)


Expand Down