Skip to content

Saransh-cpp/PyHEP22-Constructing-HEP-vectors-and-analyzing-HEP-data-using-Vector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyHEP 2022 Notebook talk - Constructing HEP vectors and analyzing HEP data using Vector

Talk Binder Open In Colab DOI

Vector is a Python library for 2D, 3D, and Lorentz vectors, including arrays of vectors, designed to solve common physics problems in a NumPy-like way. Vector currently supports pure Python Object, NumPy, Awkward, and Numba-based (Numba-Object, Numba-Awkward) backends.

This talk will focus on introducing Vector and its backends to the HEP community through a data analysis pipeline. The session will build up from pure Python Object based vectors to Awkward based vectors, ending with a demonstration of Numba support. Furthermore, we will discuss the latest developments in the library's API and showcase some recent enhancements.

Setup

There are two ways to follow along (or run this notebook after the talk) -

  1. Locally

    • Clone this repository -
    git clone https://github.com/Saransh-cpp/PyHEP22-Constructing-HEP-vectors-and-analyzing-HEP-data-using-Vector.git
    • Change directory
    cd Constructing-HEP-vectors-and-analyzing-HEP-data-using-Vector
    • Launch the classic Jupyter notebook or Jupyter lab -
    jupyter notebook
    # or
    jupyter lab
  2. On cloud (recommended)

    • Binder (recommended) Binder

    • Google Colab Open In Colab

We will be directly importing vector, awkward, numpy, numba, uproot, matplotlibn, and scikit-hep-testdata in this tutorial. Hence, a user must install these packages if this notebook is being run locally or on Google Colab.

Recent developments

Vector v0.9.0 is out!

  • Features: improved reprs, deltaRapidityPhi, backends are public now, …
  • Documentation: major documentation overhaul, doctests, CITATION.cff, …
  • Bug fixes: type checks, fix nan_to_num, …
  • Maintenance: hatchling backend, support awkward._v2 in tests, build and test on Python 3.10 and 3.11-dev, …

More about v0.9.0 here - https://vector.readthedocs.io/en/latest/changelog.html#version-0-9


Vector v0.10.0 is out too!

  • Removed support for Python 3.6

More about v0.10.0 here - https://vector.readthedocs.io/en/latest/changelog.html#version-0-10

Near future development plans

  • Better constructors (under work)
  • A benchmarking suite
  • Benchmarks against Root
  • A complete awkward v2 support (scheduled for December)
  • NumPy-Numba backend
  • Other potential backends -

Vector was scheduled to have a major release (v1.0.0) before PyHEP 2022, but that was unfortunately delayed. A major release can be expected in October, which would primarily be introducing new constructors.

Open for user feedback and discussions!

Stuck somewhere? Reach out!

  • If something is not working the way it should, or if you want to request a new feature, create a new issue on GitHub.
  • To discuss something related to vector, use the discussions tab on GitHub or vector’s gitter (Scikit-HEP/vector) chat room.
  • Have a look at vector's releases to stay up-to-date!

Cite vector

If you use vector in your work, please cite it using the following metadata -

@article{Chopra_Vector_JIT-compilable_mathematical_2025,
author = {Chopra, Saransh and Schreiner, Henry and Rodrigues, Eduardo and Eschle, Jonas and Pivarski, Jim},
doi = {10.21105/joss.07791},
journal = {Journal of Open Source Software},
month = may,
number = {109},
pages = {7791},
title = {{Vector: JIT-compilable mathematical manipulations of ragged Lorentz vectors}},
url = {https://joss.theoj.org/papers/10.21105/joss.07791},
volume = {10},
year = {2025}
}

About

PyHEP 2022 notebook talk - Constructing HEP vectors and analyzing HEP data using Vector

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •