lhapdf_management

Management script for LHAPDF files

https://github.com/scarlehoff/lhapdf_management

Science Score: 44.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
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (14.5%) to scientific vocabulary
Last synced: 8 months ago · JSON representation ·

Repository

Management script for LHAPDF files

Basic Info
  • Host: GitHub
  • Owner: scarlehoff
  • License: gpl-3.0
  • Language: Python
  • Default Branch: main
  • Size: 63.5 KB
Statistics
  • Stars: 0
  • Watchers: 1
  • Forks: 1
  • Open Issues: 2
  • Releases: 2
Created over 2 years ago · Last pushed 9 months ago
Metadata Files
Readme License Citation

readme.md

Management library for LHAPDF

This is a pure-python (unofficial) LHAPDF management library ans scripts to download, list and load PDFs using the LHAPDF format. It include a number of utilities to inspect the PDF metadata and the grids, but it is not meant to be a substitute of the LHAPDF library, only of the lhapdf script. For more information about LHAPDF please see the official repository and webpage for LHAPDF and to see their citation policy.

Install

It can be installed from PyPI with a simple command

pip install lhapdf-management

Features

This library offers a script which aims to be a drop-in replacement of the lhapdf python script (not the library!) In order not to clash with an existing installation of LHAPDF, the script name is lhapdf-management.

Update

Updates the local reference index

lhapdf-management update

If no installation of LHAPDF is found, the program will fail to do anything, as creating the LHAPDF directory is not the business of the management module. In order to run lhapdf-management and make it believe that LHAPDF already exist a possibility is to populate the LHAPDF_DATA_PATH environment variable, i.e.,

bash LHAPDF_DATA_PATH=$(python -c 'from pathlib import Path ; from sys import prefix ; print(Path(prefix) / "share" / "LHAPDF")' ; lhapdf-management update

It is also possible to create the directory in the "best guess location" by doing lhapdf_management update --init

List

Lists all available PDFs

lhapdf-management list [PATTERNS ...] [--installed] [--codes]

Install

Installs a given PDF

lhapdf-management install <pdf_name> [--upgrade] [--keep]

Open a PDF

It can also be used to programatically get an object pointing to all the right parts of a PDF. No interpolation will be provided by this script at this point and when/if it is ever provided will be done by importing the normal python interface of LHAPDF (and so at that point LHAPDF will need to be installed)

python from lhapdf_management.pdfsets import PDF from lhapdf_management.configuration import get_lhapdf_datapath data_path = get_lhapdf_datapath() pdf = PDF(data_path / "NNPDF31_nnlo_as_0118") grids = pdf.get_member_grids(0)

Programatically use the interface

A very useful feature of this library is the possibility of using everything programatically. The three given interfaces (install, list and update) take as input the same arguments as the script interface.

python from lhapdf_management import pdf_install, pdf_list, pdf_update list_of_pdfs = pdf_list("--installed") pdf_install("NNPDF31_nnlo_as_0118")

Download all PDFs matching pattern

There are some arguments that have been modified for simplicity as their behaviour can also be obtained by other means. For instance, in order to download all PDFs matching a certain pattern one can write the following short bash script:

bash for pdf in $(lhapdf-management list NNPDF31*) do lhapdf-management install ${pdf} --upgrade done

Related projects

  • A similar project providing rust bindings to LHAPDF is https://github.com/cschwan/managed-lhapdf
  • The PDFFlow library https://github.com/N3PDF/pdfflow is a drop-in replacement of the (interpolation) capabilities of LHAPDF using TensorFlow to offer hardware acceleration. It uses lhapdf-management to download the PDF files.
  • The NeoPDF library https://github.com/Radonirinaunimi/neopdf provides a drop-in replacement for LHAPDF grid interpolation with extra features for polarized or nuclear PDFs.

Owner

  • Name: Juan M. Cruz-Martinez
  • Login: scarlehoff
  • Kind: user
  • Company: CERN

Particle Physicist at CERN, andalú.

Citation (CITATION.cff)

cff-version: 1.2.0
authors:
- family-names: "Cruz-Martinez"
  given-names: "Juan M."
  orcid: "https://orcid.org/0000-0002-8061-1965"
title: "lhapdf-management"
version: 0.5
date-released: 2023-11-12
url: "https://github.com/scarlehoff/lhapdf_management"

GitHub Events

Total
  • Push event: 5
  • Pull request event: 2
  • Fork event: 1
  • Create event: 1
Last Year
  • Push event: 5
  • Pull request event: 2
  • Fork event: 1
  • Create event: 1

Committers

Last synced: over 1 year ago

All Time
  • Total Commits: 19
  • Total Committers: 1
  • Avg Commits per committer: 19.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 3
  • Committers: 1
  • Avg Commits per committer: 3.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
juacrumar j****r@l****u 19
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: over 1 year ago

All Time
  • Total issues: 2
  • Total pull requests: 3
  • Average time to close issues: 1 day
  • Average time to close pull requests: about 7 hours
  • Total issue authors: 1
  • Total pull request authors: 1
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.0
  • Merged pull requests: 3
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 1
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 1
  • Pull request authors: 0
  • Average comments per issue: 0.0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • scarlehoff (2)
Pull Request Authors
  • scarlehoff (2)
Top Labels
Issue Labels
Pull Request Labels

Dependencies

.github/workflows/lhapdf_test.yml actions
  • actions/checkout v3 composite
  • conda-incubator/setup-miniconda v2 composite
.github/workflows/pythonpublish.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
.github/workflows/test_all_pdfs.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
pyproject.toml pypi
  • numpy *
  • pyyaml *