Save hash and path grid informations when generating FK Tables#247
Save hash and path grid informations when generating FK Tables#247kamillaurent wants to merge 1 commit into
Conversation
scarlehoff
left a comment
There was a problem hiding this comment.
LGTM.
(haven't tested it, but I trust the OP is a real-life test)
| if grid_path is not None: | ||
| grid_path_obj = pathlib.Path(grid_path) | ||
| grid_hash = hashlib.md5(grid_path_obj.read_bytes()).hexdigest() | ||
| grid_files = {grid_path_obj.stem: {"hash": grid_hash, "path": str(grid_path_obj.resolve())}} |
There was a problem hiding this comment.
| grid_files = {grid_path_obj.stem: {"hash": grid_hash, "path": str(grid_path_obj.resolve())}} | |
| grid_files = {grid_path_obj.stem: {"hash": grid_hash, "theory_folder": grid_path_obj.parent.name}} |
Out of privacy concerns, I would just store the path starting from the theory_slim folder.
My suggestion is, since you have the grid name as the key, save just the theory folder name.
There was a problem hiding this comment.
agreed on the privacy, but I think I would keep the resolve(), because I think this way we can resolve symbolic links, right? i.e. .resolve().parent (or similar)
|
Hi @kamillaurent please do the small change requested and fix the issues found by pre-commit (usually just means you didn't run pre-commit, if you do the changes then git add the |
felixhekhorn
left a comment
There was a problem hiding this comment.
Remember the other things we discussed:
- split in two simple keys "grid_path" and "grid_hash"
- address FONLL magic
| if grid_path is not None: | ||
| grid_path_obj = pathlib.Path(grid_path) | ||
| grid_hash = hashlib.md5(grid_path_obj.read_bytes()).hexdigest() | ||
| grid_files = {grid_path_obj.stem: {"hash": grid_hash, "path": str(grid_path_obj.resolve())}} |
There was a problem hiding this comment.
agreed on the privacy, but I think I would keep the resolve(), because I think this way we can resolve symbolic links, right? i.e. .resolve().parent (or similar)
When a FK Table is generated, the hash information and path of the
pineapplgrid used for it are saved in the metadata of the FK Table.These information can be read using the
pinealppl-cli, for example:pineappl read --show ATLAS_WZ_TOT_13TEV-ATLASWZTOT13TEV81PB_Z_tot.pineappl.lz4outputs, between the other informations, this lines:
This PR is related to issue #225