Skip to main content

Histogramming as a Service

Project description

Histogramming as a Service (HistServ)

PyPI version Conda-Forge PyPI platforms

Install PyPI

pip install histserv

Install Conda-Forge

conda install -c conda-forge histserv

Example

See example/.

Start gRPC server (or just ./example/start_server.sh):

histserv --port 50051 --n-threads 4
# INFO:histserv:Histogram server started, listening on [::]:50051 with 4 threads

Run example client:

python example/client.py
# Remote hist initialized: RemoteHist<ID=52c77c93da8146f2a72c53af269d1ab5 @[::]:50051>
# Remote hist filled successfully? -> True
# Snapshotting current hist: Hist(
#   Regular(10, -2, 2, name='x', label='X Axis'),
#   Regular(10, -2, 2, name='y', label='Y Axis'),
#   StrCategory(['data', 'drell-yan'], growth=True, name='dataset', label='Dataset'),
#   storage=Weight()) # Sum: WeightedSum(value=911503, variance=911503) (WeightedSum(value=1e+06, variance=1e+06) with flow)
# Remote hist filled successfully? -> True
# Remote hist filled successfully? -> True
# Remote hist flushed succesfully? -> Histogram (52c77c93da8146f2a72c53af269d1ab5) flushed successfully to hist.h5.

And the server logs additionally (after running the client script):

# INFO:histserv:Initialized histogram (52c77c93da8146f2a72c53af269d1ab5)
# INFO:histserv:Filled histogram (52c77c93da8146f2a72c53af269d1ab5) with 24,000,000 bytes
# INFO:histserv:Created snapshot of histogram (52c77c93da8146f2a72c53af269d1ab5)
# INFO:histserv:Filled histogram (52c77c93da8146f2a72c53af269d1ab5) with 24,000,000 bytes
# INFO:histserv:Filled histogram (52c77c93da8146f2a72c53af269d1ab5) with 24,000,000 bytes
# INFO:histserv:Flushed histogram (52c77c93da8146f2a72c53af269d1ab5) to hist.h5

Or check out how to use remote histogram filling with an example coffea Processor in example/coffea_processor.py.

Current supported types

Axis support:

  • hist.axis.Regular
  • hist.axis.Boolean
  • hist.axis.Variable
  • hist.axis.Integer
  • hist.axis.IntCategory
  • hist.axis.StrCategory

np.dtype support for hist.axis.{Regular,Variable,Integer}:

  • np.float64
  • np.float32
  • np.int64
  • np.int32

Developer Info

Install

uv pip install -e . --group=dev

Protobuf Codegen

python -m grpc_tools.protoc -Isrc/histserv/protos --python_out=src/histserv/protos --pyi_out=src/histserv/protos --grpc_python_out=src/histserv/protos src/histserv/protos/hist.proto

Maybe adjust imports in src/histserv/protos/hist_pb2_grpc.py.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

histserv-0.1.3.tar.gz (13.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

histserv-0.1.3-py3-none-any.whl (15.3 kB view details)

Uploaded Python 3

File details

Details for the file histserv-0.1.3.tar.gz.

File metadata

  • Download URL: histserv-0.1.3.tar.gz
  • Upload date:
  • Size: 13.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for histserv-0.1.3.tar.gz
Algorithm Hash digest
SHA256 780ab29b893c803d4908d1fe7d106f7377adc88b5682d5c6a0748d3a91dc3204
MD5 9c818d28d53ade1f2ec3ab8cd884e4a6
BLAKE2b-256 f06293df9f52280506e3bd232abe75813be10de137e9b340ad629bc50cd3cd65

See more details on using hashes here.

Provenance

The following attestation bundles were made for histserv-0.1.3.tar.gz:

Publisher: cd.yml on pfackeldey/histserv

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file histserv-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: histserv-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 15.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for histserv-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 0965339bea3cc91bca55eaad1fa9229b227d24c2cb5af749cd47f33ea52d06ab
MD5 cae9f7d1300905a12c3e00f16d62fc0c
BLAKE2b-256 ba7d2ce8595dbcb66aae4bbc6a0a913da407c8df8bda13ee28e01fcac3679101

See more details on using hashes here.

Provenance

The following attestation bundles were made for histserv-0.1.3-py3-none-any.whl:

Publisher: cd.yml on pfackeldey/histserv

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page