nnpdf_data.cli package

Command Line Interface for nnpdf-data.

Submodules

nnpdf_data.cli.index module

Index the whole set of data plus a few nice utilities.

nnpdf_data.cli.index.build_index(skip_failures=True, skip_special=True)[source]

Build the dataset index by scanning and loading all possible metadata files found in all possible data paths.

If any metadata file cannot be read, simply skip it.

nnpdf_data.cli.index.filter_index(entries: dict, pattern: str = '*')[source]

Filter entries by the glob-expanded pattern pattern.

nnpdf_data.cli.index.sort_index(entries: dict, sort_key: str)[source]

Sort a dictionary by a existing key in the entries of the dictionary.

nnpdf_data.cli.inspire module

INSPIRE API client to fetch bibtex entries.

class nnpdf_data.cli.inspire.BibliographyEntry(key: str, raw_bibtex: str)[source]

Bases: object

A parsed BibTeX bibliography entry.

key: str
raw_bibtex: str
exception nnpdf_data.cli.inspire.InspireError[source]

Bases: Exception

nnpdf_data.cli.inspire.fetch_bibtex(record_int: int)[source]

Wrapper around _fetch_bibtex to convert known exceptions into Nones

nnpdf_data.cli.latex module

class nnpdf_data.cli.latex.LatexDatasetRow(dataset_name: str, dataset_label: str, observable_description: str, experiment: str, process: str, nnpdf31_process: str, bib_entry: BibliographyEntry)[source]

Bases: object

All information needed to write a LaTeX row.

bib_entry: BibliographyEntry
property bib_key
property bibtex_text
dataset_label: str
dataset_name: str
experiment: str
nnpdf31_process: str
observable_description: str
process: str
nnpdf_data.cli.latex.build_latex_rows(datasets, group_by=None) → dict[source]

Go over a list of datasets, use the inspire API to get their bibtex references and generate a list of LatexDatasetRow.

If group_by is given, the output is grouped by the given key. Otherwise, the dictionary contain just one key: unsorted

nnpdf_data.cli.latex.generate_table(rows, group_by=None, group='unsorted')[source]

Given a list of rows, generate a LaTeX table with 3 columns: Dataset & Observable & Reference

nnpdf_data.cli.script module

Entry point for the nnpdf-data CLI with the following options:

nnpdf-data latex <runcard.yml>

Takes a NNPDF runcard and generate all biblatex entry in its dataset_inputs field together with latex tables.

nnpdf-data list <filter> [–yaml]

List of all datasets matching the glob filter <filter>

nnpdf_data.cli.script.main()[source]