@@ -35,18 +35,18 @@ def model():
3535def model_om3 ():
3636 # Create and save the om3 model
3737 model_instance = ACCESS_OM3_CMIP6 (
38- experiment_id = "historical" ,
38+ experiment_id = "historical" ,
3939 realization_index = "1" ,
4040 initialization_index = "1" ,
4141 physics_index = "1" ,
4242 forcing_index = "1" ,
4343 parent_mip_era = "CMIP6" ,
4444 parent_activity_id = "CMIP" ,
45- parent_experiment_id = "piControl" ,
46- parent_source_id = "ACCESS-ESM1-5" ,
47- parent_variant_label = "r1i1p1f1" ,
48- parent_time_units = "days since 0101-1-1" ,
49- branch_method = "standard" ,
45+ parent_experiment_id = "piControl" ,
46+ parent_source_id = "ACCESS-ESM1-5" ,
47+ parent_variant_label = "r1i1p1f1" ,
48+ parent_time_units = "days since 0101-1-1" ,
49+ branch_method = "standard" ,
5050 branch_time_in_child = 0.0 ,
5151 branch_time_in_parent = 0.0 ,
5252 )
@@ -69,14 +69,14 @@ def load_filtered_variables_om3_2d(mappings):
6969 # Load and filter variables from the JSON file
7070 with resources .files ("access_mopper.mappings" ).joinpath (mappings ).open () as f :
7171 df = pd .read_json (f , orient = "index" )
72- list_2d = [var for var in df .index if len (df .loc [var ,"dimensions" ])== 3 ]
72+ list_2d = [var for var in df .index if len (df .loc [var ,"dimensions" ]) == 3 ]
7373 return list_2d
7474
7575def load_filtered_variables_om3_3d (mappings ):
7676 # Load and filter variables from the JSON file
7777 with resources .files ("access_mopper.mappings" ).joinpath (mappings ).open () as f :
7878 df = pd .read_json (f , orient = "index" )
79- list_3d = [var for var in df .index if len (df .loc [var ,"dimensions" ])== 4 ]
79+ list_3d = [var for var in df .index if len (df .loc [var ,"dimensions" ]) == 4 ]
8080 return list_3d
8181
8282@pytest .mark .parametrize (
@@ -131,7 +131,9 @@ def test_cmorise_CMIP6_Emon(model, cmor_name):
131131 "cmor_name" , load_filtered_variables_om3_2d ("Mappings_OM3_Omon.json" )
132132)
133133def test_cmorise_OM3_2d (model_om3 , cmor_name ):
134- file_pattern = DATA_DIR / f"om3/2d/access-om3.mom6.2d.{ cmor_name } .1mon.mean.1902_01.nc"
134+ file_pattern = (
135+ DATA_DIR / f"om3/2d/access-om3.mom6.2d.{ cmor_name } .1mon.mean.1902_01.nc"
136+ )
135137 try :
136138 model_om3 .supergrid = DATA_DIR / "supergrid/ocean_hgrid.nc"
137139 model_om3 .cmorise (
@@ -148,7 +150,9 @@ def test_cmorise_OM3_2d(model_om3, cmor_name):
148150 "cmor_name" , load_filtered_variables_om3_3d ("Mappings_OM3_Omon.json" )
149151)
150152def test_cmorise_OM3_3d (model_om3 , cmor_name ):
151- file_pattern = DATA_DIR / f"om3/3d/access-om3.mom6.3d.{ cmor_name } .1mon.mean.1924_01.nc"
153+ file_pattern = (
154+ DATA_DIR / f"om3/3d/access-om3.mom6.3d.{ cmor_name } .1mon.mean.1924_01.nc"
155+ )
152156 try :
153157 model_om3 .supergrid = DATA_DIR / "supergrid/ocean_hgrid.nc"
154158 model_om3 .cmorise (
@@ -158,4 +162,4 @@ def test_cmorise_OM3_3d(model_om3, cmor_name):
158162 mip_table = "CMIP6_Omon.json" ,
159163 )
160164 except Exception as e :
161- pytest .fail (f"Failed processing { cmor_name } with table CMIP6_Omon.json: { e } " )
165+ pytest .fail (f"Failed processing { cmor_name } with table CMIP6_Omon.json: { e } " )
0 commit comments