Skip to main content

Example HEP files for testing and demonstrating

Project description

scikit-hep-testdata

Scikit-HEP PyPI version Conda latest release

Github Actions badge Code Coverage pre-commit.ci status Code style: black

A common package to provide example files (e.g. ROOT) for testing and developing packages against. The sample of files is representative of typical files found "in the wild".

In addition to including some root files directly, this package adds some simple helper methods to get larger files from common open-access data repositories.

Installing and usage

To install:

python -m pip install scikit-hep-testdata

Once installed, absolute file paths can be resolved using the helper methods:

from skhep_testdata import data_path

filename = data_path("some_file.root")

By default, if an unknown file is requested an exception is raised but this can be skipped by passing the above method raise_missing=False:

filename = data_path("unknown_file.root", raise_missing=False)

The files are not stored on PyPI, so if installed from SDist/wheel, the "local" files will not be present, but will be downloaded from GitHub and cached in the ~/.local/skhepdata directory. If you make an editable install from the Git repo, or if you set SKHEP_DATA=1 when building/installing from the Git repo, you will have the data files locally.

You can see all "local" files with skhep_testdata.known_files, and you can download all files at once with skhep_testdata.download_all(), optionally selecting the download cache directory.

Remote vs. Local files

Some files, particularly large ones, for example, are not stored within this package and instead live on a remote server; we call these "remote files". To obtain these use the same data_path method as above, however this will trigger the code to download and configure the remote file. This might be slow the first time round but will subsequently be as fast as for a local file. WARNING: the local file caching system has not yet been applied to remote files.

Command-line invocation

You can also interact with this package from the command-line:

# Print a path (download if needed)
python -m skhep_testdata cms_hep_2012_tutorial/data.root

# Show all "local" files
python -m skhep_testdata --list

# Download all files to an existing directory
python -m skhep_testdata --all --dir local

You can also use pipx run scikit-hep-testdata to access the above CLI without installing.

Adding new files

We're on the look out for new, interesting files!

  • Large files: If the file is particularly large, for example > 25 MB, it might be worth adding to an external open access data repository and adding a configuration here so that the internal helper methods can pull this down.
  • Experiment data policies: Please make sure you have permissions to add the file to this collection, and that any private or sensitive data has been appropriately masked, salted, or scrambled.

List of files

The following lists describe the files known by this package.

Files stored in this package

Known remote files

Contributors

We hereby acknowledge the contributors that made this project possible (emoji key):

benkrikler
benkrikler

💻 📖
Jim Pivarski
Jim Pivarski

🚧 🔣 📖
Henry Schreiner
Henry Schreiner

🚧 🔣 💻 📖
Eduardo Rodrigues
Eduardo Rodrigues

🚧 🔣 💻
Matthew Feickert
Matthew Feickert

🔣 💻
Pratyush Das
Pratyush Das

🔣 💻
Jerry Ling
Jerry Ling

🔣 💻
Jonas Eschle
Jonas Eschle

💻
Giordon Stark
Giordon Stark

🔣 💻
Dmitry Kalinkin
Dmitry Kalinkin

🔣
Michele Peresano
Michele Peresano

🔣
Luis Antonio Obis Aparicio
Luis Antonio Obis Aparicio

🔣
Oksana Shadura
Oksana Shadura

🔣
Nicholas Smith
Nicholas Smith

🔣
Beojan Stanislaus
Beojan Stanislaus

🔣
Lukas
Lukas

🔣
Johannes Schumann
Johannes Schumann

🔣
Elliott Kauffman
Elliott Kauffman

🔣
Tom Eichlersmith
Tom Eichlersmith

🔣
Alexander Puck Neuwirth
Alexander Puck Neuwirth

🔣
ioanaif
ioanaif

🔣

This project follows the all-contributors specification.

Acknowledgements

  • Many of the files collected directly within this package were collated originally by Jim Pivarski for uproot

Running the tests

This package uses pytest to run the unit tests. Install with pip install scikit-hep-testdata[test] or pip install -e .[test] (dev) to get the testing requirements. then run:

pytest

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

scikit_hep_testdata-0.4.46.tar.gz (29.8 kB view details)

Uploaded Source

Built Distribution

scikit_hep_testdata-0.4.46-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

File details

Details for the file scikit_hep_testdata-0.4.46.tar.gz.

File metadata

  • Download URL: scikit_hep_testdata-0.4.46.tar.gz
  • Upload date:
  • Size: 29.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for scikit_hep_testdata-0.4.46.tar.gz
Algorithm Hash digest
SHA256 48a962441ff1e673eb6325231a260f4f142c25090b00bae57c412111d19d0c9b
MD5 17ecf790e3303eeb81a214ffc8a6b07a
BLAKE2b-256 e631f3fc5ff65153fbecf0e364b2294653df0543991b6a47368001061271428b

See more details on using hashes here.

File details

Details for the file scikit_hep_testdata-0.4.46-py3-none-any.whl.

File metadata

File hashes

Hashes for scikit_hep_testdata-0.4.46-py3-none-any.whl
Algorithm Hash digest
SHA256 83faf4a68b480d35210d86c40b508a67e09b911264408d67833e7cdc99d6ac5f
MD5 d3cbed5e5fb5073977efb259dcca6786
BLAKE2b-256 310bca581472ffd6fe81550ca01fc48da847f94d5077405024aeb4e6b6f9b6fd

See more details on using hashes here.

Supported by

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