Skip to content

Add a nnpdf-data CLI - #2509

Open
scarlehoff wants to merge 4 commits into
masterfrom
nnpdf_data_cli
Open

Add a nnpdf-data CLI#2509
scarlehoff wants to merge 4 commits into
masterfrom
nnpdf_data_cli

Conversation

@scarlehoff

@scarlehoff scarlehoff commented Aug 25, 2026

Copy link
Copy Markdown
Member

Closes #2037, the current commands are:

nnpdf-data list <filter>

which lists datasets (with some extra info, and with a --yaml runcard to get it automatically in a copy-pasteable format).

The idea is that one can quickly do nnpdf-data *7TEV* and see 7 TeV dataset, or *JET* to see all jets, etc. And,

nnpdf-data latex <runcard.yml>

which reads the dataset_inputs from a given runcard, reads up the metadata, and

  1. Creates a latex table with the datasets (with a few grouping possible) like the ones we put in the NNPDF4.0 paper
  2. Calls the inspire API to search of the reference and populate a bib file (so that the table includes the citations).

Both commands accept --process, --experiment and --nnpdf31_process to enforce a certain ordering, with latex also accepting -group-by to create separate table per order option.

See for example:

~$ nnpdf-data latex n3fit/runcards/examples/Basic_runcard.yml --group-by --process --output-bib Basic_runcard_datasets.bib

produces

\begin{table}
  \centering
  \begin{tabular}{lll}
    \toprule
    Dataset & Observable & Reference \\
    \midrule
NMC $d/p$ & Deep Inelastic Scattering F2 deuterium to proton ratio. & \cite{NewMuon:1996uwk} \\
SLAC $d$ & Deep Inelastic Scattering & \cite{Whitlow:1991uw} \\
    \bottomrule
  \end{tabular}
  \caption{List of datasets matching process=NC}
  \label{tab:datasets_NC}
\end{table}


\begin{table}
  \centering
  \begin{tabular}{lll}
    \toprule
    Dataset & Observable & Reference \\
    \midrule
CMS Drell-Yan 2D 7 TeV 2011 & Double differential cross-section in pp collisions at 7 TeV & \cite{CMS:2013zfg} \\
    \bottomrule
  \end{tabular}
  \caption{List of datasets matching process=Z0}
  \label{tab:datasets_Z0}
\end{table}

and a .bib file with the three references.

AI usage: I used Qwen 3.6 27B 8bit locally to generate the tests (note that they don't use the Inspire API as that would be impolite). I needed a few iterations to make it closer to what In had in mind but I think they are ok? The LaTeX was not completely generated by Qwen, but it was beautified with it. I tried to autogenerate the documentation with Qwen but it was terrible. I retained the structure though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create a nnpdf data cli

1 participant