File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -72,6 +72,19 @@ def ds_type_resolver(
7272 elif ds_name .startswith ("root://" ) and ds_name .endswith ("*" ):
7373 return dataset .XRootD (ds_name )
7474
75+ elif ds_name .startswith ("/eos/" ):
76+ if "/eos/opendata/" in ds_name :
77+ return dataset .FileList ([f"root://eospublic.cern.ch/{ ds_name } " ])
78+ elif "/eos/atlas/" in ds_name :
79+ return dataset .FileList ([f"root://eosatlas.cern.ch/{ ds_name } " ])
80+ elif "/eos/cms/" in ds_name :
81+ return dataset .FileList ([f"root://eoscms.cern.ch/{ ds_name } " ])
82+ else :
83+ raise ValueError (
84+ f"Unable to determine the correct EOS instance for the provided path: { ds_name } ."
85+ "Please provide the full root:// URL. Cannot be a user path."
86+ )
87+
7588 elif re .match (r"^root://" , ds_name ):
7689 return dataset .FileList (ds_name )
7790
Original file line number Diff line number Diff line change 4545def test_find_dataset (input_ds , expected_type ):
4646 dataset = ds_type_resolver (input_ds )
4747 assert isinstance (dataset , expected_type )
48+
49+
50+ @pytest .mark .parametrize (
51+ "eos_path, prefix" ,
52+ [
53+ ("/eos/opendata/atlas/rucio/somefile.root" , "root://eospublic.cern.ch/" ),
54+ ("/eos/opendata/cms/rucio/somefile.root" , "root://eospublic.cern.ch/" ),
55+ ("/eos/atlas/atlascerngroupdisk/somefile.root" , "root://eosatlas.cern.ch/" ),
56+ ("/eos/cms/store/somefile.root" , "root://eoscms.cern.ch/" ),
57+ ],
58+ )
59+ def test_eos_url_parsing (eos_path , prefix ):
60+ ds_out = ds_type_resolver (eos_path )
61+ assert isinstance (ds_out , dataset .FileList )
62+ assert ds_out .files [0 ] == prefix + eos_path
You can’t perform that action at this time.
0 commit comments