Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
henryiii committed Sep 16, 2021
2 parents cd8dccd + ed5e35c commit 87bdcb6
Show file tree
Hide file tree
Showing 60 changed files with 615 additions and 255 deletions.
10 changes: 10 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,16 @@
"contributions": [
"doc"
]
},
{
"login": "amangoel185",
"name": "Aman Goel",
"avatar_url": "https://avatars.githubusercontent.com/u/10528392?v=4",
"profile": "http://amangoel.me",
"contributions": [
"doc",
"code"
]
}
],
"contributorsPerLine": 7,
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- uses: actions/setup-python@v1
with:
python-version: '3.8'
- name: Pre-install Numpy
- name: Pre-install NumPy
run: python -m pip install -r dev-requirements.txt nbconvert ipykernel
- name: Install kernel
run: python -m ipykernel install --user --name boost-hist
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,10 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.6", "3.9", "pypy3"]
python-version: ["3.6", "3.9", "3.10-dev", "pypy3"]
include:
- python-version: "3.8"
cmake-extras: "-DCMAKE_CXX_STANDARD=17"
- python-version: "3.10-dev"

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

Expand Down Expand Up @@ -83,6 +82,7 @@ jobs:
name: Wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]

Expand All @@ -91,11 +91,10 @@ jobs:
with:
submodules: true

- uses: pypa/cibuildwheel@v2.0.0a4
- uses: pypa/cibuildwheel@v2.1.2
env:
CIBW_BUILD: cp38-win_amd64 cp310-manylinux_i686 cp37-macosx_x86_64
CIBW_BUILD_VERBOSITY: 1
CIBW_PRERELEASE_PYTHONS: 1

- uses: actions/upload-artifact@v2
with:
Expand Down
31 changes: 22 additions & 9 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,13 @@ on:
types:
- published

concurrency:
group: wheels-${{ github.head_ref }}
cancel-in-progress: true

env:
SETUPTOOLS_SCM_PRETEND_VERSION: ${{ github.event.inputs.overrideVersion }}
CIBW_ENVIRONMENT: "PIP_ONLY_BINARY=numpy SETUPTOOLS_SCM_PRETEND_VERSION=${{ github.event.inputs.overrideVersion }}"
CIBW_ENVIRONMENT: "PIP_PREFER_BINARY=1 SETUPTOOLS_SCM_PRETEND_VERSION=${{ github.event.inputs.overrideVersion }}"

jobs:
build_sdist:
Expand All @@ -34,7 +38,7 @@ jobs:
run: pipx run build --sdist

- name: Check metadata
run: pipx run twine check dist/*
run: pipx run twine check --strict dist/*

- uses: actions/upload-artifact@v2
with:
Expand All @@ -46,7 +50,7 @@ jobs:
runs-on: ubuntu-20.04
strategy:
matrix:
python: [36, 37, 38, 39]
python: [36, 37, 38, 39, 310]
arch: [aarch64]
steps:

Expand All @@ -58,7 +62,7 @@ jobs:
with:
platforms: all

- uses: pypa/cibuildwheel@v2.0.0a4
- uses: pypa/cibuildwheel@v2.1.2
env:
CIBW_BUILD: cp${{ matrix.python }}-*
CIBW_ARCHS: ${{ matrix.arch }}
Expand All @@ -79,14 +83,16 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [windows-latest, macos-latest]
os: [windows-latest, macos-latest, ubuntu-latest]
arch: [auto64]
build: ["*"]
build: ["?p3?-* *macos* *win*"]
CIBW_MANYLINUX_X86_64_IMAGE: [manylinux2010]
CIBW_MANYLINUX_I686_IMAGE: [manylinux2010]

include:
- os: ubuntu-latest
arch: auto
build: "pp*"
arch: auto32
build: "?p3?-*"
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2010
CIBW_MANYLINUX_I686_IMAGE: manylinux2010

Expand All @@ -97,6 +103,13 @@ jobs:
CIBW_MANYLINUX_X86_64_IMAGE: skhep/manylinuxgcc-x86_64
CIBW_MANYLINUX_I686_IMAGE: skhep/manylinuxgcc-i686

- os: ubuntu-latest
type: ManyLinux2014
arch: auto
build: "cp310-*"
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
CIBW_MANYLINUX_I686_IMAGE: manylinux2014

- os: macos-latest
arch: universal2
build: "*"
Expand All @@ -110,7 +123,7 @@ jobs:
with:
submodules: true

- uses: pypa/cibuildwheel@v2.0.0a4
- uses: pypa/cibuildwheel@v2.1.2
env:
CIBW_BUILD: ${{ matrix.build }}
CIBW_MANYLINUX_I686_IMAGE: ${{ matrix.CIBW_MANYLINUX_I686_IMAGE }}
Expand Down
10 changes: 7 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
# Build directories
/*build*
/docs/_build/*
/examples/*/*build*
/pip-wheel-metadata/*

# Outputs
Expand All @@ -56,6 +57,7 @@
*.swp
*~
*.clangd
/.cache/*
compile_commands.json

# Venvs such as /.env
Expand All @@ -68,12 +70,14 @@ compile_commands.json
/node_modules/*
/yarn.lock
/package.json
/package-lock.json

# Testing
/.benchmarks/*
/.hypothesis/*

# PyCharm
.idea
/.idea/*

# All-contributors
package-lock.json
# VSCode
/.vscode/*
43 changes: 17 additions & 26 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,9 @@ ci:

repos:
- repo: https://github.com/psf/black
rev: 21.6b0
rev: 21.8b0
hooks:
- id: black
types: [file]
types_or: [python, pyi]

- repo: https://github.com/nbQA-dev/nbQA
rev: 0.13.1
hooks:
- id: nbqa-black
additional_dependencies: [black==20.8b1]
args: ["--nbqa-mutate"]

# - repo: https://github.com/asottile/blacken-docs
# rev: v1.10.0
# hooks:
# - id: blacken-docs
# additional_dependencies: [black==20.8b1]
# args: ["--target-version=py36"]
# stages: ["manual"]
- id: black-jupyter

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

- repo: https://github.com/asottile/pyupgrade
rev: v2.20.0
rev: v2.26.0
hooks:
- id: pyupgrade
args: [--py36-plus]

- repo: https://github.com/PyCQA/isort
rev: 5.9.1
rev: 5.9.3
hooks:
- id: isort

- repo: https://github.com/asottile/setup-cfg-fmt
rev: v1.17.0
hooks:
- id: setup-cfg-fmt
args: [--max-py-version=3.10]

- repo: https://github.com/pycqa/flake8
rev: 3.9.2
Expand All @@ -74,21 +58,28 @@ repos:
- id: mypy
files: src
args: []
additional_dependencies: [numpy==1.20.*, uhi, types-dataclasses]
additional_dependencies: [numpy==1.21.*, uhi, types-dataclasses]

- repo: https://github.com/mgedmin/check-manifest
rev: "0.46"
hooks:
- id: check-manifest
stages: [manual]

- repo: https://github.com/codespell-project/codespell
rev: v2.1.0
hooks:
- id: codespell
args: ["-L", "hist,nd,circularly,ba"]
exclude: ^(notebooks/xarray.ipynb|notebooks/BoostHistogramHandsOn.ipynb)$

- repo: local
hooks:
- id: disallow-pybind
name: Disallow PyBind (dual caps)
- id: disallow-caps
name: Disallow improper capitalization
language: pygrep
entry: PyBind
exclude: .pre-commit.*.yaml
entry: PyBind|Numpy|Cmake|CCache|Github|PyTest
exclude: .pre-commit-config.yaml

- repo: local
hooks:
Expand Down
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ hist.fill(
[0.1, 0.4, 0.9],
)

# Numpy array view into histogram counts, no overflow bins
# NumPy array view into histogram counts, no overflow bins
values = hist.values()

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

| System | Arch | Python versions | PyPy versions |
|---------|-----|------------------|--------------|
| ManyLinux1 (custom GCC 9.2) | 32 & 64-bit | 3.7, 3.8 | |
| ManyLinux2010 | 32 & 64-bit | 3.6, 3.7, 3.8, 3.9 | (64-bit) 7.3: 3.7 |
| ManyLinux2014 | ARM64 | 3.6, 3.7, 3.8, 3.9 | |
| macOS 10.9+ | 64-bit | 3.6, 3.7, 3.8, 3.9 | 7.3: 3.7 |
| macOS Universal2 | Arm64 | 3.8, 3.9 | |
| Windows | 32 & 64-bit | 3.6, 3.7, 3.8, 3.9 | (64-bit) 7.3: 3.7 |
| ManyLinux1 (custom GCC 9.2) | 32 & 64-bit | 3.6, 3.7, 3.8 | |
| ManyLinux2010 | 32 & 64-bit | 3.6, 3.7, 3.8, 3.9, 3.10 | (64-bit) 7.3: 3.7 |
| ManyLinux2014 | ARM64 | 3.6, 3.7, 3.8, 3.9, 3.10 | |
| macOS 10.9+ | 64-bit | 3.6, 3.7, 3.8, 3.9, 3.10 | 7.3: 3.7 |
| macOS Universal2 | Arm64 | 3.8, 3.9, 3.10 | |
| Windows | 32 & 64-bit | 3.6, 3.7, 3.8, 3.9, 3.10 | (64-bit) 7.3: 3.7 |


* 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).
Expand Down Expand Up @@ -255,6 +255,7 @@ We would like to acknowledge the contributors that made this project possible ([
<tr>
<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>
<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>
<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>
</tr>
</table>

Expand Down
41 changes: 37 additions & 4 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,40 @@
# What's new in boost-histogram

## Version 1.2

### Version 1.2.0

#### User changes
* Python 3.10 officially supported, with wheels.
* Support subtraction on histograms [#636][]
* Integer histograms are now signed [#636][]

#### Bug fixes
* Support custom setters on AxesTuple subclasses. [#627][]
* Faster picking if slices are not also used [#645][] or if they are [#648][] (1000x or more in some cases)
* Throw an error when an AxesTuple setter is the wrong length (inspired by zip strict in Python 3.10) [#627][]
* Fix error thrown on comparison with axis and non-axis object [#631][]
* Static typing no longer thinks `storage=` is required [#604][]

#### Developer changes
* Support NumPy 1.21 for static type checking [#625][]
* Use newer Boost 1.77 and Boost.Histogram 1.77+1 [#594][]
* Provide nox support [#647][]

[#594]: https://github.com/scikit-hep/boost-histogram/pull/594
[#604]: https://github.com/scikit-hep/boost-histogram/pull/604
[#625]: https://github.com/scikit-hep/boost-histogram/pull/625
[#627]: https://github.com/scikit-hep/boost-histogram/pull/627
[#631]: https://github.com/scikit-hep/boost-histogram/pull/631
[#636]: https://github.com/scikit-hep/boost-histogram/pull/636
[#645]: https://github.com/scikit-hep/boost-histogram/pull/645
[#647]: https://github.com/scikit-hep/boost-histogram/pull/647
[#648]: https://github.com/scikit-hep/boost-histogram/pull/648

## Version 1.1

### Version 1.1.0

#### User changes
* Experimentally support list selection on categorical axes [#577][]
* Support Python 3.8 on Apple Silicon [#600][]
Expand All @@ -15,7 +48,7 @@
#### Developer changes
* Test on Python 3.10 beta releases [#600][]
* Provide a CMakeLists for quick standalone Boost.Histogram C++ experiments [#591][]
* Adding logging with PyTest failure output [#575][]
* Adding logging with pytest failure output [#575][]

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

#### Bug fixes

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

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

0 comments on commit 87bdcb6

Please sign in to comment.