Skip to content
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

Allow pineko to check if the grid contains SV #24

Merged
merged 40 commits into from
Jul 12, 2022
Merged

Allow pineko to check if the grid contains SV #24

merged 40 commits into from
Jul 12, 2022

Conversation

andreab1997
Copy link
Contributor

We want to allow pineko to check if scale variations are available in a grid if we are computing a scale-varied FK table.

@codecov
Copy link

codecov bot commented Jun 13, 2022

Codecov Report

Merging #24 (3010f8c) into main (58715ad) will increase coverage by 0.75%.
The diff coverage is 47.54%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #24      +/-   ##
==========================================
+ Coverage   39.24%   40.00%   +0.75%     
==========================================
  Files          15       15              
  Lines         479      520      +41     
==========================================
+ Hits          188      208      +20     
- Misses        291      312      +21     
Flag Coverage Δ
unittests 40.00% <47.54%> (+0.75%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/pineko/cli/__init__.py 100.00% <ø> (ø)
src/pineko/evolve.py 30.00% <0.00%> (+1.15%) ⬆️
src/pineko/theory.py 20.12% <18.18%> (-0.40%) ⬇️
src/pineko/cli/check.py 46.15% <38.46%> (-17.01%) ⬇️
src/pineko/cli/convolute.py 77.27% <71.42%> (-6.07%) ⬇️
src/pineko/check.py 57.14% <100.00%> (+32.14%) ⬆️

src/pineko/check.py Outdated Show resolved Hide resolved
Copy link
Contributor

@felixhekhorn felixhekhorn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • this PR should sit on top of Scale Variations #19 since even scheme C is not available in master
  • I assume this will also trigger more minor issues (e.g. the numpy doc style ...)

src/pineko/check.py Outdated Show resolved Hide resolved
src/pineko/check.py Outdated Show resolved Hide resolved
src/pineko/cli/check_scalevar.py Outdated Show resolved Hide resolved
src/pineko/cli/check_scalevar.py Outdated Show resolved Hide resolved
src/pineko/check.py Outdated Show resolved Hide resolved
@felixhekhorn felixhekhorn added the enhancement New feature or request label Jun 16, 2022
@andreab1997
Copy link
Contributor Author

Should I rebase this on #19 then? @felixhekhorn

@andreab1997 andreab1997 requested a review from felixhekhorn June 17, 2022 12:17
@felixhekhorn
Copy link
Contributor

Should I rebase this on #19 then? @felixhekhorn

yes, please

@andreab1997
Copy link
Contributor Author

@felixhekhorn I have done but now there are some problems on stuffs that I have not touched. Do you know why?

@felixhekhorn
Copy link
Contributor

@felixhekhorn I have done but now there are some problems on stuffs that I have not touched. Do you know why?

you mean here in the workflow? keep in mind that this only works together with NNPDF/pineappl#138 so an unpublished version - check locally instead

@felixhekhorn felixhekhorn changed the base branch from main to feature/sv June 17, 2022 13:39
src/pineko/check.py Outdated Show resolved Hide resolved
src/pineko/cli/check.py Outdated Show resolved Hide resolved
@felixhekhorn
Copy link
Contributor

Could you please do me a favour and also adjust the arguments of https://github.com/N3PDF/pineko/blob/b4dc401e4feef5cffc4b137081c246b66c8ea8d8/src/pineko/evolve.py#L79 such that in TheoryBuilder.fk we open the grid only once?

@andreab1997
Copy link
Contributor Author

Could you please do me a favour and also adjust the arguments of

https://github.com/N3PDF/pineko/blob/b4dc401e4feef5cffc4b137081c246b66c8ea8d8/src/pineko/evolve.py#L79

such that in TheoryBuilder.fk we open the grid only once?

So you want that also evolve_grid takes the grid itself as argument and not the path, right?

@andreab1997
Copy link
Contributor Author

@felixhekhorn Ok but then we need to give up the fancy print with the grid path because we don't know that information anymore. Is it ok for you?
https://github.com/N3PDF/pineko/blob/e12c6482a32c7c8f902bfa2d2504e4bfe451fd19/src/pineko/evolve.py#L100

@felixhekhorn
Copy link
Contributor

@felixhekhorn Ok but then we need to give up the fancy print with the grid path because we don't know that information anymore. Is it ok for you?

https://github.com/N3PDF/pineko/blob/e12c6482a32c7c8f902bfa2d2504e4bfe451fd19/src/pineko/evolve.py#L100

Mmm, actually, I like that one because it is telling me what is happening ... I guess we can lift it to the calling functions ... maybe on the "theory" side we can even adjust it a bit (since there the key ingredient is actually repeated 3 times ...)

@andreab1997
Copy link
Contributor Author

@andreab1997 please try to rebase on feature/sv, I'm getting conflicts...

I should have solved both the problems (the conflicts and the workflow failing)

Copy link
Member

@alecandido alecandido left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few improvements, I'll give a tiny contribution as well and then we can merge.

src/pineko/cli/convolute.py Outdated Show resolved Hide resolved
src/pineko/evolve.py Outdated Show resolved Hide resolved
@@ -346,6 +347,15 @@ def fk(self, name, grid_path, tcard, pdf):
do_log = self.activate_logging(
paths["logs"]["fk"], f"{self.theory_id}-{name}-{pdf}.log"
)
# check if grid contains SV if theory is requesting them
xir = tcard["XIR"]
xif = tcard["XIF"]
Copy link
Member

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?

Copy link
Contributor

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 pineko this is not sufficient since we need to collapse on the actual value - or what were you thinking?

Copy link
Member

@alecandido alecandido Jul 11, 2022

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 requested then # in case of sv, check they are available in the grid.

Copy link
Contributor Author

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.

src/pineko/cli/check.py Outdated Show resolved Hide resolved
debug.py Outdated Show resolved Hide resolved
eko_debug.py Outdated Show resolved Hide resolved
src/pineko/check.py Outdated Show resolved Hide resolved
yadism_debug.py Outdated Show resolved Hide resolved
@delete-merged-branch delete-merged-branch bot deleted the branch main July 11, 2022 13:36
@felixhekhorn felixhekhorn changed the base branch from feature/sv to main July 11, 2022 13:37
@felixhekhorn
Copy link
Contributor

I hope github is joking
grafik

@felixhekhorn
Copy link
Contributor

@andreab1997
Copy link
Contributor Author

for this, should I add a couple of tests or we add them in a separate PR? because codecov is complaining....

@alecandido
Copy link
Member

alecandido commented Jul 12, 2022

@andreab1997 can you test the new refactored version of check subcommand, please? 975b8fe

@andreab1997
Copy link
Contributor Author

@andreab1997 can you test the new refactored version of check subcommand, please? 975b8fe

sure

@andreab1997
Copy link
Contributor Author

@andreab1997 can you test the new refactored version of check subcommand, please? 975b8fe

I tried that and it works. However I believe we should not add unit tests in this PR but rather in #25 mainly because we need actual grids to test the cli (as are provided by #25). So I think we can merge this now

@felixhekhorn
Copy link
Contributor

I tried that and it works. However I believe we should not add unit tests in this PR but rather in #25 mainly because we need actual grids to test the cli (as are provided by #25). So I think we can merge this now

let's close this PR and also #25, #27, #28 - and have a restart from a new main branch; just try to keep track of some minor comments such as this one

@andreab1997
Copy link
Contributor Author

I tried that and it works. However I believe we should not add unit tests in this PR but rather in #25 mainly because we need actual grids to test the cli (as are provided by #25). So I think we can merge this now

let's close this PR and also #25, #27, #28 - and have a restart from a new main branch; just try to keep track of some minor comments such as this one

Yes, I am asking the review only for the test part, then I believe we can merge

@andreab1997
Copy link
Contributor Author

Can I merge this? @felixhekhorn @alecandido

@andreab1997 andreab1997 merged commit 9fea7f4 into main Jul 12, 2022
@delete-merged-branch delete-merged-branch bot deleted the sv_check branch July 12, 2022 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants