Science Score: 64.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
✓Academic publication links
Links to: zenodo.org -
✓Committers with academic emails
6 of 23 committers (26.1%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (15.2%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
Histogramming for analysis powered by boost-histogram
Basic Info
- Host: GitHub
- Owner: scikit-hep
- License: bsd-3-clause
- Language: Python
- Default Branch: main
- Homepage: https://hist.readthedocs.io
- Size: 4.49 MB
Statistics
- Stars: 131
- Watchers: 7
- Forks: 28
- Open Issues: 80
- Releases: 28
Topics
Metadata Files
README.md

Hist
Hist is an analyst-friendly front-end for boost-histogram, designed for Python 3.9+ (3.6-3.8 users get older versions). See what's new.

Installation
You can install this library from PyPI with pip:
bash
python3 -m pip install "hist[plot,fit]"
If you do not need the plotting features, you can skip the [plot] and/or
[fit] extras. [fit] is not currently supported in WebAssembly.
Features
Hist currently provides everything boost-histogram provides, and the following enhancements:
Hist augments axes with names:
name=is a unique label describing each axis.label=is an optional string that is used in plotting (defaults tonameif not provided).- Indexing, projection, and more support named axes.
- Experimental
NamedHistis aHistthat disables most forms of positional access, forcing users to use only names.
The
Histclass augmentsbh.Histogramwith simpler construction:flow=Falseis a fast way to turn off flow for the axes on construction.- Storages can be given by string.
storage=can be omitted, strings and storages can be positional.data=can initialize a histogram with existing data.Hist.from_columnscan be used to initialize with a DataFrame or dict.- You can cast back and forth with boost-histogram (or any other extensions).
Hist support QuickConstruct, an import-free construction system that does not require extra imports:
- Use
Hist.new.<axis>().<axis>().<storage>(). - Axes names can be full (
Regular) or short (Reg). - Histogram arguments (like
data=) can go in the storage.
- Use
Extended Histogram features:
- Direct support for
.nameand.label, like axes. .density()computes the density as an array..profile(remove_ax)can convert a ND COUNT histogram into a (N-1)D MEAN histogram..sort(axis)supports sorting a histogram by a categorical axis. Optionally takes a function to sort by..fill_flattened(...)will flatten and fill, including support for AwkwardArray..integrate(...), which takes the opposite arguments as.project.
- Direct support for
Hist implements UHI+; an extension to the UHI (Unified Histogram Indexing) system designed for import-free interactivity:
- Uses
jsuffix to switch to data coordinates in access or slices. - Uses
jsuffix on slices to rebin. - Strings can be used directly to index into string category axes.
- Uses
Quick plotting routines encourage exploration:
.plot()provides 1D and 2D plots (or useplot1d(),plot2d()).plot2d_full()shows 1D projects around a 2D plot..plot_ratio(...)make a ratio plot between the histogram and another histogram or callable..plot_pull(...)performs a pull plot..plot_pie()makes a pie plot..show()provides a nice str printout using Histoprint.
Stacks: work with groups of histograms with identical axes
- Stacks can be created with
h.stack(axis), using index or name of an axis (StrCategoryaxes ideal). - You can also create with
hist.stacks.Stack(h1, h2, ...), or usefrom_iterorfrom_dict. - You can index a stack, and set an entry with a matching histogram.
- Stacks support
.plot()and.show(), with names (plot labels default to original axes info). - Stacks pass through
.project,*,+, and-.
- Stacks can be created with
New modules
intervalssupports frequentist coverage intervals.
Notebook ready: Hist has gorgeous in-notebook representation.
- No dependencies required
Usage
```python from hist import Hist
Quick construction, no other imports needed:
h = ( Hist.new.Reg(10, 0, 1, name="x", label="x-axis") .Var(range(10), name="y", label="y-axis") .Int64() )
Filling by names is allowed:
h.fill(y=[1, 4, 6], x=[0.3, 0.5, 0.2])
Names can be used to manipulate the histogram:
h.project("x") h[{"y": 0.5j + 3, "x": 5j}]
You can access data coordinates or rebin with a j suffix:
h[0.3j:, ::2j] # x from .3 to the end, y is rebinned by 2
Elegant plotting functions:
h.plot() h.plot2dfull() h.plotpull(Callable) ```
Development
From a git checkout, either use nox, or run:
bash
python -m pip install -e .[dev]
See Contributing guidelines for information on setting up a development environment.
Contributors
We would like to acknowledge the contributors that made this project possible (emoji key): <!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --> <!-- prettier-ignore-start --> <!-- markdownlint-disable -->
Henry Schreiner 🚧 💻 📖 |
Nino Lau 🚧 💻 📖 |
Chris Burr 💻 |
Nick Amin 💻 |
Eduardo Rodrigues 💻 |
Andrzej Novak 💻 |
Matthew Feickert 💻 |
Kyle Cranmer 📖 |
Daniel Antrim 💻 |
Nicholas Smith 💻 |
Michael Eliachevitch 💻 |
Jonas Eschle 📖 |
This project follows the all-contributors specification.
Talks
- 2021-07-07 PyHEP 2021 -- High-Performance Histogramming for HEP Analysis 🎥
- 2020-09-08 IRIS-HEP/GSOC -- Hist: histogramming for analysis powered by boost-histogram 🎥
- 2020-07-07 SciPy Proceedings 🎥
- 2020-07-17 PyHEP 2020 🎥
Acknowledgements
This library was primarily developed by Henry Schreiner and Nino Lau.
Support for this work was provided by the National Science Foundation cooperative agreement OAC-1836650 (IRIS-HEP) and OAC-1450377 (DIANA/HEP). Any opinions, findings, conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of the National Science Foundation.
Owner
- Name: Scikit-HEP Project
- Login: scikit-hep
- Kind: organization
- Email: scikit-hep-forum@googlegroups.com
- Website: https://scikit-hep.org
- Repositories: 46
- Profile: https://github.com/scikit-hep
A community project for High Energy Physics data analysis in Python
Citation (CITATION.cff)
cff-version: 1.2.0 message: "Please cite the following works when using this software." type: software title: "hist" abstract: "Hist is an analyst-friendly front-end for boost-histogram, designed for Python 3.7+." authors: - family-names: "Schreiner" given-names: "Henry" orcid: "https://orcid.org/0000-0002-7833-783X" affiliation: "Princeton University" - family-names: "Liu" given-names: "Shuo" affiliation: "Columbia University in the City of New York" - family-names: "Goel" given-names: "Aman" orcid: "https://orcid.org/0000-0003-3567-2096" affiliation: "University of Delhi" doi: 10.5281/zenodo.4057112 repository-code: "https://github.com/scikit-hep/hist" url: "https://hist.readthedocs.io/" keywords: - python - histogram - scikit-hep license: "BSD-3-Clause"
GitHub Events
Total
- Create event: 22
- Release event: 2
- Issues event: 15
- Watch event: 3
- Delete event: 23
- Issue comment event: 26
- Push event: 61
- Pull request review comment event: 2
- Pull request event: 55
- Pull request review event: 3
- Fork event: 4
Last Year
- Create event: 22
- Release event: 2
- Issues event: 15
- Watch event: 3
- Delete event: 23
- Issue comment event: 26
- Push event: 61
- Pull request review comment event: 2
- Pull request event: 55
- Pull request review event: 3
- Fork event: 4
Committers
Last synced: 9 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Henry Schreiner | h****r@c****h | 201 |
| pre-commit-ci[bot] | 6****] | 110 |
| N!no | n****l@g****m | 61 |
| Aman Goel | a****5@g****m | 28 |
| dependabot[bot] | 4****] | 25 |
| allcontributors[bot] | 4****] | 10 |
| Matthew Feickert | m****t@c****h | 9 |
| Andrzej Novak | n****j@g****m | 6 |
| Eduardo Rodrigues | e****s@c****h | 3 |
| Saransh | s****1@g****m | 2 |
| Lindsey Gray | l****y@g****m | 2 |
| Fabrice MUKARAGE | 7****E | 2 |
| Sourcery AI | u****n | 1 |
| Alexander Puck Neuwirth | A****y | 1 |
| Angus Hollands | g****5@g****m | 1 |
| Chris Burr | c****r | 1 |
| Daniel Antrim | d****3@g****m | 1 |
| Jonas Eschle | j****e@c****h | 1 |
| Kyle Cranmer | k****r@c****h | 1 |
| Michael Eliachevitch | m****h@p****e | 1 |
| Nicholas Smith | n****h@c****h | 1 |
| Nick Amin | a****j@g****m | 1 |
| sourcery-ai[bot] | 5****] | 1 |
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 63
- Total pull requests: 185
- Average time to close issues: 6 months
- Average time to close pull requests: 13 days
- Total issue authors: 37
- Total pull request authors: 18
- Average comments per issue: 1.71
- Average comments per pull request: 0.32
- Merged pull requests: 154
- Bot issues: 0
- Bot pull requests: 94
Past Year
- Issues: 6
- Pull requests: 54
- Average time to close issues: 6 days
- Average time to close pull requests: 16 days
- Issue authors: 5
- Pull request authors: 10
- Average comments per issue: 1.67
- Average comments per pull request: 0.09
- Merged pull requests: 36
- Bot issues: 0
- Bot pull requests: 21
Top Authors
Issue Authors
- andrzejnovak (10)
- henryiii (4)
- goi42 (4)
- matthewfeickert (3)
- yimuchen (3)
- yurivict (3)
- L61 (2)
- jpivarski (2)
- alexander-held (2)
- bfonta (2)
- acampove (2)
- Dominic-Stafford (2)
- mpad (1)
- DraTeots (1)
- andreypz (1)
Pull Request Authors
- pre-commit-ci[bot] (67)
- henryiii (59)
- dependabot[bot] (36)
- matthewfeickert (6)
- amangoel185 (5)
- andrzejnovak (5)
- lgray (3)
- Saransh-cpp (2)
- Jammf (2)
- jonas-eschle (2)
- harry-patcher (2)
- APN-Pucky (2)
- LovelyBuggies (1)
- agoose77 (1)
- fabriceMUKARAGE (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 4
-
Total downloads:
- pypi 362,004 last-month
- Total docker downloads: 122
-
Total dependent packages: 23
(may contain duplicates) -
Total dependent repositories: 64
(may contain duplicates) - Total versions: 71
- Total maintainers: 4
pypi.org: hist
Hist classes and utilities
- Homepage: https://github.com/scikit-hep/hist
- Documentation: https://hist.readthedocs.io/
- License: BSD License
-
Latest release: 2.8.1
published 11 months ago
Rankings
Maintainers (3)
proxy.golang.org: github.com/scikit-hep/hist
- Documentation: https://pkg.go.dev/github.com/scikit-hep/hist#section-documentation
- License: bsd-3-clause
-
Latest release: v2.8.1+incompatible
published 11 months ago
Rankings
conda-forge.org: hist
- Homepage: https://github.com/scikit-hep/hist
- License: BSD-3-Clause
-
Latest release: 2.6.2
published over 3 years ago
Rankings
spack.io: py-hist
Hist classes and utilities
- Homepage: https://github.com/scikit-hep/hist
- License: []
-
Latest release: 2.6.1
published over 3 years ago
Rankings
Maintainers (1)
Dependencies
- actions/checkout v3 composite
- actions/download-artifact v3 composite
- actions/upload-artifact v3 composite
- pypa/gh-action-pypi-publish v1.6.4 composite
- actions/checkout v3 composite
- actions/setup-python v4 composite
- pre-commit/action v3.0.0 composite
- actions/labeler main composite
- boost-histogram ~=1.3.1
- histoprint >=2.2.0
- numpy >=1.14.5
- typing-extensions >=3.7;python_version<"3.8"