Skip to content

Commit 87bdcb6

Browse files
committed
Merge branch 'develop'
2 parents cd8dccd + ed5e35c commit 87bdcb6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+615
-255
lines changed

.all-contributorsrc

+10
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,16 @@
158158
"contributions": [
159159
"doc"
160160
]
161+
},
162+
{
163+
"login": "amangoel185",
164+
"name": "Aman Goel",
165+
"avatar_url": "https://avatars.githubusercontent.com/u/10528392?v=4",
166+
"profile": "http://amangoel.me",
167+
"contributions": [
168+
"doc",
169+
"code"
170+
]
161171
}
162172
],
163173
"contributorsPerLine": 7,

.github/workflows/examples.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- uses: actions/setup-python@v1
2121
with:
2222
python-version: '3.8'
23-
- name: Pre-install Numpy
23+
- name: Pre-install NumPy
2424
run: python -m pip install -r dev-requirements.txt nbconvert ipykernel
2525
- name: Install kernel
2626
run: python -m ipykernel install --user --name boost-hist

.github/workflows/tests.yml

+3-4
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,10 @@ jobs:
4949
strategy:
5050
fail-fast: false
5151
matrix:
52-
python-version: ["3.6", "3.9", "pypy3"]
52+
python-version: ["3.6", "3.9", "3.10-dev", "pypy3"]
5353
include:
5454
- python-version: "3.8"
5555
cmake-extras: "-DCMAKE_CXX_STANDARD=17"
56-
- python-version: "3.10-dev"
5756

5857
name: CMake Python ${{ matrix.python-version }}
5958

@@ -83,6 +82,7 @@ jobs:
8382
name: Wheels on ${{ matrix.os }}
8483
runs-on: ${{ matrix.os }}
8584
strategy:
85+
fail-fast: false
8686
matrix:
8787
os: [ubuntu-latest, windows-latest, macos-latest]
8888

@@ -91,11 +91,10 @@ jobs:
9191
with:
9292
submodules: true
9393

94-
- uses: pypa/cibuildwheel@v2.0.0a4
94+
- uses: pypa/cibuildwheel@v2.1.2
9595
env:
9696
CIBW_BUILD: cp38-win_amd64 cp310-manylinux_i686 cp37-macosx_x86_64
9797
CIBW_BUILD_VERBOSITY: 1
98-
CIBW_PRERELEASE_PYTHONS: 1
9998

10099
- uses: actions/upload-artifact@v2
101100
with:

.github/workflows/wheels.yml

+22-9
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,13 @@ on:
1717
types:
1818
- published
1919

20+
concurrency:
21+
group: wheels-${{ github.head_ref }}
22+
cancel-in-progress: true
23+
2024
env:
2125
SETUPTOOLS_SCM_PRETEND_VERSION: ${{ github.event.inputs.overrideVersion }}
22-
CIBW_ENVIRONMENT: "PIP_ONLY_BINARY=numpy SETUPTOOLS_SCM_PRETEND_VERSION=${{ github.event.inputs.overrideVersion }}"
26+
CIBW_ENVIRONMENT: "PIP_PREFER_BINARY=1 SETUPTOOLS_SCM_PRETEND_VERSION=${{ github.event.inputs.overrideVersion }}"
2327

2428
jobs:
2529
build_sdist:
@@ -34,7 +38,7 @@ jobs:
3438
run: pipx run build --sdist
3539

3640
- name: Check metadata
37-
run: pipx run twine check dist/*
41+
run: pipx run twine check --strict dist/*
3842

3943
- uses: actions/upload-artifact@v2
4044
with:
@@ -46,7 +50,7 @@ jobs:
4650
runs-on: ubuntu-20.04
4751
strategy:
4852
matrix:
49-
python: [36, 37, 38, 39]
53+
python: [36, 37, 38, 39, 310]
5054
arch: [aarch64]
5155
steps:
5256

@@ -58,7 +62,7 @@ jobs:
5862
with:
5963
platforms: all
6064

61-
- uses: pypa/cibuildwheel@v2.0.0a4
65+
- uses: pypa/cibuildwheel@v2.1.2
6266
env:
6367
CIBW_BUILD: cp${{ matrix.python }}-*
6468
CIBW_ARCHS: ${{ matrix.arch }}
@@ -79,14 +83,16 @@ jobs:
7983
strategy:
8084
fail-fast: false
8185
matrix:
82-
os: [windows-latest, macos-latest]
86+
os: [windows-latest, macos-latest, ubuntu-latest]
8387
arch: [auto64]
84-
build: ["*"]
88+
build: ["?p3?-* *macos* *win*"]
89+
CIBW_MANYLINUX_X86_64_IMAGE: [manylinux2010]
90+
CIBW_MANYLINUX_I686_IMAGE: [manylinux2010]
8591

8692
include:
8793
- os: ubuntu-latest
88-
arch: auto
89-
build: "pp*"
94+
arch: auto32
95+
build: "?p3?-*"
9096
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2010
9197
CIBW_MANYLINUX_I686_IMAGE: manylinux2010
9298

@@ -97,6 +103,13 @@ jobs:
97103
CIBW_MANYLINUX_X86_64_IMAGE: skhep/manylinuxgcc-x86_64
98104
CIBW_MANYLINUX_I686_IMAGE: skhep/manylinuxgcc-i686
99105

106+
- os: ubuntu-latest
107+
type: ManyLinux2014
108+
arch: auto
109+
build: "cp310-*"
110+
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
111+
CIBW_MANYLINUX_I686_IMAGE: manylinux2014
112+
100113
- os: macos-latest
101114
arch: universal2
102115
build: "*"
@@ -110,7 +123,7 @@ jobs:
110123
with:
111124
submodules: true
112125

113-
- uses: pypa/cibuildwheel@v2.0.0a4
126+
- uses: pypa/cibuildwheel@v2.1.2
114127
env:
115128
CIBW_BUILD: ${{ matrix.build }}
116129
CIBW_MANYLINUX_I686_IMAGE: ${{ matrix.CIBW_MANYLINUX_I686_IMAGE }}

.gitignore

+7-3
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
# Build directories
3535
/*build*
3636
/docs/_build/*
37+
/examples/*/*build*
3738
/pip-wheel-metadata/*
3839

3940
# Outputs
@@ -56,6 +57,7 @@
5657
*.swp
5758
*~
5859
*.clangd
60+
/.cache/*
5961
compile_commands.json
6062

6163
# Venvs such as /.env
@@ -68,12 +70,14 @@ compile_commands.json
6870
/node_modules/*
6971
/yarn.lock
7072
/package.json
73+
/package-lock.json
7174

7275
# Testing
7376
/.benchmarks/*
77+
/.hypothesis/*
7478

7579
# PyCharm
76-
.idea
80+
/.idea/*
7781

78-
# All-contributors
79-
package-lock.json
82+
# VSCode
83+
/.vscode/*

.pre-commit-config.yaml

+17-26
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,9 @@ ci:
44

55
repos:
66
- repo: https://github.com/psf/black
7-
rev: 21.6b0
7+
rev: 21.8b0
88
hooks:
9-
- id: black
10-
types: [file]
11-
types_or: [python, pyi]
12-
13-
- repo: https://github.com/nbQA-dev/nbQA
14-
rev: 0.13.1
15-
hooks:
16-
- id: nbqa-black
17-
additional_dependencies: [black==20.8b1]
18-
args: ["--nbqa-mutate"]
19-
20-
# - repo: https://github.com/asottile/blacken-docs
21-
# rev: v1.10.0
22-
# hooks:
23-
# - id: blacken-docs
24-
# additional_dependencies: [black==20.8b1]
25-
# args: ["--target-version=py36"]
26-
# stages: ["manual"]
9+
- id: black-jupyter
2710

2811
- repo: https://github.com/pre-commit/pre-commit-hooks
2912
rev: v4.0.1
@@ -46,20 +29,21 @@ repos:
4629
additional_dependencies: [pyyaml]
4730

4831
- repo: https://github.com/asottile/pyupgrade
49-
rev: v2.20.0
32+
rev: v2.26.0
5033
hooks:
5134
- id: pyupgrade
5235
args: [--py36-plus]
5336

5437
- repo: https://github.com/PyCQA/isort
55-
rev: 5.9.1
38+
rev: 5.9.3
5639
hooks:
5740
- id: isort
5841

5942
- repo: https://github.com/asottile/setup-cfg-fmt
6043
rev: v1.17.0
6144
hooks:
6245
- id: setup-cfg-fmt
46+
args: [--max-py-version=3.10]
6347

6448
- repo: https://github.com/pycqa/flake8
6549
rev: 3.9.2
@@ -74,21 +58,28 @@ repos:
7458
- id: mypy
7559
files: src
7660
args: []
77-
additional_dependencies: [numpy==1.20.*, uhi, types-dataclasses]
61+
additional_dependencies: [numpy==1.21.*, uhi, types-dataclasses]
7862

7963
- repo: https://github.com/mgedmin/check-manifest
8064
rev: "0.46"
8165
hooks:
8266
- id: check-manifest
8367
stages: [manual]
8468

69+
- repo: https://github.com/codespell-project/codespell
70+
rev: v2.1.0
71+
hooks:
72+
- id: codespell
73+
args: ["-L", "hist,nd,circularly,ba"]
74+
exclude: ^(notebooks/xarray.ipynb|notebooks/BoostHistogramHandsOn.ipynb)$
75+
8576
- repo: local
8677
hooks:
87-
- id: disallow-pybind
88-
name: Disallow PyBind (dual caps)
78+
- id: disallow-caps
79+
name: Disallow improper capitalization
8980
language: pygrep
90-
entry: PyBind
91-
exclude: .pre-commit.*.yaml
81+
entry: PyBind|Numpy|Cmake|CCache|Github|PyTest
82+
exclude: .pre-commit-config.yaml
9283

9384
- repo: local
9485
hooks:

README.md

+9-8
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ hist.fill(
4848
[0.1, 0.4, 0.9],
4949
)
5050

51-
# Numpy array view into histogram counts, no overflow bins
51+
# NumPy array view into histogram counts, no overflow bins
5252
values = hist.values()
5353

5454
# Make a new histogram with just the second axis, summing over the first, and
@@ -142,7 +142,7 @@ histograms can be plotted via any compatible library, such as [mplhep][].
142142
* `v = h[{0:b}]`: All actions can be represented by `axis:item` dictionary instead of by position (mostly useful for slicing)
143143
* Slicing to get histogram or set array of values
144144
* `h2 = h[a:b]`: Access a slice of a histogram, cut portions go to flow bins if present
145-
* `h2 = h[:, ...]`: Using `:` and `...` supported just like Numpy
145+
* `h2 = h[:, ...]`: Using `:` and `...` supported just like NumPy
146146
* `h2 = h[::sum]`: Third item in slice is the "action"
147147
* `h[...] = array`: Set the bin contents, either include or omit flow bins
148148
* Special accessors
@@ -186,12 +186,12 @@ platforms have wheels provided in boost-histogram:
186186

187187
| System | Arch | Python versions | PyPy versions |
188188
|---------|-----|------------------|--------------|
189-
| ManyLinux1 (custom GCC 9.2) | 32 & 64-bit | 3.7, 3.8 | |
190-
| ManyLinux2010 | 32 & 64-bit | 3.6, 3.7, 3.8, 3.9 | (64-bit) 7.3: 3.7 |
191-
| ManyLinux2014 | ARM64 | 3.6, 3.7, 3.8, 3.9 | |
192-
| macOS 10.9+ | 64-bit | 3.6, 3.7, 3.8, 3.9 | 7.3: 3.7 |
193-
| macOS Universal2 | Arm64 | 3.8, 3.9 | |
194-
| Windows | 32 & 64-bit | 3.6, 3.7, 3.8, 3.9 | (64-bit) 7.3: 3.7 |
189+
| ManyLinux1 (custom GCC 9.2) | 32 & 64-bit | 3.6, 3.7, 3.8 | |
190+
| ManyLinux2010 | 32 & 64-bit | 3.6, 3.7, 3.8, 3.9, 3.10 | (64-bit) 7.3: 3.7 |
191+
| ManyLinux2014 | ARM64 | 3.6, 3.7, 3.8, 3.9, 3.10 | |
192+
| macOS 10.9+ | 64-bit | 3.6, 3.7, 3.8, 3.9, 3.10 | 7.3: 3.7 |
193+
| macOS Universal2 | Arm64 | 3.8, 3.9, 3.10 | |
194+
| Windows | 32 & 64-bit | 3.6, 3.7, 3.8, 3.9, 3.10 | (64-bit) 7.3: 3.7 |
195195

196196

197197
* manylinux1: Using a custom docker container with GCC 9 to produce. Anything running Python 3.9 should be compatible with manylinux2010, so manylinux1 not provided for Python 3.9 (like NumPy).
@@ -255,6 +255,7 @@ We would like to acknowledge the contributors that made this project possible ([
255255
<tr>
256256
<td align="center"><a href="https://keybase.io/kgizdov"><img src="https://avatars.githubusercontent.com/u/3164953?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Konstantin Gizdov</b></sub></a><br /><a href="#platform-kgizdov" title="Packaging/porting to new platform">📦</a> <a href="https://github.com/scikit-hep/boost-histogram/issues?q=author%3Akgizdov" title="Bug reports">🐛</a></td>
257257
<td align="center"><a href="http://theoryandpractice.org"><img src="https://avatars.githubusercontent.com/u/4458890?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Kyle Cranmer</b></sub></a><br /><a href="https://github.com/scikit-hep/boost-histogram/commits?author=cranmer" title="Documentation">📖</a></td>
258+
<td align="center"><a href="http://amangoel.me"><img src="https://avatars.githubusercontent.com/u/10528392?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Aman Goel</b></sub></a><br /><a href="https://github.com/scikit-hep/boost-histogram/commits?author=amangoel185" title="Documentation">📖</a> <a href="https://github.com/scikit-hep/boost-histogram/commits?author=amangoel185" title="Code">💻</a></td>
258259
</tr>
259260
</table>
260261

docs/CHANGELOG.md

+37-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,40 @@
11
# What's new in boost-histogram
22

3+
## Version 1.2
4+
5+
### Version 1.2.0
6+
7+
#### User changes
8+
* Python 3.10 officially supported, with wheels.
9+
* Support subtraction on histograms [#636][]
10+
* Integer histograms are now signed [#636][]
11+
12+
#### Bug fixes
13+
* Support custom setters on AxesTuple subclasses. [#627][]
14+
* Faster picking if slices are not also used [#645][] or if they are [#648][] (1000x or more in some cases)
15+
* Throw an error when an AxesTuple setter is the wrong length (inspired by zip strict in Python 3.10) [#627][]
16+
* Fix error thrown on comparison with axis and non-axis object [#631][]
17+
* Static typing no longer thinks `storage=` is required [#604][]
18+
19+
#### Developer changes
20+
* Support NumPy 1.21 for static type checking [#625][]
21+
* Use newer Boost 1.77 and Boost.Histogram 1.77+1 [#594][]
22+
* Provide nox support [#647][]
23+
24+
[#594]: https://github.com/scikit-hep/boost-histogram/pull/594
25+
[#604]: https://github.com/scikit-hep/boost-histogram/pull/604
26+
[#625]: https://github.com/scikit-hep/boost-histogram/pull/625
27+
[#627]: https://github.com/scikit-hep/boost-histogram/pull/627
28+
[#631]: https://github.com/scikit-hep/boost-histogram/pull/631
29+
[#636]: https://github.com/scikit-hep/boost-histogram/pull/636
30+
[#645]: https://github.com/scikit-hep/boost-histogram/pull/645
31+
[#647]: https://github.com/scikit-hep/boost-histogram/pull/647
32+
[#648]: https://github.com/scikit-hep/boost-histogram/pull/648
33+
334
## Version 1.1
435

36+
### Version 1.1.0
37+
538
#### User changes
639
* Experimentally support list selection on categorical axes [#577][]
740
* Support Python 3.8 on Apple Silicon [#600][]
@@ -15,7 +48,7 @@
1548
#### Developer changes
1649
* Test on Python 3.10 beta releases [#600][]
1750
* Provide a CMakeLists for quick standalone Boost.Histogram C++ experiments [#591][]
18-
* Adding logging with PyTest failure output [#575][]
51+
* Adding logging with pytest failure output [#575][]
1952

2053
[#575]: https://github.com/scikit-hep/boost-histogram/pull/575
2154
[#576]: https://github.com/scikit-hep/boost-histogram/pull/576
@@ -130,7 +163,7 @@ Python 2, and mostly equivalent in API to 1.0.
130163
* Supports converting user histogram objects that provide a
131164
`_to_boost_histogram_` method. [#483][]
132165
* A `view=True` parameter must now be passed to get a View instead of a standard
133-
NumPy values arrray from `to_numpy()`. [#498][]
166+
NumPy values array from `to_numpy()`. [#498][]
134167

135168
#### Bug fixes
136169

@@ -484,7 +517,7 @@ library. Using Boost 1.72 release.
484517
* Properties on accumulator views now resolve correctly [#273][]
485518
* Division of a histogram by a number is supported again [#278][]
486519
* Setting a histogram with length one slice fixed [#279][]
487-
* Numpy functions now work with Numpy ints in `bins=` [#282][]
520+
* NumPy functions now work with NumPy ints in `bins=` [#282][]
488521
* In-place addition avoids a copy [#284][]
489522

490523
[#273]: https://github.com/scikit-hep/boost-histogram/pull/273
@@ -524,7 +557,7 @@ transition existing 0.5.x code to the new API.
524557
* `h.axes` now has the functions from axis as well. [#183][]
525558
* `bh.project` has become `bh.sum` [#185][]
526559
* `.reduce(...)` and the reducers in `bh.algorithm` have been removed in favor of dictionary based UHI slicing [#259][]
527-
* `bh.numpy` module interface updates, `histogram=bh.Histogram` replaces cryptic `bh=True`, and `density=True` is now supported in Numpy mode [#256][]
560+
* `bh.numpy` module interface updates, `histogram=bh.Histogram` replaces cryptic `bh=True`, and `density=True` is now supported in NumPy mode [#256][]
528561
* Added `hist.copy()` [#218][] and `hist.shape` [#264][]
529562
* Signatures are much nicer in Python 3 [#188][]
530563
* Reprs are better, various properties like `__module__` are now set correctly [#200][]

0 commit comments

Comments
 (0)