You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The PineaAPPL cli is much faster than e.g., the python interface. As a result, sometimes it is quite convenient to use it and then parse the results.
I'm currently parsing the cli instead of using convolute_with_one (with or without scales). This seems to work in most (all?) cases. Can I trust this output to be constant in time? If now, can we have some kind of --stable-output that will be stable in time?
At the moment my assumptions for uncert and convolve are:
The three first lines are part of the header.
The results are always the last columns and there's nothing beyond.
For reference, this is the code I'm using:
# before 0.74 you need to add `--silence-lhapdf`def_convolute_with_pineappl_cli(grid_path, pdf_name, member):
"""Use the pineappl cli to compute the convolution of the grid with the given pdf Equivalent to: pineappl convolve <grid_path> <pdf> """cmd= ["pineappl", "convolve", grid_path, f"{pdf_name}/{member}"]
result_raw=sp.run(cmd, stdout=sp.PIPE)
results=result_raw.stdout.decode("utf-8").strip()
predictions= [line.split()[-1] forlineinresults.split("\n")[3:]]
returnnp.array(predictions, dtype=float)
def_scales_with_pineappl_cli(grid_path, pdf_name, n_scales):
"""Use the pineappl cli to compute the scale uncertainties for the grid Equivalent to: pineappl uncert <grid_path> <pdf> --scale-abs=9 """cmd= ["pineappl", "uncert", grid_path, pdf_name, f"--scale-abs={n_scales}"]
result_raw=sp.run(cmd, stdout=sp.PIPE)
results=result_raw.stdout.decode("utf-8").strip()
predictions= [line.split()[-n_scales:] forlineinresults.split("\n")[3:]]
returnnp.array(predictions, dtype=float)
The text was updated successfully, but these errors were encountered:
It's not guaranteed to be stable, but so far the changes have been minimal between versions.
I'm thinking of making the output stable at some point and furthermore prefixing each line that's not data with # so you can simply parse the output as an ascii table.
Of course, the real issue here is that the Python interface is slower.
cschwan
changed the title
Is the pineappl cli printout a stable well defined output?
Is the CLI's stdout stable?
Jun 2, 2024
cschwan
changed the title
Is the CLI's stdout stable?
Document guarantees about the stability of the CLI output
Jun 24, 2024
The
PineaAPPL
cli is much faster than e.g., the python interface. As a result, sometimes it is quite convenient to use it and then parse the results.I'm currently parsing the cli instead of using
convolute_with_one
(with or without scales). This seems to work in most (all?) cases. Can I trust this output to be constant in time? If now, can we have some kind of--stable-output
that will be stable in time?At the moment my assumptions for
uncert
andconvolve
are:For reference, this is the code I'm using:
The text was updated successfully, but these errors were encountered: