@@ -99,9 +99,9 @@ def test_IMAS_input_with_equilibrium_object(self):
9999 config .build_geometry ()
100100
101101 def test_IMAS_loading_specific_slice (self ):
102- filename = 'ITERhybrid_COCOS17_IDS_ddv4 .nc'
103- SLICE_TIME = 5
104- SLICE_INDEX = 1
102+ filename = 'ITERhybrid_rampup_multiple_time_slices_COCOS17_IDS_ddv4 .nc'
103+ SLICE_TIME = 40
104+ SLICE_INDEX = 20
105105 config_at_0 = geometry_pydantic_model .IMASConfig (imas_filepath = filename )
106106 config_at_slice_from_time = geometry_pydantic_model .IMASConfig (
107107 imas_filepath = filename , slice_time = SLICE_TIME
@@ -114,21 +114,22 @@ def test_IMAS_loading_specific_slice(self):
114114 geo_at_slice_from_index = config_at_slice_from_index .build_geometry ()
115115
116116 for key in geo_at_0 .__dict__ .keys ():
117- np .testing .assert_allclose (
118- geo_at_slice_from_time [key ],
119- geo_at_slice_from_index [key ],
120- err_msg = f'Value { key } mismatched between slice_time and slice_index' ,
121- )
122- with self .assertRaises (AssertionError ):
123- np .testing .assert_allclose (
124- geo_at_0 [key ],
125- geo_at_slice_from_time [key ],
126- )
127- with self .assertRaises (AssertionError ):
117+ if key not in ['geometry_type' , 'torax_mesh' , 'R_major' , 'rho_hires_norm' , 'Phi_b_dot' , 'Ip_from_parameters' ]:
128118 np .testing .assert_allclose (
129- geo_at_0 [key ],
130- geo_at_slice_from_index [key ],
119+ geo_at_slice_from_time .__dict__ [key ],
120+ geo_at_slice_from_index .__dict__ [key ],
121+ err_msg = f'Value { key } mismatched between slice_time and slice_index' ,
131122 )
123+ with self .assertRaises (AssertionError ):
124+ np .testing .assert_allclose (
125+ geo_at_0 .__dict__ [key ],
126+ geo_at_slice_from_time .__dict__ [key ],
127+ )
128+ with self .assertRaises (AssertionError ):
129+ np .testing .assert_allclose (
130+ geo_at_0 .__dict__ [key ],
131+ geo_at_slice_from_index .__dict__ [key ],
132+ )
132133
133134 def test_IMAS_raises_if_slice_specified_twice (self ):
134135 filename = 'ITERhybrid_COCOS17_IDS_ddv4.nc'
0 commit comments