@@ -186,7 +186,13 @@ def _get_nnpdf_profile(profile_path=None):
186186 ) from e
187187
188188 # Now read all paths and define them as relative to nnpdf_share (unless given as absolute)
189- for var in ["results_path" , "theories_path" , "validphys_cache_path" , "hyperscan_path" ]:
189+ for var in [
190+ "results_path" ,
191+ "theories_path" ,
192+ "validphys_cache_path" ,
193+ "hyperscan_path" ,
194+ "ekos_path" ,
195+ ]:
190196 # if there are any problems setting or getting these variable erroring out is more than justified
191197 absolute_var = nnpdf_share / pathlib .Path (profile_dict [var ]).expanduser ()
192198 profile_dict [var ] = absolute_var .absolute ().as_posix ()
@@ -249,17 +255,20 @@ def __init__(self, profile=None):
249255 datapath = pathlib .Path (profile ["data_path" ])
250256 theories_path = pathlib .Path (profile ["theories_path" ])
251257 resultspath = pathlib .Path (profile ["results_path" ])
258+ ekos_path = pathlib .Path (profile ["ekos_path" ])
252259
253260 if not datapath .exists ():
254261 raise LoaderError (f"The data path { datapath } does not exist." )
255262
256263 # Create the theories and results paths if they don't exist already
257264 theories_path .mkdir (exist_ok = True , parents = True )
265+ ekos_path .mkdir (exist_ok = True , parents = True )
258266 resultspath .mkdir (exist_ok = True , parents = True )
259267
260268 # And save them up
261269 self .datapath = datapath
262270 self ._theories_path = theories_path
271+ self ._ekos_path = ekos_path
263272 self .resultspath = resultspath
264273 self ._extremely_old_fits = set ()
265274 self .nnprofile = profile
@@ -466,9 +475,8 @@ def check_theoryID(self, theoryID):
466475
467476 @functools .lru_cache
468477 def check_eko (self , theoryID ):
469- """Check the eko (and the parent theory) both exists and returns the path to it"""
470- theory = self .check_theoryID (theoryID )
471- eko_path = theory .path / "eko.tar"
478+ """Check the eko exists and return the path to it"""
479+ eko_path = self ._ekos_path / f"eko_{ int (theoryID )} .tar"
472480 if not eko_path .exists ():
473481 raise EkoNotFound (f"Could not find eko { eko_path } in theory: { theoryID } " )
474482 return eko_path
@@ -1286,9 +1294,8 @@ def download_eko(self, thid):
12861294 if thid not in remote :
12871295 raise EkoNotFound (f"EKO for TheoryID { thid } is not available in the remote server" )
12881296 # Check that we have the theory we need
1289- theory = self .check_theoryID (thid )
1290- target_path = theory .path / "eko.tar"
1291- download_file (remote [thid ], target_path , delete_on_failure = True )
1297+ target_path = self ._ekos_path / f"eko_{ int (thid )} .tar"
1298+ download_file (remote [thid ], target_path )
12921299
12931300 def download_vp_output_file (self , filename , ** kwargs ):
12941301 try :
0 commit comments