Aghast: aggregated, histogram-like statistics, sharable as Flatbuffers.
Project description
aghast
Aghast is a histogramming library that does not fill histograms and does not plot them. Its role is behind the scenes, to provide better communication between histogramming libraries.
Specifically, it is a structured representation of aggregated, histogram-like statistics as sharable "ghasts." It has all of the "bells and whistles" often associated with plain histograms, such as number of entries, unbinned mean and standard deviation, bin errors, associated fit functions, profile plots, and even simple ntuples (needed for unbinned fits or machine learning applications). ROOT has all of these features; Numpy has none of them.
The purpose of aghast is to be an intermediate when converting ROOT histograms into Numpy, or vice-versa, or both of these into Boost.Histogram, Physt, Pandas, etc. Without an intermediate representation, converting between N libraries (to get the advantages of all) would equire N(N ‒ 1)/2 conversion routines; with an intermediate representation, we only need N, and the mapping of feature to feature can be made explicit in terms of a common language.
Furthermore, aghast is a Flatbuffers schema, so it can be deciphered in many languages, with lazy, random-access, and uses a small amount of memory. A collection of histograms, functions, and ntuples can be shared among processes as shared memory, used in remote procedure calls, processed incrementally in a memory-mapped file, or saved in files with future-proof schema evolution.
Installation from packages
Not on PyPI or conda yet. Refer to manual installation.
Manual installation
After you git-clone this GitHub repository and ensure that numpy
is installed, somehow:
pip install "flatbuffers>=1.8.0" # for the flatbuffers Python runtime with Numpy interface
cd python # only implementation so far is in Python
python setup.py install # if you want to use it outside of this directory
Now you should be able to import aghast
or from aghast import *
in Python.
If you need to change flatbuffers/aghast.fbs
, you'll need to additionally:
- Get
flatc
to generate Python sources fromflatbuffers/aghast.fbs
. I useconda install -c conda-forge flatbuffers
. (Theflatc
executable is not included in the pipflatbuffers
package, and the Python runtime is not included in the condaflatbuffers
package. They're disjoint.) - In the
python
directory, run./generate_flatbuffers.py
(which callsflatc
and does some post-processing).
Every time you change flatbuffers/aghast.fbs
, re-run ./generate_flatbuffers.py
.
Documentation
Suite of examples as a Jupyter notebook:
Full specification:
- Introduction
- Data types
- Collection
- Histogram
- Axis
- IntegerBinning
- RegularBinning
- RealInterval
- RealOverflow
- HexagonalBinning
- EdgesBinning
- IrregularBinning
- CategoryBinning
- SparseRegularBinning
- FractionBinning
- PredicateBinning
- VariationBinning
- Variation
- Assignment
- UnweightedCounts
- WeightedCounts
- InterpretedInlineBuffer
- InterpretedInlineInt64Buffer
- InterpretedInlineFloat64Buffer
- InterpretedExternalBuffer
- Profile
- Statistics
- Moments
- Quantiles
- Modes
- Extremes
- StatisticFilter
- Covariance
- ParameterizedFunction
- Parameter
- EvaluatedFunction
- BinnedEvaluatedFunction
- Ntuple
- Column
- NtupleInstance
- Chunk
- ColumnChunk
- Page
- RawInlineBuffer
- RawExternalBuffer
- Metadata
- Decoration
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file aghast-0.1.0rc3.tar.gz
.
File metadata
- Download URL: aghast-0.1.0rc3.tar.gz
- Upload date:
- Size: 90.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.7.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9128723166c7a56aa39d768b4bf684fd981bbb35639c1c40201487d002aa35c7 |
|
MD5 | c00074f7e081d1a2c9e929d43d6bf874 |
|
BLAKE2b-256 | 2591f2fa7ba03c4bd053c77b21481767a313e794ff0c32693a4063e576fad74a |
File details
Details for the file aghast-0.1.0rc3-py2.py3-none-any.whl
.
File metadata
- Download URL: aghast-0.1.0rc3-py2.py3-none-any.whl
- Upload date:
- Size: 132.6 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.7.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a188f4e635529b61157843ffff3548f9903933f63dfb80b5acc84c86932269f |
|
MD5 | 62824af12544592f1f80186fa5934d40 |
|
BLAKE2b-256 | d1e6973edd266f966ba6dd2cc5130d416efe46323310e3c7c94a1071696d7732 |