@@ -34,7 +34,6 @@ def evolve_fit(
3434 force ,
3535 eko_path ,
3636 dump_eko = None ,
37- ncores = 1 ,
3837):
3938 """
4039 Evolves all the fitted replica in fit_folder/nnfit
@@ -126,7 +125,10 @@ def evolve_fit(
126125 # Read the information from all replicas into what eko wants:
127126 all_replicas = []
128127 for pdf_data in initial_PDFs_dict .values ():
129- all_replicas .append (np .array (pdf_data ["pdfgrid" ]).T )
128+ # swap photon postion to match eko.basis_roation.flavor_basis_pids
129+ pdfgrid = np .array (pdf_data ["pdfgrid" ])
130+ pdfgrid = np .append (pdfgrid [:,- 1 ].reshape (x_grid .size ,1 ), pdfgrid [:,:- 1 ], axis = 1 )
131+ all_replicas .append (pdfgrid .T )
130132
131133 # reshape the xgrid eko if necessary
132134 for _ , elem in eko_op .items ():
@@ -138,26 +140,24 @@ def evolve_fit(
138140 inputgrid = XGrid (x_grid ),
139141 )
140142
141- all_evolved , _ = apply .apply_grids (eko_op , np .array (all_replicas ))
142143 # {(Q2, nf): (replica, flavour, x)}
143- nreplicas = len (all_replicas )
144- all_evolved = [{i : k [r ] for i , k in all_evolved .items ()} for r in range (nreplicas )]
144+ all_evolved , _ = apply .apply_grids (eko_op , np .array (all_replicas ))
145145
146146 # Now, replica by replica, break into blocks
147147 targetgrid = eko_op .xgrid .tolist ()
148148 by_nf = defaultdict (list )
149- for q , nf in sorted (eko_op .evolgrid , key = lambda ep : ep [1 ]):
150- by_nf [nf ].append (q )
151- q2block_per_nf = {nf : sorted (qs ) for nf , qs in by_nf .items ()}
149+ for q2 , nf in sorted (eko_op .evolgrid , key = lambda ep : ep [1 ]):
150+ by_nf [nf ].append (q2 )
151+ q2block_per_nf = {nf : sorted (q2s ) for nf , q2s in by_nf .items ()}
152152
153- for replica , evolved_pdf in enumerate ( all_evolved ):
153+ for replica in range ( len ( all_replicas ) ):
154154 blocks = []
155155 for nf , q2grid in q2block_per_nf .items ():
156156
157157 def pdf_xq2 (pid , x , Q2 ):
158158 x_idx = targetgrid .index (x )
159159 pid_idx = info ["Flavors" ].index (pid )
160- return x * evolved_pdf [(Q2 , nf )][pid_idx ][x_idx ]
160+ return x * all_evolved [(Q2 , nf )][ replica ][pid_idx ][x_idx ]
161161
162162 block = genpdf .generate_block (
163163 pdf_xq2 ,
0 commit comments