-
Notifications
You must be signed in to change notification settings - Fork 0
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
Generate kfactors for polarized observables #132
Conversation
This PR is mostly to keep track of @toonhasenack work, we might no merge this in the end. |
data/kfactors/generate.py
Outdated
import argparse | ||
|
||
|
||
def get_gpaths(folder): |
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.
Consider adding type hints
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.
@toonhasenack when using type hints you can actually drop the repeated argument type in the doc string - see e.g. the second example here
data/kfactors/generate.py
Outdated
strf_data += f"{data[i]} 0.0\n" | ||
|
||
date = dt.now().date() | ||
string = ( |
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.
Make this a module constant
data/kfactors/generate.py
Outdated
+ strf_data | ||
) | ||
|
||
os.makedirs(output_name, exist_ok=True) |
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.
Maybe prefer pathlib
over os
Maybe this is not a priority, but I think we do want to merge because this strategy will persists also in the mid-term |
See latest push for adjustments |
Are you sure that this should belong to Pineko? It is quite DIS specific... (even more, just specific to some observable) |
I think it is fine to have it here, pineko has the k-factor option - of course the other option is to push it back to yadism |
@toonhasenack please remember the comments from above and also try to unify the scripts as much as you can, they are all similar to each other PS: as always: please also fix pre-commit |
Pineko is applying k-factors, but not computing them. We always kept Pineko process agnostic, and I believe that's a good thing (since all the complexity of the processes is delegated to the respective generators, and we avoid coupling to a specific one - in particular DIS, as in APFEL). |
okay, I agree - so @toonhasenack
|
Yes indeed that would be the proper fix. I can take care of it, here. |
What do you mean with all keys? |
all metadata present in original grid like |
this is done in #161 - so please just close @toonhasenack when you have moved the scripts |
@toonhasenack please don't push here. Close this one an reopen in yadism. |
for i, bin in enumerate(bins): | ||
prediction[i] = ( | ||
bin["y"]["mid"] | ||
* (2 - bin["y"]["mid"]) | ||
/ (bin["y"]["mid"] ** 2 + 2 * (1 - bin["y"]["mid"])) | ||
) |
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.
@toonhasenack Here we are missing the
moved to NNPDF/yadism#270 |
Initial pull request for generating the K-factors of the F1 structure functions for polarized DIS data.