-
Notifications
You must be signed in to change notification settings - Fork 0
Use the NNPDF data instead of yamldb #159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
cfc755c
starting the usage of nnpdf for grid loading
scarlehoff 268d2d4
add nnpdf as config option
scarlehoff e66914f
Update theory.py
scarlehoff d62a436
update dependencies
scarlehoff 1ea50fa
add nnpdf for tests and benchmarks
scarlehoff 7d66344
reuse the same function for fonll
scarlehoff 812893e
Update pylint, reenable py3.12
felixhekhorn 0fb8540
separate nnpdf function
scarlehoff 572dcd4
add test and upload missing files
scarlehoff 72e9200
update deps
scarlehoff 2fe0bf0
fix to fonll docstr and json loading
scarlehoff 7682711
update prereq docs
scarlehoff 4164b3f
Update prerequisites.rst
scarlehoff 43862a7
Merge pull request #163 from NNPDF/quickfix_fonll
scarlehoff File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| """Shared utilities for pineko. | ||
|
|
||
| Common tools typically used by several pineko functions. | ||
| """ | ||
|
|
||
| from .configs import GENERIC_OPTIONS | ||
|
|
||
|
|
||
| def read_grids_from_nnpdf(dataset_name, configs=None): | ||
| """Read the list of fktables given a dataset name. | ||
|
|
||
| If NNPDF is not available, returns None. | ||
|
|
||
| Parameters | ||
| ---------- | ||
| dataset_name: str | ||
| configs: dict | ||
| dictionary of configuration options | ||
| if None it it assumed that the NNPDF version is required | ||
| """ | ||
| if configs is not None: | ||
| if not configs.get(GENERIC_OPTIONS, {}).get("nnpdf", False): | ||
| return None | ||
|
|
||
| # Import NNPDF only if we really want it! | ||
| from nnpdf_data import legacy_to_new_map | ||
| from validphys.commondataparser import EXT | ||
| from validphys.loader import Loader | ||
|
|
||
| # We only need the metadata, so this should be enough | ||
| dataset_name, variant = legacy_to_new_map(dataset_name) | ||
| cd = Loader().check_commondata(dataset_name, variant=variant) | ||
| fks = cd.metadata.theory.FK_tables | ||
| # Return it flat | ||
| return [f"{i}.{EXT}" for operand in fks for i in operand] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| import pytest | ||
|
|
||
| from pineko import utils | ||
|
|
||
|
|
||
| @pytest.mark.parametrize( | ||
| "dsname", ["HERA_NC_318GEV_EAVG_CHARM-SIGMARED", "ATLAS_DY_7TEV_46FB_CC"] | ||
| ) | ||
| def test_nnpdf_grids(dsname): | ||
| """Checks that the grids can be read out from the NNPDF theory metadata.""" | ||
| grids = utils.read_grids_from_nnpdf(dsname) | ||
| # Check that we get _something_ | ||
| assert len(grids) > 0 | ||
| # And that they look like pineappl grids | ||
| for grid_name in grids: | ||
| grid_name.endswith(".pineappl.lz4") |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.