Skip to content

Commit a67544e

Browse files
authored
Update README.md
1 parent c3af07f commit a67544e

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

README.md

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,19 @@ All the normal best-practices for Python apply; you should be in a virtual envir
4040
import boost_histogram as bh
4141

4242
# Compose axis however you like; this is a 2D histogram
43-
hist = bh.Histogram(bh.axis.Regular(2, 0, 1),
44-
bh.axis.Regular(4, 0.0, 1.0))
43+
hist = bh.Histogram(
44+
bh.axis.Regular(2, 0, 1),
45+
bh.axis.Regular(4, 0.0, 1.0),
46+
)
4547

4648
# Filling can be done with arrays, one per dimension
47-
hist.fill([.3, .5, .2],
48-
[.1, .4, .9])
49+
hist.fill(
50+
[0.3, 0.5, 0.2], [0.1, 0.4, 0.9]
51+
)
4952

5053
# Numpy array view into histogram counts, no overflow bins
5154
counts = hist.view()
55+
5256
```
5357

5458
## Features
@@ -66,6 +70,7 @@ counts = hist.view()
6670
* `bh.axis.Integer(start, stop, underflow=True, overflow=True, growth=False)`: Special high-speed version of `regular` for evenly spaced bins of width 1
6771
* `bh.axis.Variable([start, edge1, edge2, ..., stop], underflow=True, overflow=True)`: Uneven bin spacing
6872
* `bh.axis.Category([...], growth=False)`: Integer or string categories
73+
* `bh.axis.Boolean()`: A True/False axis [(known issue with slicing/selection in 0.8.0)]()
6974
* Axis features:
7075
* `.index(value)`: The index at a point (or points) on the axis
7176
* `.value(index)`: The value for a fractional bin (or bins) in the axis
@@ -91,7 +96,7 @@ counts = hist.view()
9196
* `bh.accumulator.Mean`: Running count, mean, and variance (Welfords's incremental algorithm)
9297
* `bh.accumulator.WeightedMean`: Tracks a weighted sum, mean, and variance (West's incremental algorithm)
9398
* Histogram operations
94-
* `h.rank`: The number of dimensions
99+
* `h.ndim`: The number of dimensions
95100
* `h.size or len(h)`: The number of bins
96101
* `+`: Add two histograms (storages must match types currently)
97102
* `*=`: Multiply by a scaler (not all storages) (`hist * scalar` and `scalar * hist` supported too)
@@ -121,14 +126,14 @@ counts = hist.view()
121126
* Slicing to get histogram or set array of values
122127
* `h2 = h[a:b]`: Access a slice of a histogram, cut portions go to flow bins if present
123128
* `h2 = h[:, ...]`: Using `:` and `...` supported just like Numpy
124-
* `h2 = h[::bh.sum]`: Third item in slice is the "action"
129+
* `h2 = h[::sum]`: Third item in slice is the "action"
125130
* `h[...] = array`: Set the bin contents, either include or omit flow bins
126131
* Special accessors
127132
* `bh.loc(v)`: Supply value in axis coordinates instead of bin number
128133
* `bh.underflow`: The underflow bin (use empty beginning on slice for slicing instead)
129134
* `bh.overflow`: The overflow bin (use empty end on slice for slicing instead)
130135
* Special actions (third item in slice)
131-
* `bh.sum`: Remove axes via projection; if limits are given, use those
136+
* `sum`: Remove axes via projection; if limits are given, use those
132137
* `bh.rebin(n)`: Rebin an axis
133138
* NumPy compatibility
134139
* `bh.numpy` provides faster [drop in replacements](https://boost-histogram.readthedocs.io/en/latest/usage/numpy.html) for NumPy histogram functions
@@ -156,7 +161,7 @@ These are the supported platforms for which wheels are produced using [cibuildwh
156161
| ManyLinux1 (custom GCC 9.2) | 32 & 64-bit | 2.7, 3.5, 3.6, 3.7, 3.8 |
157162
| ManyLinux2010 | 32 & 64-bit | 2.7, 3.5, 3.6, 3.7, 3.8 |
158163
| macOS 10.9+ | 64-bit | 2.7, 3.5, 3.6, 3.7, 3.8 |
159-
| Windows | 32 & 64-bit | 2.7, 3.6, 3.7, 3.8 |
164+
| Windows | 32 & 64-bit | 2.7, 3.5, 3.6, 3.7, 3.8 |
160165

161166

162167
* manylinux1: Using a custom docker container with GCC 9.2; should work but can't be called directly other compiled extensions unless they do the same thing (think that's the main caveat). Supporting 32 bits because it's there.
@@ -170,7 +175,7 @@ If you are on a Linux system that is not part of the "many" in manylinux, such a
170175

171176
#### Conda-Forge
172177

173-
The boost-histogram package is available on Conda-Forge, as well. All supported versions are available with the exception of Windows + Python 2.7, which cannot built due to the age of the compiler and conda-forge policies. Please use Pip if you *really* need Python 2.7 on Windows. You will also need the VS 2015 distributable, as described above.
178+
The boost-histogram package is available on Conda-Forge, as well. All supported versions are available with the exception of Python 2.7, which is no longer supported by conda-forge direclty. If you really need boost-histogram + Conda + Python 2.7, please open an issue.
174179

175180
```bash
176181
conda install -c conda-forge boost-histogram
@@ -225,9 +230,12 @@ This project follows the [all-contributors](https://github.com/all-contributors/
225230

226231
The [official documentation is here](https://boost-histogram.readthedocs.io/en/latest/index.html), and includes a [quickstart](https://boost-histogram.readthedocs.io/en/latest/usage/quickstart.html).
227232

233+
228234
* [2019-4-15 IRIS-HEP Topical meeting](https://indico.cern.ch/event/803122/)
229235
* [2019-10-17 PyHEP Histogram session](https://indico.cern.ch/event/833895/contributions/3577833/) - [repo with talks and workbook](https://github.com/henryiii/pres-bhandhist)
230236
* [2019-11-7 CHEP](https://indico.cern.ch/event/773049/contributions/3473265/)
237+
* [2020-07-07 SciPy](https://www.youtube.com/watch?v=ERraTfHkPd0&list=PLYx7XA2nY5GfY4WWJjG5cQZDc7DIUmn6Z&index=4)
238+
* [2020-07-17 PyHep](https://indico.cern.ch/event/882824/contributions/3931299/) (UPCOMING)
231239

232240
---
233241

0 commit comments

Comments
 (0)