Skip to content

Commit 9927fec

Browse files
fix: minor things before release (#795)
* ci: auto-cancel on repeated pushes Signed-off-by: Henry Schreiner <[email protected]> * fix: better location of warning Signed-off-by: Henry Schreiner <[email protected]> * style: pre-commit fixes * docs: prepare changelog Signed-off-by: Henry Schreiner <[email protected]> * style: pre-commit fixes * docs: update examples Signed-off-by: Henry Schreiner <[email protected]> * docs: fix examples Signed-off-by: Henry Schreiner <[email protected]> * chore: include Python 3.11 classifiers Signed-off-by: Henry Schreiner <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 203812f commit 9927fec

File tree

9 files changed

+210
-139
lines changed

9 files changed

+210
-139
lines changed

.github/workflows/tests.yml

+4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ on:
1111
env:
1212
FORCE_COLOR: 3
1313

14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.ref }}
16+
cancel-in-progress: true
17+
1418
jobs:
1519
clang-tidy:
1620
name: Clang-Tidy

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ repos:
4343
rev: v2.0.0
4444
hooks:
4545
- id: setup-cfg-fmt
46-
args: [--include-version-classifiers, --max-py-version=3.10]
46+
args: [--include-version-classifiers, --max-py-version=3.11]
4747

4848
- repo: https://github.com/hadialqattan/pycln
4949
rev: v2.1.1

dev-requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ pytest-benchmark
77
setuptools >=42
88
setuptools_scm[toml] >=3.4,!=4.0.0
99
typing_extensions; python_version<'3.8'
10+
uproot

docs/changelog.md

+7-8
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,21 @@
22

33
## Version 1.3
44

5-
### WIP
6-
7-
#### Bug Fixes
8-
9-
* Avoid the constructor when creating new histograms from existing ones. [#759][]
10-
11-
[#759]: https://github.com/scikit-hep/boost-histogram/pull/759
12-
135
### Version 1.3.2
146

157
#### Changes
168

179
* Added `storage_type` operator and `storage_type()` function [#781][], with pending deprecation for `_storage_type`. [#786][] [#790][]
1810
* Better errors generated for missing or incorrect sample to mean storage. [#782][]
11+
* Better error message when views are set with an incompatible array. [#794][]
1912

2013
#### Bug fixes
2114

2215
* Patch broken sum with fully empty (0 bin) axis. [#718][]
2316
* Fix zero range `bh.numpy.histogram` to match `numpy.histogram` behavior. [#721][]
2417
* Avoid triggering `__init__` when copying (better support for subclasses with custom init's). [#759][]
18+
* IntCategory now supports numbers larger than 2^24 (now 2^53). [#792][]
19+
* Pick a subset now supported inside a larger expression. [#793][]
2520

2621
#### Backend and docs
2722

@@ -31,6 +26,7 @@
3126
* Using pybind11 2.10 [#767][]
3227
* Explicit `reset()` documentation. [#783][]
3328
* Minor cleanup and further removal of a little Python 2 back-compat code.
29+
* Warnings have better stacklevel settings.
3430

3531
[#718]: https://github.com/scikit-hep/boost-histogram/pull/718
3632
[#721]: https://github.com/scikit-hep/boost-histogram/pull/721
@@ -44,6 +40,9 @@
4440
[#786]: https://github.com/scikit-hep/boost-histogram/pull/786
4541
[#789]: https://github.com/scikit-hep/boost-histogram/pull/789
4642
[#790]: https://github.com/scikit-hep/boost-histogram/pull/790
43+
[#792]: https://github.com/scikit-hep/boost-histogram/pull/792
44+
[#793]: https://github.com/scikit-hep/boost-histogram/pull/793
45+
[#794]: https://github.com/scikit-hep/boost-histogram/pull/794
4746

4847
### Version 1.3.1
4948

notebooks/BoostHistogramHandsOn.ipynb

+174-89
Large diffs are not rendered by default.

notebooks/aghast.ipynb

+16-36
Large diffs are not rendered by default.

notebooks/xarray.ipynb

+4-4
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@
145145
"source": [
146146
"bh_bins = bh.axis.Regular(19, -4, 4)\n",
147147
"bh_hist = bh.Histogram(bh_bins).fill(np.asarray(da).flatten())\n",
148-
"plt.plot(bh_hist.axes[0].centers, bh_hist);"
148+
"plt.plot(bh_hist.axes[0].centers, bh_hist.values());"
149149
]
150150
},
151151
{
@@ -175,7 +175,7 @@
175175
"\n",
176176
" # Now compute the xarray output.\n",
177177
" return xr.DataArray(\n",
178-
" h,\n",
178+
" h.values(),\n",
179179
" name=\"_\".join(a.name for a in args) + \"_histogram\",\n",
180180
" coords=[\n",
181181
" (f\"{a.name}_bin\", arr.flatten(), a.attrs)\n",
@@ -267,7 +267,7 @@
267267
" h.fill(*prepare_fill, weight=np.asarray(prepared_weights).flatten())\n",
268268
"\n",
269269
" return xr.DataArray(\n",
270-
" h,\n",
270+
" h.values(),\n",
271271
" name=\"_\".join(a.name for a in args) + \"_histogram\",\n",
272272
" coords=[\n",
273273
" (f\"{a.name}_bin\", arr.flatten(), a.attrs)\n",
@@ -527,7 +527,7 @@
527527
"name": "python",
528528
"nbconvert_exporter": "python",
529529
"pygments_lexer": "ipython3",
530-
"version": "3.7.6"
530+
"version": "3.9.10"
531531
}
532532
},
533533
"nbformat": 4,

setup.cfg

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ classifiers =
2929
Programming Language :: Python :: 3.8
3030
Programming Language :: Python :: 3.9
3131
Programming Language :: Python :: 3.10
32+
Programming Language :: Python :: 3.11
3233
Programming Language :: Python :: Implementation :: CPython
3334
Programming Language :: Python :: Implementation :: PyPy
3435
Topic :: Scientific/Engineering

src/boost_histogram/_internal/hist.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -939,7 +939,8 @@ def __getitem__( # noqa: C901
939939

940940
if pick_set:
941941
warnings.warn(
942-
"List indexing selection is experimental. Removed bins are not placed in overflow."
942+
"List indexing selection is experimental. Removed bins are not placed in overflow.",
943+
stacklevel=2,
943944
)
944945
logger.debug("Slices for picking sets: %s", pick_set)
945946
axes = [reduced.axis(i) for i in range(reduced.rank())]

0 commit comments

Comments
 (0)