-
Notifications
You must be signed in to change notification settings - Fork 14
Substitution of apfel with eko in evolven3fit #1537
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
Changes from all commits
7eed199
f16c3c7
a393c47
1662220
b3b16fd
6a246ed
28924cc
70e3f83
6524bfe
2a6c40a
f446636
9abfbfc
b94fd49
a10da27
74062bc
0d9056a
74aeb57
214813d
ee662cd
ca53512
9787fcb
17cec62
912f767
e5775ec
14c9175
713df25
50b1165
950a967
8fc0aff
735064e
c1fd370
b2f8c64
8853ebc
5aa0716
213ffcc
b4b254f
04095cf
1c652dd
18c2d6b
94bb090
4358bf4
f5c7cab
b5ec0b4
d078c8f
cf6838d
998e2fd
821c9dc
0f3de49
18c65a2
aad9d75
3354610
3e8b63a
ddd75a5
7d83c5d
f55265c
5c5487c
0ff8287
d919fba
ce1eb03
5a1a1e8
caba20a
ea45980
3f960df
2866b46
b56cb35
f4375cd
7597401
5433721
10d096c
8bdca5a
fdd3a51
a02cd35
e5a68be
d4a57a6
975f373
d9d84ca
cdd973f
3d47814
b4ec3dd
69490c2
9715d61
98d5192
aa421a0
5665b1e
3484ef3
d1912f6
58e6f5a
59663c6
58ce979
02c85a8
9a4004b
48dea08
f9f6c53
5df949d
da1619a
dac3851
ebb04f3
eda1f18
8e5dfa6
7aa5814
bffcc88
63ee62a
52eadc1
fa1ec3c
afd5d6c
efbcb72
104e7be
ca625e0
a3d689e
bb50d5c
679404d
197feb8
238cea1
63632bb
0d4d68f
d555a4d
ec61e48
488dc17
03520c9
3355eaa
b265f1c
f2a7313
5158a52
53c3713
32e21d4
5a27956
67b550d
4a4fc40
bff4be7
fd0e203
6f185ab
9d355d7
aafd779
5686f12
68cbe3f
dc39e4c
b1f2dff
d6233b4
6099f9f
4044dd4
92bd651
146c4a3
06909c5
2929e59
778ba10
fa8e5e0
37218f6
eb70131
4281753
c157d2d
631077e
895888f
836b9a8
0d8bdc0
c701774
573b87f
92d11e8
2c5267c
21c460c
c9459c2
05cd541
5618a0a
b34b008
51758f0
6a772a4
0e06c29
4685982
ca814f0
0cd8ab6
7cc4d21
1b4e7c3
ffb591e
e1a9f5e
b31d6b4
4ccc7b8
f3e2289
ec7e6e5
fb487fe
8a71819
9d0a9e4
dee3a06
75563cf
4dff1c6
c947dfd
c45413d
2b8dd5a
92bc1c8
7fdbbf8
e2733b9
86d1440
2cf6188
7f4d475
841c123
2388e43
2eb9fc0
f951600
d58790a
5ca9f26
b03b580
2f46626
7c77b45
a5b4602
8429851
c317723
649af06
a7fd736
c0ddad3
ff57667
91a549c
c6c05bc
0dd4081
3e6c0c8
6c8de7f
396456a
5d10970
821987c
cde7bc7
9b1669e
94f63d7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,244 @@ | ||||||||||||||||||||||||||||||||||||||||
| from . import evolve, utils | ||||||||||||||||||||||||||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you make a universal xgrid (shared with the writer) and defintion of a fit (shared with vp-upload) I would say everything in this file should just be done in the actual script file.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't remember who asked, but I was asked esplicitly to do exactly the opposite (which is why now everything is inside
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't know if it is what you refer to, but some time ago, I asked you to write the CLI as a very small wrapper around an API (for Pineko). Maybe it is not what you refer to, but in case, this does not apply to this file: there are only two elements, a global value and a single function. The function is only making two calls, and it is not directly defining the CLI itslef, so it is mainly about its documentation. If you are able to put the documentation in another suitable place, it is just redundant, since it is used in a single place. And if you move also the value somewhere else (
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am actually referring to your comment of 12 days ago on this PR:
However, again, it is not a problem: I can move again :)
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Of this I'm still convinced, for the same reasons of Pineko. What I meant here was to reduce all subcommands to a single function call, and keep the script parser only. Being me, I would also define the parsers in the package, since scripts are much more annoying to test and maintain in general - but this is definitely personal preference, in the end is just a ~100 lines script, with only parsers. nnpdf/n3fit/src/n3fit/scripts/evolven3fit_new.py Lines 122 to 140 in 841c123
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Baseline: modularize as much as possible, to organize things, but not too much. If you have a module for a function, and a function with just two calls (called only once), you can probably simplify a bit, grouping with something else. (However, at some level it becomes personal preference: you'll maintain it, you decide ^^)
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just to make sure, it was a conscious decision to keep this?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. At the end this solution seemed to me good enough: I would not like to put both the |
||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| import numpy as np | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| XGRID = np.array( | ||||||||||||||||||||||||||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The xgrid is already defined in writer.py so make sure to define it only once and make both import it from the same point (also, what's up with the indentation)
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The indentation is done by
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see. No if this is what
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I definitely think it is good to be able to see what the default xgrid is from other parts of the code. For that it seems funny to have to import a cli module. |
||||||||||||||||||||||||||||||||||||||||
| [ | ||||||||||||||||||||||||||||||||||||||||
| 1.00000000000000e-09, | ||||||||||||||||||||||||||||||||||||||||
| 1.29708482343957e-09, | ||||||||||||||||||||||||||||||||||||||||
| 1.68242903474257e-09, | ||||||||||||||||||||||||||||||||||||||||
| 2.18225315420583e-09, | ||||||||||||||||||||||||||||||||||||||||
| 2.83056741739819e-09, | ||||||||||||||||||||||||||||||||||||||||
| 3.67148597892941e-09, | ||||||||||||||||||||||||||||||||||||||||
| 4.76222862935315e-09, | ||||||||||||||||||||||||||||||||||||||||
| 6.17701427376180e-09, | ||||||||||||||||||||||||||||||||||||||||
| 8.01211109898438e-09, | ||||||||||||||||||||||||||||||||||||||||
| 1.03923870607245e-08, | ||||||||||||||||||||||||||||||||||||||||
| 1.34798064073805e-08, | ||||||||||||||||||||||||||||||||||||||||
| 1.74844503691778e-08, | ||||||||||||||||||||||||||||||||||||||||
| 2.26788118881103e-08, | ||||||||||||||||||||||||||||||||||||||||
| 2.94163370300835e-08, | ||||||||||||||||||||||||||||||||||||||||
| 3.81554746595878e-08, | ||||||||||||||||||||||||||||||||||||||||
| 4.94908707232129e-08, | ||||||||||||||||||||||||||||||||||||||||
| 6.41938295708371e-08, | ||||||||||||||||||||||||||||||||||||||||
| 8.32647951986859e-08, | ||||||||||||||||||||||||||||||||||||||||
| 1.08001422993829e-07, | ||||||||||||||||||||||||||||||||||||||||
| 1.40086873081130e-07, | ||||||||||||||||||||||||||||||||||||||||
| 1.81704331793772e-07, | ||||||||||||||||||||||||||||||||||||||||
| 2.35685551545377e-07, | ||||||||||||||||||||||||||||||||||||||||
| 3.05703512595323e-07, | ||||||||||||||||||||||||||||||||||||||||
| 3.96522309841747e-07, | ||||||||||||||||||||||||||||||||||||||||
| 5.14321257236570e-07, | ||||||||||||||||||||||||||||||||||||||||
| 6.67115245136676e-07, | ||||||||||||||||||||||||||||||||||||||||
| 8.65299922973143e-07, | ||||||||||||||||||||||||||||||||||||||||
| 1.12235875241487e-06, | ||||||||||||||||||||||||||||||||||||||||
| 1.45577995547683e-06, | ||||||||||||||||||||||||||||||||||||||||
| 1.88824560514613e-06, | ||||||||||||||||||||||||||||||||||||||||
| 2.44917352454946e-06, | ||||||||||||||||||||||||||||||||||||||||
| 3.17671650028717e-06, | ||||||||||||||||||||||||||||||||||||||||
| 4.12035415232797e-06, | ||||||||||||||||||||||||||||||||||||||||
| 5.34425265752090e-06, | ||||||||||||||||||||||||||||||||||||||||
| 6.93161897806315e-06, | ||||||||||||||||||||||||||||||||||||||||
| 8.99034258238145e-06, | ||||||||||||||||||||||||||||||||||||||||
| 1.16603030112258e-05, | ||||||||||||||||||||||||||||||||||||||||
| 1.51228312288769e-05, | ||||||||||||||||||||||||||||||||||||||||
| 1.96129529349212e-05, | ||||||||||||||||||||||||||||||||||||||||
| 2.54352207134502e-05, | ||||||||||||||||||||||||||||||||||||||||
| 3.29841683435992e-05, | ||||||||||||||||||||||||||||||||||||||||
| 4.27707053972016e-05, | ||||||||||||||||||||||||||||||||||||||||
| 5.54561248105849e-05, | ||||||||||||||||||||||||||||||||||||||||
| 7.18958313632514e-05, | ||||||||||||||||||||||||||||||||||||||||
| 9.31954227979614e-05, | ||||||||||||||||||||||||||||||||||||||||
| 1.20782367731330e-04, | ||||||||||||||||||||||||||||||||||||||||
| 1.56497209466554e-04, | ||||||||||||||||||||||||||||||||||||||||
| 2.02708936328495e-04, | ||||||||||||||||||||||||||||||||||||||||
| 2.62459799331951e-04, | ||||||||||||||||||||||||||||||||||||||||
| 3.39645244168985e-04, | ||||||||||||||||||||||||||||||||||||||||
| 4.39234443000422e-04, | ||||||||||||||||||||||||||||||||||||||||
| 5.67535660104533e-04, | ||||||||||||||||||||||||||||||||||||||||
| 7.32507615725537e-04, | ||||||||||||||||||||||||||||||||||||||||
| 9.44112105452451e-04, | ||||||||||||||||||||||||||||||||||||||||
| 1.21469317686978e-03, | ||||||||||||||||||||||||||||||||||||||||
| 1.55935306118224e-03, | ||||||||||||||||||||||||||||||||||||||||
| 1.99627451141338e-03, | ||||||||||||||||||||||||||||||||||||||||
| 2.54691493736552e-03, | ||||||||||||||||||||||||||||||||||||||||
| 3.23597510213126e-03, | ||||||||||||||||||||||||||||||||||||||||
| 4.09103436509565e-03, | ||||||||||||||||||||||||||||||||||||||||
| 5.14175977083962e-03, | ||||||||||||||||||||||||||||||||||||||||
| 6.41865096062317e-03, | ||||||||||||||||||||||||||||||||||||||||
| 7.95137940306351e-03, | ||||||||||||||||||||||||||||||||||||||||
| 9.76689999624100e-03, | ||||||||||||||||||||||||||||||||||||||||
| 1.18876139251364e-02, | ||||||||||||||||||||||||||||||||||||||||
| 1.43298947643919e-02, | ||||||||||||||||||||||||||||||||||||||||
| 1.71032279460271e-02, | ||||||||||||||||||||||||||||||||||||||||
| 2.02100733925079e-02, | ||||||||||||||||||||||||||||||||||||||||
| 2.36463971369542e-02, | ||||||||||||||||||||||||||||||||||||||||
| 2.74026915728357e-02, | ||||||||||||||||||||||||||||||||||||||||
| 3.14652506132444e-02, | ||||||||||||||||||||||||||||||||||||||||
| 3.58174829282429e-02, | ||||||||||||||||||||||||||||||||||||||||
| 4.04411060163317e-02, | ||||||||||||||||||||||||||||||||||||||||
| 4.53171343973807e-02, | ||||||||||||||||||||||||||||||||||||||||
| 5.04266347950069e-02, | ||||||||||||||||||||||||||||||||||||||||
| 5.57512610084339e-02, | ||||||||||||||||||||||||||||||||||||||||
| 6.12736019390519e-02, | ||||||||||||||||||||||||||||||||||||||||
| 6.69773829498255e-02, | ||||||||||||||||||||||||||||||||||||||||
| 7.28475589986517e-02, | ||||||||||||||||||||||||||||||||||||||||
| 7.88703322292727e-02, | ||||||||||||||||||||||||||||||||||||||||
| 8.50331197801452e-02, | ||||||||||||||||||||||||||||||||||||||||
| 9.13244910278679e-02, | ||||||||||||||||||||||||||||||||||||||||
| 9.77340879783772e-02, | ||||||||||||||||||||||||||||||||||||||||
| 1.04252538208639e-01, | ||||||||||||||||||||||||||||||||||||||||
| 1.10871366547237e-01, | ||||||||||||||||||||||||||||||||||||||||
| 1.17582909372878e-01, | ||||||||||||||||||||||||||||||||||||||||
| 1.24380233801599e-01, | ||||||||||||||||||||||||||||||||||||||||
| 1.31257062945031e-01, | ||||||||||||||||||||||||||||||||||||||||
| 1.38207707707289e-01, | ||||||||||||||||||||||||||||||||||||||||
| 1.45227005135651e-01, | ||||||||||||||||||||||||||||||||||||||||
| 1.52310263065985e-01, | ||||||||||||||||||||||||||||||||||||||||
| 1.59453210652156e-01, | ||||||||||||||||||||||||||||||||||||||||
| 1.66651954293987e-01, | ||||||||||||||||||||||||||||||||||||||||
| 1.73902938455578e-01, | ||||||||||||||||||||||||||||||||||||||||
| 1.81202910873333e-01, | ||||||||||||||||||||||||||||||||||||||||
| 1.88548891679097e-01, | ||||||||||||||||||||||||||||||||||||||||
| 1.95938145999193e-01, | ||||||||||||||||||||||||||||||||||||||||
| 2.03368159629765e-01, | ||||||||||||||||||||||||||||||||||||||||
| 2.10836617429103e-01, | ||||||||||||||||||||||||||||||||||||||||
| 2.18341384106561e-01, | ||||||||||||||||||||||||||||||||||||||||
| 2.25880487124065e-01, | ||||||||||||||||||||||||||||||||||||||||
| 2.33452101459503e-01, | ||||||||||||||||||||||||||||||||||||||||
| 2.41054536011681e-01, | ||||||||||||||||||||||||||||||||||||||||
| 2.48686221452762e-01, | ||||||||||||||||||||||||||||||||||||||||
| 2.56345699358723e-01, | ||||||||||||||||||||||||||||||||||||||||
| 2.64031612468684e-01, | ||||||||||||||||||||||||||||||||||||||||
| 2.71742695942783e-01, | ||||||||||||||||||||||||||||||||||||||||
| 2.79477769504149e-01, | ||||||||||||||||||||||||||||||||||||||||
| 2.87235730364833e-01, | ||||||||||||||||||||||||||||||||||||||||
| 2.95015546847664e-01, | ||||||||||||||||||||||||||||||||||||||||
| 3.02816252626866e-01, | ||||||||||||||||||||||||||||||||||||||||
| 3.10636941519503e-01, | ||||||||||||||||||||||||||||||||||||||||
| 3.18476762768082e-01, | ||||||||||||||||||||||||||||||||||||||||
| 3.26334916761672e-01, | ||||||||||||||||||||||||||||||||||||||||
| 3.34210651149156e-01, | ||||||||||||||||||||||||||||||||||||||||
| 3.42103257303627e-01, | ||||||||||||||||||||||||||||||||||||||||
| 3.50012067101685e-01, | ||||||||||||||||||||||||||||||||||||||||
| 3.57936449985571e-01, | ||||||||||||||||||||||||||||||||||||||||
| 3.65875810279643e-01, | ||||||||||||||||||||||||||||||||||||||||
| 3.73829584735962e-01, | ||||||||||||||||||||||||||||||||||||||||
| 3.81797240286494e-01, | ||||||||||||||||||||||||||||||||||||||||
| 3.89778271981947e-01, | ||||||||||||||||||||||||||||||||||||||||
| 3.97772201099286e-01, | ||||||||||||||||||||||||||||||||||||||||
| 4.05778573402340e-01, | ||||||||||||||||||||||||||||||||||||||||
| 4.13796957540671e-01, | ||||||||||||||||||||||||||||||||||||||||
| 4.21826943574548e-01, | ||||||||||||||||||||||||||||||||||||||||
| 4.29868141614175e-01, | ||||||||||||||||||||||||||||||||||||||||
| 4.37920180563205e-01, | ||||||||||||||||||||||||||||||||||||||||
| 4.45982706956990e-01, | ||||||||||||||||||||||||||||||||||||||||
| 4.54055383887562e-01, | ||||||||||||||||||||||||||||||||||||||||
| 4.62137890007651e-01, | ||||||||||||||||||||||||||||||||||||||||
| 4.70229918607142e-01, | ||||||||||||||||||||||||||||||||||||||||
| 4.78331176755675e-01, | ||||||||||||||||||||||||||||||||||||||||
| 4.86441384506059e-01, | ||||||||||||||||||||||||||||||||||||||||
| 4.94560274153348e-01, | ||||||||||||||||||||||||||||||||||||||||
| 5.02687589545177e-01, | ||||||||||||||||||||||||||||||||||||||||
| 5.10823085439086e-01, | ||||||||||||||||||||||||||||||||||||||||
| 5.18966526903235e-01, | ||||||||||||||||||||||||||||||||||||||||
| 5.27117688756998e-01, | ||||||||||||||||||||||||||||||||||||||||
| 5.35276355048428e-01, | ||||||||||||||||||||||||||||||||||||||||
| 5.43442318565661e-01, | ||||||||||||||||||||||||||||||||||||||||
| 5.51615380379768e-01, | ||||||||||||||||||||||||||||||||||||||||
| 5.59795349416641e-01, | ||||||||||||||||||||||||||||||||||||||||
| 5.67982042055800e-01, | ||||||||||||||||||||||||||||||||||||||||
| 5.76175281754088e-01, | ||||||||||||||||||||||||||||||||||||||||
| 5.84374898692498e-01, | ||||||||||||||||||||||||||||||||||||||||
| 5.92580729444440e-01, | ||||||||||||||||||||||||||||||||||||||||
| 6.00792616663950e-01, | ||||||||||||||||||||||||||||||||||||||||
| 6.09010408792398e-01, | ||||||||||||||||||||||||||||||||||||||||
| 6.17233959782450e-01, | ||||||||||||||||||||||||||||||||||||||||
| 6.25463128838069e-01, | ||||||||||||||||||||||||||||||||||||||||
| 6.33697780169485e-01, | ||||||||||||||||||||||||||||||||||||||||
| 6.41937782762089e-01, | ||||||||||||||||||||||||||||||||||||||||
| 6.50183010158361e-01, | ||||||||||||||||||||||||||||||||||||||||
| 6.58433340251944e-01, | ||||||||||||||||||||||||||||||||||||||||
| 6.66688655093089e-01, | ||||||||||||||||||||||||||||||||||||||||
| 6.74948840704708e-01, | ||||||||||||||||||||||||||||||||||||||||
| 6.83213786908386e-01, | ||||||||||||||||||||||||||||||||||||||||
| 6.91483387159697e-01, | ||||||||||||||||||||||||||||||||||||||||
| 6.99757538392251e-01, | ||||||||||||||||||||||||||||||||||||||||
| 7.08036140869916e-01, | ||||||||||||||||||||||||||||||||||||||||
| 7.16319098046733e-01, | ||||||||||||||||||||||||||||||||||||||||
| 7.24606316434025e-01, | ||||||||||||||||||||||||||||||||||||||||
| 7.32897705474271e-01, | ||||||||||||||||||||||||||||||||||||||||
| 7.41193177421404e-01, | ||||||||||||||||||||||||||||||||||||||||
| 7.49492647227008e-01, | ||||||||||||||||||||||||||||||||||||||||
| 7.57796032432224e-01, | ||||||||||||||||||||||||||||||||||||||||
| 7.66103253064927e-01, | ||||||||||||||||||||||||||||||||||||||||
| 7.74414231541921e-01, | ||||||||||||||||||||||||||||||||||||||||
| 7.82728892575836e-01, | ||||||||||||||||||||||||||||||||||||||||
| 7.91047163086478e-01, | ||||||||||||||||||||||||||||||||||||||||
| 7.99368972116378e-01, | ||||||||||||||||||||||||||||||||||||||||
| 8.07694250750291e-01, | ||||||||||||||||||||||||||||||||||||||||
| 8.16022932038457e-01, | ||||||||||||||||||||||||||||||||||||||||
| 8.24354950923382e-01, | ||||||||||||||||||||||||||||||||||||||||
| 8.32690244169987e-01, | ||||||||||||||||||||||||||||||||||||||||
| 8.41028750298844e-01, | ||||||||||||||||||||||||||||||||||||||||
| 8.49370409522600e-01, | ||||||||||||||||||||||||||||||||||||||||
| 8.57715163684985e-01, | ||||||||||||||||||||||||||||||||||||||||
| 8.66062956202683e-01, | ||||||||||||||||||||||||||||||||||||||||
| 8.74413732009721e-01, | ||||||||||||||||||||||||||||||||||||||||
| 8.82767437504206e-01, | ||||||||||||||||||||||||||||||||||||||||
| 8.91124020497459e-01, | ||||||||||||||||||||||||||||||||||||||||
| 8.99483430165226e-01, | ||||||||||||||||||||||||||||||||||||||||
| 9.07845617001021e-01, | ||||||||||||||||||||||||||||||||||||||||
| 9.16210532771399e-01, | ||||||||||||||||||||||||||||||||||||||||
| 9.24578130473112e-01, | ||||||||||||||||||||||||||||||||||||||||
| 9.32948364292029e-01, | ||||||||||||||||||||||||||||||||||||||||
| 9.41321189563734e-01, | ||||||||||||||||||||||||||||||||||||||||
| 9.49696562735755e-01, | ||||||||||||||||||||||||||||||||||||||||
| 9.58074441331298e-01, | ||||||||||||||||||||||||||||||||||||||||
| 9.66454783914439e-01, | ||||||||||||||||||||||||||||||||||||||||
| 9.74837550056705e-01, | ||||||||||||||||||||||||||||||||||||||||
| 9.83222700304978e-01, | ||||||||||||||||||||||||||||||||||||||||
| 9.91610196150662e-01, | ||||||||||||||||||||||||||||||||||||||||
| 1.00000000000000e00, | ||||||||||||||||||||||||||||||||||||||||
| ] | ||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| def cli_evolven3fit_new( | ||||||||||||||||||||||||||||||||||||||||
| configuration_folder, | ||||||||||||||||||||||||||||||||||||||||
| q_fin, | ||||||||||||||||||||||||||||||||||||||||
| q_points, | ||||||||||||||||||||||||||||||||||||||||
| op_card_info, | ||||||||||||||||||||||||||||||||||||||||
| theory_card_info, | ||||||||||||||||||||||||||||||||||||||||
| dump, | ||||||||||||||||||||||||||||||||||||||||
| load, | ||||||||||||||||||||||||||||||||||||||||
| force, | ||||||||||||||||||||||||||||||||||||||||
| ): | ||||||||||||||||||||||||||||||||||||||||
| """Evolves the fitted PDFs. | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| The q_grid starts at the Q0 given by the theory but | ||||||||||||||||||||||||||||||||||||||||
| the last point is q_fin and its number of | ||||||||||||||||||||||||||||||||||||||||
| points can be specified by q_points. If just one of the | ||||||||||||||||||||||||||||||||||||||||
| two is not specified by the user, the default grid | ||||||||||||||||||||||||||||||||||||||||
| will be used. | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| If a path is given for the dump option, the eko | ||||||||||||||||||||||||||||||||||||||||
| will be dumped in that path after the computation. | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| If a path is given for the load option, the eko | ||||||||||||||||||||||||||||||||||||||||
| to be used for the evolution will be loaded from that | ||||||||||||||||||||||||||||||||||||||||
| path. | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| The two options are mutually exclusive. | ||||||||||||||||||||||||||||||||||||||||
| """ | ||||||||||||||||||||||||||||||||||||||||
| utils.check_is_a_fit(configuration_folder) | ||||||||||||||||||||||||||||||||||||||||
| return evolve.evolve_fit( | ||||||||||||||||||||||||||||||||||||||||
| configuration_folder, | ||||||||||||||||||||||||||||||||||||||||
| q_fin, | ||||||||||||||||||||||||||||||||||||||||
| q_points, | ||||||||||||||||||||||||||||||||||||||||
| op_card_info, | ||||||||||||||||||||||||||||||||||||||||
| theory_card_info, | ||||||||||||||||||||||||||||||||||||||||
| force, | ||||||||||||||||||||||||||||||||||||||||
| load, | ||||||||||||||||||||||||||||||||||||||||
| dump, | ||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| from ekobox import gen_theory, gen_op | ||
| from eko import run_dglap | ||
|
|
||
| from validphys.loader import Loader | ||
|
andreab1997 marked this conversation as resolved.
|
||
| from . import utils | ||
|
|
||
| from typing import Any, Dict, Optional | ||
| import logging | ||
|
|
||
| _logger = logging.getLogger(__name__) | ||
|
|
||
|
|
||
| def construct_eko_cards( | ||
| theoryID, | ||
| q_fin, | ||
| q_points, | ||
| x_grid, | ||
| op_card_dict: Optional[Dict[str, Any]] = None, | ||
| theory_card_dict: Optional[Dict[str, Any]] = None, | ||
| ): | ||
| """ | ||
| Return the theory and operator cards used to construct the eko. | ||
| theoryID is the ID of the theory for which we are computing the theory and operator card. | ||
| q_fin is the final point of the q grid while q_points is the number of points of the grid. | ||
| x_grid is the x grid to be used. | ||
| op_card_dict and theory_card_dict are optional updates that can be provided respectively to the | ||
| operator card and to the theory card. | ||
| """ | ||
| if theory_card_dict is None: | ||
| theory_card_dict = {} | ||
| if op_card_dict is None: | ||
| op_card_dict = {} | ||
| # theory_card construction | ||
| theory = Loader().check_theoryID(theoryID).get_description() | ||
| theory.pop("FNS") | ||
| theory.update(theory_card_dict) | ||
| theory_card = gen_theory.gen_theory_card(theory["PTO"], theory["Q0"], update=theory) | ||
| # construct operator card | ||
| q2_grid = utils.generate_q2grid( | ||
| theory["Q0"], | ||
| q_fin, | ||
| q_points, | ||
| {theory["mb"]: theory["kbThr"], theory["mt"]: theory["ktThr"]}, | ||
| ) | ||
| op_card = gen_op.gen_op_card(q2_grid, update={"interpolation_xgrid": x_grid}) | ||
| op_card.update(op_card_dict) | ||
|
andreab1997 marked this conversation as resolved.
|
||
| return theory_card, op_card | ||
|
|
||
|
|
||
| def construct_eko_for_fit(theory_card, op_card, save_path=None): | ||
| """ | ||
| Construct the eko operator needed for evolution of fitted pdfs | ||
|
|
||
| Parameters | ||
| ---------- | ||
| theory_card: dict | ||
| theory card to use for the eko | ||
| op_card: dict | ||
| operator card to use for the eko | ||
| save_path: pathlib.Path | ||
| path where the eko will be saved (the eko | ||
| won't be saved if save_path is None) | ||
| Returns | ||
| ------- | ||
| : eko.output.Output | ||
| eko operator | ||
| """ | ||
| # generate eko operator | ||
| if save_path is not None: | ||
| if not save_path.parent.exists(): | ||
| raise FileNotFoundError( | ||
| f"Path where eko should be dumped does not exist: {save_path}" | ||
| ) | ||
| eko_op = run_dglap(theory_card, op_card) | ||
| if save_path is not None: | ||
| # Here we want to catch all possible exceptions in order to avoid losing the computed eko | ||
| try: | ||
| _logger.info(f"Saving computed eko to : {save_path}") | ||
| eko_op.dump_tar(save_path) | ||
| except: | ||
|
andreab1997 marked this conversation as resolved.
|
||
| _logger.error(f"Error saving the eko to : {save_path}") | ||
| pass | ||
| return eko_op | ||
Uh oh!
There was an error while loading. Please reload this page.