-
Notifications
You must be signed in to change notification settings - Fork 0
Allow pineko to check if the grid contains SV #24
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
40 commits
Select commit
Hold shift + click to select a range
ff57aab
First implementation
andreab1997 c13474d
Fixing
andreab1997 f7f3e06
Put scalevar parameters as arguments
andreab1997 02ee40d
Fixed init of cli
andreab1997 4fad303
Added SV check as default when computing fks
andreab1997 7713ff0
Fixing
andreab1997 b1598f6
Splitted funcs, put if in theory and change cli
andreab1997 c7987f8
Fixing
andreab1997 9fdd291
Splitted funcs, put if in theory and change cli
andreab1997 8322198
Fixing
andreab1997 f2eecce
Merge branch 'sv_check' of github.com:N3PDF/pineko into sv_check
andreab1997 b4dc401
Change argument of the function and put tocheck as argument
andreab1997 8c14399
put the grid as argument of evolve
andreab1997 7c3147a
Run pre-commit
andreab1997 0316a2f
Removed redundant def of xir and xif
andreab1997 cd68db0
Fixed import of pineappl
andreab1997 bd2dbdd
Upgrade PineAPPL to v0.5.4
alecandido 5fcc283
Fixed import of pineappl
andreab1997 703c316
Merge branch 'sv_check' of github.com:N3PDF/pineko into sv_check
andreab1997 5d194df
Splitted funcs, put if in theory and change cli
andreab1997 5a3df49
Fixing
andreab1997 26ee37e
Fixing
andreab1997 fbeae62
Put scalevar parameters as arguments
andreab1997 3f9d6fe
Fixed init of cli
andreab1997 b406490
Added SV check as default when computing fks
andreab1997 c053a86
Splitted funcs, put if in theory and change cli
andreab1997 72c7889
Change argument of the function and put tocheck as argument
andreab1997 1928fcf
put the grid as argument of evolve
andreab1997 460af45
Run pre-commit
andreab1997 8e4ba78
Removed redundant def of xir and xif
andreab1997 48ec795
Fixed import of pineappl
andreab1997 381426e
Fixed import of pineappl
andreab1997 6cec81c
Merge branch 'sv_check' of github.com:N3PDF/pineko into sv_check
andreab1997 b88a051
Minor changes
andreab1997 7c30efe
Change names of funcs
andreab1997 261a2c7
Fixed theory
andreab1997 776af28
Merge branch 'feature/sv' into sv_check
felixhekhorn a3bc157
Added relevant tests
andreab1997 975b8fe
Refactor check subcommand
alecandido 3010f8c
Improve functions' names consistency
alecandido 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
| # -*- coding: utf-8 -*- | ||
| """CLI entry point.""" | ||
| from . import check, compare, convolute, opcard, theory_ | ||
| from ._base import command |
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,51 @@ | ||
| # -*- coding: utf-8 -*- | ||
| import pathlib | ||
|
|
||
| import eko | ||
| import numpy as np | ||
| import pineappl | ||
| import pytest | ||
|
|
||
| import pineko.check | ||
|
|
||
|
|
||
| class Fake_grid: | ||
| def __init__(self, order_list): | ||
| self.orderlist = order_list | ||
|
|
||
| def orders(self): | ||
| return self.orderlist | ||
|
|
||
|
|
||
| class Order: | ||
| def __init__(self, order_tup): | ||
| self.orders = order_tup | ||
|
|
||
| def as_tuple(self): | ||
| return self.orders | ||
|
|
||
|
|
||
| def test_contains_fact(): | ||
| first_order = Order((0, 0, 0, 0)) | ||
| second_order = Order((1, 1, 0, 0)) | ||
| third_order = Order((0, 0, 1, 1)) | ||
| order_list = [first_order, second_order, third_order] | ||
| mygrid = Fake_grid(order_list) | ||
| assert pineko.check.contains_fact(mygrid) is None | ||
| order_list.pop(-1) | ||
| mygrid_nofact = Fake_grid(order_list) | ||
| with pytest.raises(ValueError): | ||
| pineko.check.contains_fact(mygrid_nofact) | ||
|
|
||
|
|
||
| def test_contains_ren(): | ||
| first_order = Order((0, 0, 0, 0)) | ||
| second_order = Order((1, 1, 0, 0)) | ||
| third_order = Order((0, 0, 1, 1)) | ||
| order_list = [first_order, second_order, third_order] | ||
| mygrid = Fake_grid(order_list) | ||
| assert pineko.check.contains_ren(mygrid) is None | ||
| order_list.pop(-1) | ||
| mygrid_nofact = Fake_grid(order_list) | ||
| with pytest.raises(ValueError): | ||
| pineko.check.contains_ren(mygrid_nofact) |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@felixhekhorn didn't we have another variable, e.g. in yadism. In order to compute scale variations, even when we are not given a specific value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, we have there "activateFact" (or similar name) in order to decide whether to compute the SV grids - however for
pinekothis is not sufficient since we need to collapse on the actual value - or what were you thinking?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, so it is just the first part of the comment to be referred to the code below.
Maybe I'd just move it: first
# check if sv are requestedthen# in case of sv, check they are available in the grid.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you mean just the comments right? because the code is already doing that: first it checks if the theory is asking for scale-variations and then it checks whether they are available in the gird.