diff --git a/model/atmosphere/advection/tests/advection/stencil_tests/test_apply_horizontal_density_increment.py b/model/atmosphere/advection/tests/advection/stencil_tests/test_apply_horizontal_density_increment.py index 2b82a73a20..06f0cd2c1b 100644 --- a/model/atmosphere/advection/tests/advection/stencil_tests/test_apply_horizontal_density_increment.py +++ b/model/atmosphere/advection/tests/advection/stencil_tests/test_apply_horizontal_density_increment.py @@ -43,7 +43,7 @@ def reference( rhodz_ast2 = np.maximum(0.1 * p_rhodz_new, p_rhodz_new) - p_dtime * tmp return dict(rhodz_ast2=rhodz_ast2) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid) -> dict: p_rhodz_new = data_alloc.random_field(grid, dims.CellDim, dims.KDim) p_mflx_contra_v = data_alloc.random_field( diff --git a/model/atmosphere/advection/tests/advection/stencil_tests/test_apply_interpolated_tracer_time_tendency.py b/model/atmosphere/advection/tests/advection/stencil_tests/test_apply_interpolated_tracer_time_tendency.py index 4484a4159a..a639500264 100644 --- a/model/atmosphere/advection/tests/advection/stencil_tests/test_apply_interpolated_tracer_time_tendency.py +++ b/model/atmosphere/advection/tests/advection/stencil_tests/test_apply_interpolated_tracer_time_tendency.py @@ -37,7 +37,7 @@ def reference( return dict(p_tracer_new=p_tracer_new) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict: p_tracer_now = data_alloc.random_field(grid, dims.CellDim, dims.KDim) p_grf_tend_tracer = data_alloc.random_field(grid, dims.CellDim, dims.KDim) diff --git a/model/atmosphere/advection/tests/advection/stencil_tests/test_apply_vertical_density_increment.py b/model/atmosphere/advection/tests/advection/stencil_tests/test_apply_vertical_density_increment.py index 9c428c9c60..ea5b270230 100644 --- a/model/atmosphere/advection/tests/advection/stencil_tests/test_apply_vertical_density_increment.py +++ b/model/atmosphere/advection/tests/advection/stencil_tests/test_apply_vertical_density_increment.py @@ -47,7 +47,7 @@ def reference( return dict(rhodz_ast2=rhodz_ast2) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict: rhodz_ast = data_alloc.random_field(grid, dims.CellDim, dims.KDim) p_mflx_contra_v = data_alloc.random_field( diff --git a/model/atmosphere/advection/tests/advection/stencil_tests/test_average_horizontal_flux_subcycling_2.py b/model/atmosphere/advection/tests/advection/stencil_tests/test_average_horizontal_flux_subcycling_2.py index d73e3354ac..ca6db686bd 100644 --- a/model/atmosphere/advection/tests/advection/stencil_tests/test_average_horizontal_flux_subcycling_2.py +++ b/model/atmosphere/advection/tests/advection/stencil_tests/test_average_horizontal_flux_subcycling_2.py @@ -34,7 +34,7 @@ def reference( p_out_e = (z_tracer_mflx_1_dsl + z_tracer_mflx_2_dsl) / float(2) return dict(p_out_e=p_out_e) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict: z_tracer_mflx_1_dsl = data_alloc.random_field(grid, dims.EdgeDim, dims.KDim) z_tracer_mflx_2_dsl = data_alloc.random_field(grid, dims.EdgeDim, dims.KDim) diff --git a/model/atmosphere/advection/tests/advection/stencil_tests/test_average_horizontal_flux_subcycling_3.py b/model/atmosphere/advection/tests/advection/stencil_tests/test_average_horizontal_flux_subcycling_3.py index 9883b6fc5a..82fe0ae467 100644 --- a/model/atmosphere/advection/tests/advection/stencil_tests/test_average_horizontal_flux_subcycling_3.py +++ b/model/atmosphere/advection/tests/advection/stencil_tests/test_average_horizontal_flux_subcycling_3.py @@ -35,7 +35,7 @@ def reference( p_out_e = (z_tracer_mflx_1_dsl + z_tracer_mflx_2_dsl + z_tracer_mflx_3_dsl) / float(3) return dict(p_out_e=p_out_e) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict: z_tracer_mflx_1_dsl = data_alloc.random_field(grid, dims.EdgeDim, dims.KDim) z_tracer_mflx_2_dsl = data_alloc.random_field(grid, dims.EdgeDim, dims.KDim) diff --git a/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_antidiffusive_cell_fluxes_and_min_max.py b/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_antidiffusive_cell_fluxes_and_min_max.py index 63dc972850..757a0fcee2 100644 --- a/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_antidiffusive_cell_fluxes_and_min_max.py +++ b/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_antidiffusive_cell_fluxes_and_min_max.py @@ -77,7 +77,7 @@ def reference( z_tracer_min=z_tracer_min, ) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid) -> dict: geofac_div = data_alloc.random_field(grid, dims.CellDim, dims.C2EDim) p_rhodz_now = data_alloc.random_field(grid, dims.CellDim, dims.KDim) diff --git a/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_barycentric_backtrajectory.py b/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_barycentric_backtrajectory.py index 63054b2a19..9351816d16 100644 --- a/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_barycentric_backtrajectory.py +++ b/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_barycentric_backtrajectory.py @@ -79,7 +79,7 @@ def reference( p_distv_bary_2=p_distv_bary_2, ) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid) -> dict: p_vn = data_alloc.random_field(grid, dims.EdgeDim, dims.KDim) p_vt = data_alloc.random_field(grid, dims.EdgeDim, dims.KDim) diff --git a/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_barycentric_backtrajectory_alt.py b/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_barycentric_backtrajectory_alt.py index 1adb8af3aa..38bb95e49b 100644 --- a/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_barycentric_backtrajectory_alt.py +++ b/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_barycentric_backtrajectory_alt.py @@ -72,7 +72,7 @@ def reference( p_distv_bary_2=p_distv_bary_2, ) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid) -> dict: p_vn = data_alloc.random_field(grid, dims.EdgeDim, dims.KDim) p_vt = data_alloc.random_field(grid, dims.EdgeDim, dims.KDim) diff --git a/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_ffsl_backtrajectory.py b/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_ffsl_backtrajectory.py index 60bb15e9cf..1b65e483ec 100644 --- a/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_ffsl_backtrajectory.py +++ b/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_ffsl_backtrajectory.py @@ -145,7 +145,7 @@ def reference( "p_coords_dreg_v_4_lat_dsl": p_coords_dreg_v_4_lat_dsl, } - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid) -> dict: p_vn = data_alloc.random_field(grid, dims.EdgeDim, dims.KDim) p_vt = data_alloc.random_field(grid, dims.EdgeDim, dims.KDim) diff --git a/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_ffsl_backtrajectory_counterclockwise_indicator.py b/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_ffsl_backtrajectory_counterclockwise_indicator.py index 064c915c6c..ce90d0e9b5 100644 --- a/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_ffsl_backtrajectory_counterclockwise_indicator.py +++ b/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_ffsl_backtrajectory_counterclockwise_indicator.py @@ -44,7 +44,7 @@ def reference( return dict(lvn_sys_pos=lvn_sys_pos) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict: p_vn = data_alloc.random_field(grid, dims.EdgeDim, dims.KDim) tangent_orientation = data_alloc.random_field(grid, dims.EdgeDim) diff --git a/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_ffsl_backtrajectory_length_indicator.py b/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_ffsl_backtrajectory_length_indicator.py index 326d040463..cacb408cbb 100644 --- a/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_ffsl_backtrajectory_length_indicator.py +++ b/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_ffsl_backtrajectory_length_indicator.py @@ -46,7 +46,7 @@ def reference( return dict(opt_famask_dsl=opt_famask_dsl) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid) -> dict: p_vn = data_alloc.random_field(grid, dims.EdgeDim, dims.KDim) p_vt = data_alloc.random_field(grid, dims.EdgeDim, dims.KDim) diff --git a/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_horizontal_tracer_flux_from_cubic_coefficients.py b/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_horizontal_tracer_flux_from_cubic_coefficients.py index cdf27e4979..94fc3b8e84 100644 --- a/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_horizontal_tracer_flux_from_cubic_coefficients.py +++ b/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_horizontal_tracer_flux_from_cubic_coefficients.py @@ -34,7 +34,7 @@ def reference( return dict(p_out_e_hybrid_2=p_out_e_hybrid_2) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid) -> dict: p_out_e_hybrid_2 = data_alloc.random_field(grid, dims.EdgeDim, dims.KDim) p_mass_flx_e = data_alloc.random_field(grid, dims.EdgeDim, dims.KDim) diff --git a/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_horizontal_tracer_flux_from_linear_coefficients.py b/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_horizontal_tracer_flux_from_linear_coefficients.py index 51e4cc49d2..29eaaba61c 100644 --- a/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_horizontal_tracer_flux_from_linear_coefficients.py +++ b/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_horizontal_tracer_flux_from_linear_coefficients.py @@ -57,7 +57,7 @@ def reference( return dict(p_out_e=p_out_e) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict: z_lsq_coeff_1 = data_alloc.random_field(grid, dims.CellDim, dims.KDim) z_lsq_coeff_2 = data_alloc.random_field(grid, dims.CellDim, dims.KDim) diff --git a/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_horizontal_tracer_flux_from_linear_coefficients_alt.py b/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_horizontal_tracer_flux_from_linear_coefficients_alt.py index f490a7bf82..d9bc8813bf 100644 --- a/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_horizontal_tracer_flux_from_linear_coefficients_alt.py +++ b/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_horizontal_tracer_flux_from_linear_coefficients_alt.py @@ -57,7 +57,7 @@ def reference( return dict(p_out_e=p_out_e) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict: z_lsq_coeff_1 = data_alloc.random_field(grid, dims.CellDim, dims.KDim) z_lsq_coeff_2 = data_alloc.random_field(grid, dims.CellDim, dims.KDim) diff --git a/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_positive_definite_horizontal_multiplicative_flux_factor.py b/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_positive_definite_horizontal_multiplicative_flux_factor.py index c6ee1ad78e..902d8d3ae9 100644 --- a/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_positive_definite_horizontal_multiplicative_flux_factor.py +++ b/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_positive_definite_horizontal_multiplicative_flux_factor.py @@ -53,7 +53,7 @@ def reference( return dict(r_m=r_m) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid) -> dict: geofac_div = data_alloc.random_field(grid, dims.CellDim, dims.C2EDim) p_cc = data_alloc.random_field(grid, dims.CellDim, dims.KDim) diff --git a/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_ppm4gpu_parabola_coefficients.py b/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_ppm4gpu_parabola_coefficients.py index ffaeefc5c6..11f06165a8 100644 --- a/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_ppm4gpu_parabola_coefficients.py +++ b/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_ppm4gpu_parabola_coefficients.py @@ -36,7 +36,7 @@ def reference( z_a1 = p_cc - 0.5 * (z_face_up + z_face_low) return dict(z_delta_q=z_delta_q, z_a1=z_a1) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict: z_face_up = data_alloc.random_field(grid, dims.CellDim, dims.KDim) z_face_low = data_alloc.random_field(grid, dims.CellDim, dims.KDim) diff --git a/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_ppm_all_face_values.py b/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_ppm_all_face_values.py index 054cb659fe..1b84c3debe 100644 --- a/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_ppm_all_face_values.py +++ b/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_ppm_all_face_values.py @@ -49,7 +49,7 @@ def reference( p_face[:, 1:] = np.where((k[1:] == elevp1), p_cc[:, :-1], p_face[:, 1:]) return dict(p_face=p_face) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict: p_cc = data_alloc.random_field(grid, dims.CellDim, dims.KDim) p_cellhgt_mc_now = data_alloc.random_field(grid, dims.CellDim, dims.KDim) diff --git a/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_ppm_quadratic_face_values.py b/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_ppm_quadratic_face_values.py index 98095dc0f1..22d8be854e 100644 --- a/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_ppm_quadratic_face_values.py +++ b/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_ppm_quadratic_face_values.py @@ -42,7 +42,7 @@ def reference( ) return dict(p_face=p_face) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict: p_face = data_alloc.random_field(grid, dims.CellDim, dims.KDim) p_cc = data_alloc.random_field(grid, dims.CellDim, dims.KDim) diff --git a/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_ppm_quartic_face_values.py b/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_ppm_quartic_face_values.py index b6192bf216..691dc715b8 100644 --- a/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_ppm_quartic_face_values.py +++ b/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_ppm_quartic_face_values.py @@ -68,7 +68,7 @@ def reference( ) return dict(p_face=p_face) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict: p_cc = data_alloc.random_field(grid, dims.CellDim, dims.KDim) p_cellhgt_mc_now = data_alloc.random_field( diff --git a/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_ppm_slope.py b/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_ppm_slope.py index d875fd8f2c..3585651cfb 100644 --- a/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_ppm_slope.py +++ b/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_ppm_slope.py @@ -64,7 +64,7 @@ def reference( z_slope = np.where(k[1:-1] < elev, z_slope_a, z_slope_b) return dict(z_slope=z_slope) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict: z_slope = data_alloc.zero_field(grid, dims.CellDim, dims.KDim) p_cc = data_alloc.random_field(grid, dims.CellDim, dims.KDim, extend={dims.KDim: 1}) diff --git a/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_tendency.py b/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_tendency.py index 88810d6269..17f4aea803 100644 --- a/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_tendency.py +++ b/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_tendency.py @@ -34,7 +34,7 @@ def reference( return dict(opt_ddt_tracer_adv=opt_ddt_tracer_adv) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict: p_tracer_now = data_alloc.random_field(grid, dims.CellDim, dims.KDim) p_tracer_new = data_alloc.random_field(grid, dims.CellDim, dims.KDim) diff --git a/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_vertical_parabola_limiter_condition.py b/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_vertical_parabola_limiter_condition.py index e881c1f702..f308571140 100644 --- a/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_vertical_parabola_limiter_condition.py +++ b/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_vertical_parabola_limiter_condition.py @@ -36,7 +36,7 @@ def reference( l_limit = np.where(np.abs(z_delta) < -1 * z_a6i, 1, 0) return dict(l_limit=l_limit) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict: p_cc = data_alloc.random_field(grid, dims.CellDim, dims.KDim) p_face = data_alloc.random_field(grid, dims.CellDim, dims.KDim, extend={dims.KDim: 1}) diff --git a/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_vertical_tracer_flux_upwind.py b/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_vertical_tracer_flux_upwind.py index 03d40aaa52..1835f18619 100644 --- a/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_vertical_tracer_flux_upwind.py +++ b/model/atmosphere/advection/tests/advection/stencil_tests/test_compute_vertical_tracer_flux_upwind.py @@ -41,7 +41,7 @@ def reference( ) return dict(p_upflux=p_upflux) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict: p_cc = data_alloc.random_field(grid, dims.CellDim, dims.KDim) p_mflx_contra_v = data_alloc.random_field( diff --git a/model/atmosphere/advection/tests/advection/stencil_tests/test_integrate_tracer_density_horizontally.py b/model/atmosphere/advection/tests/advection/stencil_tests/test_integrate_tracer_density_horizontally.py index 6bb07ba7cb..ec40232a0f 100644 --- a/model/atmosphere/advection/tests/advection/stencil_tests/test_integrate_tracer_density_horizontally.py +++ b/model/atmosphere/advection/tests/advection/stencil_tests/test_integrate_tracer_density_horizontally.py @@ -61,7 +61,7 @@ def reference( z_tracer_new_dsl=z_tracer_new_dsl, ) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict: p_mass_flx_e = data_alloc.random_field(grid, dims.EdgeDim, dims.KDim) geofac_div = data_alloc.random_field(grid, dims.CellDim, dims.C2EDim) diff --git a/model/atmosphere/advection/tests/advection/stencil_tests/test_integrate_tracer_horizontally.py b/model/atmosphere/advection/tests/advection/stencil_tests/test_integrate_tracer_horizontally.py index f1f1134f66..2621e1db67 100644 --- a/model/atmosphere/advection/tests/advection/stencil_tests/test_integrate_tracer_horizontally.py +++ b/model/atmosphere/advection/tests/advection/stencil_tests/test_integrate_tracer_horizontally.py @@ -45,7 +45,7 @@ def reference( ) / rhodz_new return dict(tracer_new_hor=tracer_new_hor) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict: p_mflx_tracer_h = data_alloc.random_field(grid, dims.EdgeDim, dims.KDim) deepatmo_divh = data_alloc.random_field(grid, dims.KDim) diff --git a/model/atmosphere/advection/tests/advection/stencil_tests/test_integrate_tracer_vertically.py b/model/atmosphere/advection/tests/advection/stencil_tests/test_integrate_tracer_vertically.py index 6ab7a36d13..c6b02ab378 100644 --- a/model/atmosphere/advection/tests/advection/stencil_tests/test_integrate_tracer_vertically.py +++ b/model/atmosphere/advection/tests/advection/stencil_tests/test_integrate_tracer_vertically.py @@ -58,7 +58,7 @@ def reference( return dict(tracer_new=tracer_new) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict: tracer_now = data_alloc.random_field(grid, dims.CellDim, dims.KDim) rhodz_now = data_alloc.random_field(grid, dims.CellDim, dims.KDim) diff --git a/model/atmosphere/advection/tests/advection/stencil_tests/test_limit_vertical_parabola_semi_monotonically.py b/model/atmosphere/advection/tests/advection/stencil_tests/test_limit_vertical_parabola_semi_monotonically.py index b7079d0aca..937fe35fc0 100644 --- a/model/atmosphere/advection/tests/advection/stencil_tests/test_limit_vertical_parabola_semi_monotonically.py +++ b/model/atmosphere/advection/tests/advection/stencil_tests/test_limit_vertical_parabola_semi_monotonically.py @@ -47,7 +47,7 @@ def reference( ) return dict(p_face_up=q_face_up, p_face_low=q_face_low) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict: l_limit = data_alloc.random_mask(grid, dims.CellDim, dims.KDim, dtype=gtx.int32) p_cc = data_alloc.random_field(grid, dims.CellDim, dims.KDim) diff --git a/model/atmosphere/advection/tests/advection/stencil_tests/test_limit_vertical_slope_semi_monotonically.py b/model/atmosphere/advection/tests/advection/stencil_tests/test_limit_vertical_slope_semi_monotonically.py index fb32ae1f24..624eeb8703 100644 --- a/model/atmosphere/advection/tests/advection/stencil_tests/test_limit_vertical_slope_semi_monotonically.py +++ b/model/atmosphere/advection/tests/advection/stencil_tests/test_limit_vertical_slope_semi_monotonically.py @@ -39,7 +39,7 @@ def reference( slope = np.where(z_slope[:, 1:-1] >= 0.0, slope_l, -slope_l) return dict(z_slope=slope) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict: p_cc = data_alloc.random_field(grid, dims.CellDim, dims.KDim) z_slope = data_alloc.random_field(grid, dims.CellDim, dims.KDim) diff --git a/model/atmosphere/advection/tests/advection/stencil_tests/test_postprocess_antidiffusive_cell_fluxes_and_min_max.py b/model/atmosphere/advection/tests/advection/stencil_tests/test_postprocess_antidiffusive_cell_fluxes_and_min_max.py index 9fe005d986..30fcccd0f8 100644 --- a/model/atmosphere/advection/tests/advection/stencil_tests/test_postprocess_antidiffusive_cell_fluxes_and_min_max.py +++ b/model/atmosphere/advection/tests/advection/stencil_tests/test_postprocess_antidiffusive_cell_fluxes_and_min_max.py @@ -54,7 +54,7 @@ def reference( z_tracer_min=z_tracer_min_out, ) - @pytest.fixture() + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict: hi_bound, lo_bound = 3, 1 refin_ctrl = data_alloc.constant_field(grid, 2, dims.CellDim, dtype=gtx.int32) diff --git a/model/atmosphere/advection/tests/advection/stencil_tests/test_prepare_ffsl_flux_area_patches_list.py b/model/atmosphere/advection/tests/advection/stencil_tests/test_prepare_ffsl_flux_area_patches_list.py index bc2d3c6933..8a696d961d 100644 --- a/model/atmosphere/advection/tests/advection/stencil_tests/test_prepare_ffsl_flux_area_patches_list.py +++ b/model/atmosphere/advection/tests/advection/stencil_tests/test_prepare_ffsl_flux_area_patches_list.py @@ -1470,7 +1470,7 @@ def reference( dreg_patch2_4_lat_vmask=dreg_patch2_4_lat_vmask, ) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid) -> dict: famask_int = data_alloc.random_mask(grid, dims.EdgeDim, dims.KDim, dtype=gtx.int32) p_vn = data_alloc.random_field(grid, dims.EdgeDim, dims.KDim) diff --git a/model/atmosphere/advection/tests/advection/stencil_tests/test_prepare_numerical_quadrature_for_cubic_reconstruction.py b/model/atmosphere/advection/tests/advection/stencil_tests/test_prepare_numerical_quadrature_for_cubic_reconstruction.py index efe12e6b23..3664cdc0d9 100644 --- a/model/atmosphere/advection/tests/advection/stencil_tests/test_prepare_numerical_quadrature_for_cubic_reconstruction.py +++ b/model/atmosphere/advection/tests/advection/stencil_tests/test_prepare_numerical_quadrature_for_cubic_reconstruction.py @@ -485,7 +485,7 @@ def reference( p_dreg_area_out=p_dreg_area_out, ) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict: p_coords_dreg_v_1_x = data_alloc.random_field(grid, dims.EdgeDim, dims.KDim) p_coords_dreg_v_2_x = data_alloc.random_field(grid, dims.EdgeDim, dims.KDim) diff --git a/model/atmosphere/advection/tests/advection/stencil_tests/test_prepare_numerical_quadrature_list_for_cubic_reconstruction.py b/model/atmosphere/advection/tests/advection/stencil_tests/test_prepare_numerical_quadrature_list_for_cubic_reconstruction.py index 66b376c37a..1ede54c31b 100644 --- a/model/atmosphere/advection/tests/advection/stencil_tests/test_prepare_numerical_quadrature_list_for_cubic_reconstruction.py +++ b/model/atmosphere/advection/tests/advection/stencil_tests/test_prepare_numerical_quadrature_list_for_cubic_reconstruction.py @@ -519,7 +519,7 @@ def reference( p_dreg_area=p_dreg_area, ) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict: famask_int = data_alloc.constant_field(grid, 1, dims.EdgeDim, dims.KDim, dtype=gtx.int32) p_coords_dreg_v_1_x = data_alloc.random_field(grid, dims.EdgeDim, dims.KDim) diff --git a/model/atmosphere/advection/tests/advection/stencil_tests/test_reconstruct_cubic_coefficients_svd.py b/model/atmosphere/advection/tests/advection/stencil_tests/test_reconstruct_cubic_coefficients_svd.py index ed85115d46..7736363941 100644 --- a/model/atmosphere/advection/tests/advection/stencil_tests/test_reconstruct_cubic_coefficients_svd.py +++ b/model/atmosphere/advection/tests/advection/stencil_tests/test_reconstruct_cubic_coefficients_svd.py @@ -304,7 +304,7 @@ def reference( p_coeff_10_dsl=p_coeff_10_dsl, ) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict: p_cc = data_alloc.random_field(grid, dims.CellDim, dims.KDim) lsq_pseudoinv_1_field = data_alloc.random_field(grid, dims.CellDim, dims.C2E2C2E2CDim) diff --git a/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_apply_diffusion_to_theta_and_exner.py b/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_apply_diffusion_to_theta_and_exner.py index 29d880a8f7..89d878db3f 100644 --- a/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_apply_diffusion_to_theta_and_exner.py +++ b/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_apply_diffusion_to_theta_and_exner.py @@ -75,7 +75,7 @@ def reference( return dict(theta_v=theta_v, exner=exner) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid): pytest.xfail( "stencil segfaults with GTFN and it is not used in diffusion: it is missing an if condition" diff --git a/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_apply_diffusion_to_vn.py b/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_apply_diffusion_to_vn.py index debdae974f..743cb7934f 100644 --- a/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_apply_diffusion_to_vn.py +++ b/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_apply_diffusion_to_vn.py @@ -115,7 +115,7 @@ def reference( return dict(vn=vn) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict: u_vert = data_alloc.random_field(grid, dims.VertexDim, dims.KDim) v_vert = data_alloc.random_field(grid, dims.VertexDim, dims.KDim) diff --git a/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_apply_diffusion_to_w_and_compute_horizontal_gradients_for_turbulence.py b/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_apply_diffusion_to_w_and_compute_horizontal_gradients_for_turbulence.py index 4e9652ac76..dc81503657 100644 --- a/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_apply_diffusion_to_w_and_compute_horizontal_gradients_for_turbulence.py +++ b/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_apply_diffusion_to_w_and_compute_horizontal_gradients_for_turbulence.py @@ -118,7 +118,7 @@ def reference( out_dwdy[subset] = dwdy[subset] return dict(w=out_w, dwdx=out_dwdx, dwdy=out_dwdy) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict: nrdmax = 13 cell_domain = h_grid.domain(dims.CellDim) diff --git a/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_apply_nabla2_and_nabla4_global_to_vn.py b/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_apply_nabla2_and_nabla4_global_to_vn.py index c2ef62b392..97717a64d2 100644 --- a/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_apply_nabla2_and_nabla4_global_to_vn.py +++ b/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_apply_nabla2_and_nabla4_global_to_vn.py @@ -34,7 +34,7 @@ class TestApplyNabla2AndNabla4GlobalToVn(StencilTest): PROGRAM = apply_nabla2_and_nabla4_global_to_vn OUTPUTS = ("vn",) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid): area_edge = random_field(grid, dims.EdgeDim, dtype=wpfloat) kh_smag_e = random_field(grid, dims.EdgeDim, dims.KDim, dtype=vpfloat) diff --git a/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_apply_nabla2_and_nabla4_to_vn.py b/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_apply_nabla2_and_nabla4_to_vn.py index 3b60be5291..ae71aea8c4 100644 --- a/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_apply_nabla2_and_nabla4_to_vn.py +++ b/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_apply_nabla2_and_nabla4_to_vn.py @@ -42,7 +42,7 @@ class TestApplyNabla2AndNabla4ToVn(StencilTest): PROGRAM = apply_nabla2_and_nabla4_to_vn OUTPUTS = ("vn",) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid): area_edge = random_field(grid, dims.EdgeDim, dtype=wpfloat) kh_smag_e = random_field(grid, dims.EdgeDim, dims.KDim, dtype=vpfloat) diff --git a/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_apply_nabla2_to_vn_in_lateral_boundary.py b/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_apply_nabla2_to_vn_in_lateral_boundary.py index 0de1666efd..580c54e3aa 100644 --- a/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_apply_nabla2_to_vn_in_lateral_boundary.py +++ b/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_apply_nabla2_to_vn_in_lateral_boundary.py @@ -33,7 +33,7 @@ class TestApplyNabla2ToVnInLateralBoundary(StencilTest): PROGRAM = apply_nabla2_to_vn_in_lateral_boundary OUTPUTS = ("vn",) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid): fac_bdydiff_v = wpfloat("5.0") z_nabla2_e = random_field(grid, dims.EdgeDim, dims.KDim, dtype=wpfloat) diff --git a/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_apply_nabla2_to_w.py b/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_apply_nabla2_to_w.py index cf505ee6ca..816ac25e07 100644 --- a/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_apply_nabla2_to_w.py +++ b/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_apply_nabla2_to_w.py @@ -51,7 +51,7 @@ def reference( w = apply_nabla2_to_w_numpy(connectivities, area, z_nabla2_c, geofac_n2s, w, diff_multfac_w) return dict(w=w) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid): area = random_field(grid, dims.CellDim, dtype=wpfloat) z_nabla2_c = random_field(grid, dims.CellDim, dims.KDim, dtype=vpfloat) diff --git a/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_apply_nabla2_to_w_in_upper_damping_layer.py b/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_apply_nabla2_to_w_in_upper_damping_layer.py index 74d532867b..82876600d8 100644 --- a/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_apply_nabla2_to_w_in_upper_damping_layer.py +++ b/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_apply_nabla2_to_w_in_upper_damping_layer.py @@ -34,7 +34,7 @@ class TestApplyNabla2ToWInUpperDampingLayer(StencilTest): PROGRAM = apply_nabla2_to_w_in_upper_damping_layer OUTPUTS = ("w",) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid): w = random_field(grid, dims.CellDim, dims.KDim, dtype=wpfloat) diff_multfac_n2w = random_field(grid, dims.KDim, dtype=wpfloat) diff --git a/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_calculate_diagnostics_for_turbulence.py b/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_calculate_diagnostics_for_turbulence.py index 142ee4d36a..05f4ca81d1 100644 --- a/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_calculate_diagnostics_for_turbulence.py +++ b/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_calculate_diagnostics_for_turbulence.py @@ -47,7 +47,7 @@ def reference( ) return dict(div_ic=div_ic, hdef_ic=hdef_ic) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid): wgtfac_c = random_field(grid, dims.CellDim, dims.KDim, dtype=vpfloat) div = random_field(grid, dims.CellDim, dims.KDim, dtype=vpfloat) diff --git a/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_calculate_horizontal_gradients_for_turbulence.py b/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_calculate_horizontal_gradients_for_turbulence.py index fa6659390b..10d4e43ce2 100644 --- a/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_calculate_horizontal_gradients_for_turbulence.py +++ b/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_calculate_horizontal_gradients_for_turbulence.py @@ -51,7 +51,7 @@ def reference( ) return dict(dwdx=dwdx, dwdy=dwdy) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid): w = data_alloc.random_field(grid, dims.CellDim, dims.KDim, dtype=wpfloat) geofac_grg_x = data_alloc.random_field(grid, dims.CellDim, dims.C2E2CODim, dtype=wpfloat) diff --git a/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_calculate_nabla2_and_smag_coefficients_for_vn.py b/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_calculate_nabla2_and_smag_coefficients_for_vn.py index e9cd84bde4..d115d6deb3 100644 --- a/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_calculate_nabla2_and_smag_coefficients_for_vn.py +++ b/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_calculate_nabla2_and_smag_coefficients_for_vn.py @@ -173,7 +173,7 @@ def reference( return dict(kh_smag_e=kh_smag_e_out, kh_smag_ec=kh_smag_ec_out, z_nabla2_e=z_nabla2_e_out) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict: u_vert = data_alloc.random_field(grid, dims.VertexDim, dims.KDim, dtype=ta.vpfloat) v_vert = data_alloc.random_field(grid, dims.VertexDim, dims.KDim, dtype=ta.vpfloat) diff --git a/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_calculate_nabla2_for_w.py b/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_calculate_nabla2_for_w.py index eb405afab2..09a36b58bc 100644 --- a/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_calculate_nabla2_for_w.py +++ b/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_calculate_nabla2_for_w.py @@ -44,7 +44,7 @@ def reference( z_nabla2_c = calculate_nabla2_for_w_numpy(connectivities, w, geofac_n2s) return dict(z_nabla2_c=z_nabla2_c) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict: w = constant_field(grid, 1.0, dims.CellDim, dims.KDim) geofac_n2s = constant_field(grid, 2.0, dims.CellDim, dims.C2E2CODim) diff --git a/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_calculate_nabla2_for_z.py b/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_calculate_nabla2_for_z.py index f3934007e0..bdff00e5ca 100644 --- a/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_calculate_nabla2_for_z.py +++ b/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_calculate_nabla2_for_z.py @@ -59,7 +59,7 @@ def reference( ) return dict(z_nabla2_e=z_nabla2_e) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid): kh_smag_e = random_field(grid, dims.EdgeDim, dims.KDim, dtype=vpfloat) inv_dual_edge_length = random_field(grid, dims.EdgeDim, dtype=wpfloat) diff --git a/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_calculate_nabla2_of_theta.py b/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_calculate_nabla2_of_theta.py index 5355ee6371..065366e934 100644 --- a/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_calculate_nabla2_of_theta.py +++ b/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_calculate_nabla2_of_theta.py @@ -41,7 +41,7 @@ def reference( z_temp = calculate_nabla2_of_theta_numpy(connectivities, z_nabla2_e, geofac_div) return dict(z_temp=z_temp) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict: z_nabla2_e = data_alloc.random_field(grid, dims.EdgeDim, dims.KDim, dtype=ta.wpfloat) geofac_div = data_alloc.random_field(grid, dims.CellDim, dims.C2EDim, dtype=ta.wpfloat) diff --git a/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_calculate_nabla4.py b/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_calculate_nabla4.py index dc8f9ac4ba..0a73f1c3c8 100644 --- a/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_calculate_nabla4.py +++ b/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_calculate_nabla4.py @@ -97,7 +97,7 @@ def reference( ) return dict(z_nabla4_e2=z_nabla4_e2) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid) -> dict: u_vert = data_alloc.random_field(grid, dims.VertexDim, dims.KDim, dtype=ta.vpfloat) v_vert = data_alloc.random_field(grid, dims.VertexDim, dims.KDim, dtype=ta.vpfloat) diff --git a/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_enhance_diffusion_coefficient_for_grid_point_cold_pools.py b/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_enhance_diffusion_coefficient_for_grid_point_cold_pools.py index 50524d92d4..89b28bb42b 100644 --- a/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_enhance_diffusion_coefficient_for_grid_point_cold_pools.py +++ b/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_enhance_diffusion_coefficient_for_grid_point_cold_pools.py @@ -42,7 +42,7 @@ def reference( ) return dict(kh_smag_e=kh_smag_e) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict: kh_smag_e = random_field(grid, dims.EdgeDim, dims.KDim, dtype=vpfloat) enh_diffu_3d = random_field(grid, dims.CellDim, dims.KDim, dtype=vpfloat) diff --git a/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_temporary_field_for_grid_point_cold_pools_enhancement.py b/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_temporary_field_for_grid_point_cold_pools_enhancement.py index fd0b4563a9..4e61c5703e 100644 --- a/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_temporary_field_for_grid_point_cold_pools_enhancement.py +++ b/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_temporary_field_for_grid_point_cold_pools_enhancement.py @@ -52,7 +52,7 @@ def reference( return dict(enh_diffu_3d=enh_diffu_3d) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict: theta_v = random_field(grid, dims.CellDim, dims.KDim, dtype=wpfloat) theta_ref_mc = random_field(grid, dims.CellDim, dims.KDim, dtype=vpfloat) diff --git a/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_temporary_fields_for_turbulence_diagnostics.py b/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_temporary_fields_for_turbulence_diagnostics.py index 0352652ad2..6cea5e6a00 100644 --- a/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_temporary_fields_for_turbulence_diagnostics.py +++ b/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_temporary_fields_for_turbulence_diagnostics.py @@ -46,7 +46,7 @@ def reference( return dict(div=div, kh_c=kh_c) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid): vn = data_alloc.random_field(grid, dims.EdgeDim, dims.KDim, dtype=ta.wpfloat) geofac_div = data_alloc.random_field(grid, dims.CellDim, dims.C2EDim, dtype=ta.wpfloat) diff --git a/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_truly_horizontal_diffusion_nabla_of_theta_over_steep_points.py b/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_truly_horizontal_diffusion_nabla_of_theta_over_steep_points.py index 93f47096d6..0ce06ce981 100644 --- a/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_truly_horizontal_diffusion_nabla_of_theta_over_steep_points.py +++ b/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_truly_horizontal_diffusion_nabla_of_theta_over_steep_points.py @@ -88,7 +88,7 @@ def reference( ) return dict(z_temp=z_temp) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid): mask = random_mask(grid, dims.CellDim, dims.KDim) diff --git a/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_update_theta_and_exner.py b/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_update_theta_and_exner.py index d7bce46e8a..0c84a6487d 100644 --- a/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_update_theta_and_exner.py +++ b/model/atmosphere/diffusion/tests/diffusion/stencil_tests/test_update_theta_and_exner.py @@ -50,7 +50,7 @@ def reference( theta_v, exner = update_theta_and_exner_numpy(z_temp, area, theta_v, exner, rd_o_cvd) return dict(theta_v=theta_v, exner=exner) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict: z_temp = random_field(grid, dims.CellDim, dims.KDim, dtype=vpfloat) area = random_field(grid, dims.CellDim, dtype=wpfloat) diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_accumulate_prep_adv_fields.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_accumulate_prep_adv_fields.py index c58454e15d..58b32d5d15 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_accumulate_prep_adv_fields.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_accumulate_prep_adv_fields.py @@ -60,7 +60,7 @@ def reference( return dict(vn_traj=vn_traj, mass_flx_me=mass_flx_me) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: mass_fl_e = random_field(grid, dims.EdgeDim, dims.KDim, dtype=wpfloat) mass_flx_me = random_field(grid, dims.EdgeDim, dims.KDim, dtype=wpfloat) diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_add_analysis_increments_from_data_assimilation.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_add_analysis_increments_from_data_assimilation.py index 5bf6bf9525..c4e248313f 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_add_analysis_increments_from_data_assimilation.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_add_analysis_increments_from_data_assimilation.py @@ -58,7 +58,7 @@ def reference( ) return dict(z_rho_expl=z_rho_expl, z_exner_expl=z_exner_expl) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: z_exner_expl = data_alloc.random_field(grid, dims.CellDim, dims.KDim, dtype=ta.wpfloat) exner_incr = data_alloc.random_field(grid, dims.CellDim, dims.KDim, dtype=ta.vpfloat) diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_add_analysis_increments_to_vn.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_add_analysis_increments_to_vn.py index 8f67332647..3f80d216c6 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_add_analysis_increments_to_vn.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_add_analysis_increments_to_vn.py @@ -45,7 +45,7 @@ def reference( vn = add_analysis_increments_to_vn_numpy(vn_incr, vn, iau_wgt_dyn) return dict(vn=vn) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: vn_incr = random_field(grid, dims.EdgeDim, dims.KDim, dtype=vpfloat) vn = random_field(grid, dims.EdgeDim, dims.KDim, dtype=wpfloat) diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_add_extra_diffusion_for_normal_wind_tendency_approaching_cfl.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_add_extra_diffusion_for_normal_wind_tendency_approaching_cfl.py index 6c69b6b94e..8cac1ad9d0 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_add_extra_diffusion_for_normal_wind_tendency_approaching_cfl.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_add_extra_diffusion_for_normal_wind_tendency_approaching_cfl.py @@ -102,7 +102,7 @@ class TestAddExtraDiffusionForNormalWindTendencyApproachingCfl(StencilTest): PROGRAM = add_extra_diffusion_for_normal_wind_tendency_approaching_cfl OUTPUTS = ("ddt_vn_apc",) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: levelmask = data_alloc.random_mask(grid, dims.KDim, extend={dims.KDim: 1}) c_lin_e = data_alloc.random_field(grid, dims.EdgeDim, dims.E2CDim, dtype=ta.wpfloat) diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_add_extra_diffusion_for_w_con_approaching_cfl.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_add_extra_diffusion_for_w_con_approaching_cfl.py index 1e855f11ac..720511cb0b 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_add_extra_diffusion_for_w_con_approaching_cfl.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_add_extra_diffusion_for_w_con_approaching_cfl.py @@ -107,7 +107,7 @@ def reference( ) return dict(ddt_w_adv=ddt_w_adv) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: cfl_clipping = random_mask(grid, dims.CellDim, dims.KDim) owner_mask = random_mask(grid, dims.CellDim) diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_add_interpolated_horizontal_advection_of_w.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_add_interpolated_horizontal_advection_of_w.py index e27f6d9ee7..54ba2b1100 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_add_interpolated_horizontal_advection_of_w.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_add_interpolated_horizontal_advection_of_w.py @@ -55,7 +55,7 @@ def reference( ) return dict(ddt_w_adv=ddt_w_adv) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: z_v_grad_w = data_alloc.random_field(grid, dims.EdgeDim, dims.KDim, dtype=ta.vpfloat) e_bln_c_s = data_alloc.random_field(grid, dims.CellDim, dims.C2EDim, dtype=ta.wpfloat) diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_add_temporal_tendencies_to_vn.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_add_temporal_tendencies_to_vn.py index 861d66d4ba..1a0d714fe8 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_add_temporal_tendencies_to_vn.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_add_temporal_tendencies_to_vn.py @@ -59,7 +59,7 @@ def reference( ) return dict(vn_nnew=vn_nnew) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: dtime = wpfloat("10.0") vn_nnow = random_field(grid, dims.EdgeDim, dims.KDim, dtype=wpfloat) diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_add_temporal_tendencies_to_vn_by_interpolating_between_time_levels.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_add_temporal_tendencies_to_vn_by_interpolating_between_time_levels.py index b84b1bbc74..641cb6a4e0 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_add_temporal_tendencies_to_vn_by_interpolating_between_time_levels.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_add_temporal_tendencies_to_vn_by_interpolating_between_time_levels.py @@ -76,7 +76,7 @@ def reference( ) return dict(vn_nnew=vn_nnew) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: vn_nnow = random_field(grid, dims.EdgeDim, dims.KDim, dtype=ta.wpfloat) ddt_vn_apc_ntl1 = random_field(grid, dims.EdgeDim, dims.KDim, dtype=ta.vpfloat) diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_add_vertical_wind_derivative_to_divergence_damping.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_add_vertical_wind_derivative_to_divergence_damping.py index 723e7952e6..68877d563f 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_add_vertical_wind_derivative_to_divergence_damping.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_add_vertical_wind_derivative_to_divergence_damping.py @@ -68,7 +68,7 @@ def reference( ) return dict(z_graddiv_vn=z_graddiv_vn) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: hmask_dd3d = data_alloc.random_field(grid, dims.EdgeDim, dtype=ta.wpfloat) scalfac_dd3d = data_alloc.random_field(grid, dims.KDim, dtype=ta.wpfloat) diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_apply_2nd_order_divergence_damping.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_apply_2nd_order_divergence_damping.py index 08bd2c8d73..253fe9bd2b 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_apply_2nd_order_divergence_damping.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_apply_2nd_order_divergence_damping.py @@ -45,7 +45,7 @@ def reference( vn = apply_2nd_order_divergence_damping_numpy(z_graddiv_vn, vn, scal_divdamp_o2) return dict(vn=vn) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: z_graddiv_vn = random_field(grid, dims.EdgeDim, dims.KDim, dtype=vpfloat) vn = random_field(grid, dims.EdgeDim, dims.KDim, dtype=wpfloat) diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_apply_4th_order_divergence_damping.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_apply_4th_order_divergence_damping.py index 82148b6461..6f0cb4140a 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_apply_4th_order_divergence_damping.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_apply_4th_order_divergence_damping.py @@ -47,7 +47,7 @@ def reference( vn = apply_4th_order_divergence_damping_numpy(scal_divdamp, z_graddiv2_vn, vn) return dict(vn=vn) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: scal_divdamp = random_field(grid, dims.KDim, dtype=wpfloat) z_graddiv2_vn = random_field(grid, dims.EdgeDim, dims.KDim, dtype=vpfloat) diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_apply_divergence_damping_and_update_vn.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_apply_divergence_damping_and_update_vn.py index ba5d783c5d..601a6c10cb 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_apply_divergence_damping_and_update_vn.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_apply_divergence_damping_and_update_vn.py @@ -188,6 +188,7 @@ def reference( ] ], ids=lambda param: f"divdamp_order[{param['divdamp_order']}]__is_iau_active[{param['is_iau_active']}]__second_order_divdamp_factor[{param['second_order_divdamp_factor']}]", + scope="class", ) def input_data(self, request: pytest.FixtureRequest, grid: base.Grid) -> dict: current_vn = data_alloc.random_field(grid, dims.EdgeDim, dims.KDim) diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_apply_hydrostatic_correction_to_horizontal_gradient_of_exner_pressure.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_apply_hydrostatic_correction_to_horizontal_gradient_of_exner_pressure.py index 7189d02661..7396f64890 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_apply_hydrostatic_correction_to_horizontal_gradient_of_exner_pressure.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_apply_hydrostatic_correction_to_horizontal_gradient_of_exner_pressure.py @@ -54,7 +54,7 @@ def reference( ) return dict(z_gradh_exner=z_gradh_exner) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: ipeidx_dsl = random_mask(grid, dims.EdgeDim, dims.KDim) pg_exdist = random_field(grid, dims.EdgeDim, dims.KDim, dtype=vpfloat) diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_apply_rayleigh_damping_mechanism.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_apply_rayleigh_damping_mechanism.py index 05270e43f2..90f8042e35 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_apply_rayleigh_damping_mechanism.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_apply_rayleigh_damping_mechanism.py @@ -49,7 +49,7 @@ def reference( w = apply_rayleigh_damping_mechanism_numpy(connectivities, z_raylfac, w_1, w) return dict(w=w) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: z_raylfac = random_field(grid, dims.KDim, dtype=wpfloat) w = random_field(grid, dims.CellDim, dims.KDim, dtype=wpfloat) diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_apply_weighted_2nd_and_4th_order_divergence_damping.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_apply_weighted_2nd_and_4th_order_divergence_damping.py index 31de7f151f..937383be01 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_apply_weighted_2nd_and_4th_order_divergence_damping.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_apply_weighted_2nd_and_4th_order_divergence_damping.py @@ -57,7 +57,7 @@ def reference( ) return dict(vn=vn) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: scal_divdamp = random_field(grid, dims.KDim, dtype=wpfloat) bdy_divdamp = random_field(grid, dims.KDim, dtype=wpfloat) diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_advection_in_horizontal_momentum_equation.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_advection_in_horizontal_momentum_equation.py index 8af66a07d7..6eb5c81ea4 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_advection_in_horizontal_momentum_equation.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_advection_in_horizontal_momentum_equation.py @@ -250,6 +250,7 @@ def reference( {"apply_extra_diffusion_on_vn": value} for value in [True, False] ], # True for testing, False for benchmarking ids=lambda param: f"apply_extra_diffusion_on_vn[{param['apply_extra_diffusion_on_vn']}]", + scope="class", ) def input_data( self, request: pytest.FixtureRequest, grid: base.Grid diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_advection_in_vertical_momentum_equation.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_advection_in_vertical_momentum_equation.py index 29e097491d..6a0e7f5f83 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_advection_in_vertical_momentum_equation.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_advection_in_vertical_momentum_equation.py @@ -409,7 +409,7 @@ def reference( vertical_cfl=vertical_cfl_ret, ) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: contravariant_corrected_w_at_cells_on_model_levels = data_alloc.zero_field( grid, dims.CellDim, dims.KDim @@ -627,6 +627,7 @@ def reference( {"skip_compute_predictor_vertical_advection": value} for value in [True, False] ], # True for benchmarking, False for testing ids=lambda param: f"skip_compute_predictor_vertical_advection[{param['skip_compute_predictor_vertical_advection']}]", + scope="class", ) def input_data( self, grid: base.Grid, request: pytest.FixtureRequest diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_advective_vertical_wind_tendency.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_advective_vertical_wind_tendency.py index 21fdb8c7ef..b02d3f84e7 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_advective_vertical_wind_tendency.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_advective_vertical_wind_tendency.py @@ -56,7 +56,7 @@ def reference( ) return dict(ddt_w_adv=ddt_w_adv) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: z_w_con_c = random_field(grid, dims.CellDim, dims.KDim, dtype=vpfloat) w = random_field(grid, dims.CellDim, dims.KDim, extend={dims.KDim: 1}, dtype=wpfloat) diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_airmass.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_airmass.py index 61445dcf1e..6566146ace 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_airmass.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_airmass.py @@ -35,7 +35,7 @@ def reference( airmass_out = rho_in * ddqz_z_full_in * deepatmo_t1mc_in return dict(airmass_out=airmass_out) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: rho_in = random_field(grid, dims.CellDim, dims.KDim, dtype=wpfloat) ddqz_z_full_in = random_field(grid, dims.CellDim, dims.KDim, dtype=wpfloat) diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_approx_of_2nd_vertical_derivative_of_exner.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_approx_of_2nd_vertical_derivative_of_exner.py index d842690914..1e308955fd 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_approx_of_2nd_vertical_derivative_of_exner.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_approx_of_2nd_vertical_derivative_of_exner.py @@ -57,7 +57,7 @@ def reference( ) return dict(z_dexner_dz_c_2=z_dexner_dz_c_2) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: z_theta_v_pr_ic = random_field( grid, dims.CellDim, dims.KDim, extend={dims.KDim: 1}, dtype=vpfloat diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_averaged_vn_and_fluxes_and_prepare_tracer_advection.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_averaged_vn_and_fluxes_and_prepare_tracer_advection.py index 20073ddcec..d1ad0a24f7 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_averaged_vn_and_fluxes_and_prepare_tracer_advection.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_averaged_vn_and_fluxes_and_prepare_tracer_advection.py @@ -163,6 +163,7 @@ def reference( ] ], ids=lambda p: f"prepare_advection[{p['prepare_advection']}]__at_first_substep[{p['at_first_substep']}]", + scope="class", ) def input_data( self, request: pytest.FixtureRequest, grid: base.Grid diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_avg_vn_and_graddiv_vn_and_vt.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_avg_vn_and_graddiv_vn_and_vt.py index 5cf3efa33b..fc9664a2cc 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_avg_vn_and_graddiv_vn_and_vt.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_avg_vn_and_graddiv_vn_and_vt.py @@ -65,7 +65,7 @@ def reference( ) return dict(z_vn_avg=z_vn_avg, z_graddiv_vn=z_graddiv_vn, vt=vt) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: e_flx_avg = random_field(grid, dims.EdgeDim, dims.E2C2EODim, dtype=wpfloat) geofac_grdiv = random_field(grid, dims.EdgeDim, dims.E2C2EODim, dtype=wpfloat) diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_contravariant_correction.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_contravariant_correction.py index e557ec551d..c18b8bffeb 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_contravariant_correction.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_contravariant_correction.py @@ -45,7 +45,7 @@ def reference( z_w_concorr_me = compute_contravariant_correction_numpy(vn, ddxn_z_full, ddxt_z_full, vt) return dict(z_w_concorr_me=z_w_concorr_me) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: vn = random_field(grid, dims.EdgeDim, dims.KDim, dtype=wpfloat) ddxn_z_full = random_field(grid, dims.EdgeDim, dims.KDim, dtype=vpfloat) diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_contravariant_correction_of_w.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_contravariant_correction_of_w.py index 6a7d916250..7de0fb6249 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_contravariant_correction_of_w.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_contravariant_correction_of_w.py @@ -56,7 +56,7 @@ def reference( ) return dict(w_concorr_c=w_concorr_c) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: e_bln_c_s = random_field(grid, dims.CellDim, dims.C2EDim, dtype=wpfloat) z_w_concorr_me = random_field(grid, dims.EdgeDim, dims.KDim, dtype=vpfloat) diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_contravariant_correction_of_w_for_lower_boundary.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_contravariant_correction_of_w_for_lower_boundary.py index 1723d907a5..c899c092d5 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_contravariant_correction_of_w_for_lower_boundary.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_contravariant_correction_of_w_for_lower_boundary.py @@ -65,7 +65,7 @@ def reference( ) return dict(w_concorr_c=w_concorr_c) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: e_bln_c_s = random_field(grid, dims.CellDim, dims.C2EDim, dtype=wpfloat) z_w_concorr_me = random_field(grid, dims.EdgeDim, dims.KDim, dtype=vpfloat) diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_derived_horizontal_winds_and_ke_and_contravariant_correction.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_derived_horizontal_winds_and_ke_and_contravariant_correction.py index 2a35b45ff1..28b80dd4df 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_derived_horizontal_winds_and_ke_and_contravariant_correction.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_derived_horizontal_winds_and_ke_and_contravariant_correction.py @@ -295,6 +295,7 @@ def reference( {"skip_compute_predictor_vertical_advection": value} for value in [True, False] ], # True for benchmarking, False for testing ids=lambda param: f"skip_compute_predictor_vertical_advection[{param['skip_compute_predictor_vertical_advection']}]", + scope="class", ) def input_data( self, grid: base.Grid, request: pytest.FixtureRequest diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_divergence_of_fluxes_of_rho_and_theta.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_divergence_of_fluxes_of_rho_and_theta.py index d009a74d8d..124ab43ba1 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_divergence_of_fluxes_of_rho_and_theta.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_divergence_of_fluxes_of_rho_and_theta.py @@ -57,7 +57,7 @@ def reference( ) return dict(z_flxdiv_mass=z_flxdiv_mass, z_flxdiv_theta=z_flxdiv_theta) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: geofac_div = data_alloc.random_field(grid, dims.CellDim, dims.C2EDim, dtype=ta.wpfloat) z_theta_v_fl_e = data_alloc.random_field(grid, dims.EdgeDim, dims.KDim, dtype=ta.wpfloat) diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_dwdz_for_divergence_damping.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_dwdz_for_divergence_damping.py index a14d93aca1..5d5f07155c 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_dwdz_for_divergence_damping.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_dwdz_for_divergence_damping.py @@ -50,7 +50,7 @@ def reference( ) return dict(out=z_dwdz_dd) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, Any]: inv_ddqz_z_full = random_field(grid, dims.CellDim, dims.KDim, dtype=vpfloat) w = random_field(grid, dims.CellDim, dims.KDim, extend={dims.KDim: 1}, dtype=wpfloat) diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_exner_from_rhotheta.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_exner_from_rhotheta.py index 582a4ef0d3..693bd5fef3 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_exner_from_rhotheta.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_exner_from_rhotheta.py @@ -38,7 +38,7 @@ def reference( exner = np.exp(rd_o_cvd * np.log(rd_o_p0ref * rho * theta_v)) return dict(out=(theta_v, exner)) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, Any]: rd_o_cvd = wpfloat("10.0") rd_o_p0ref = wpfloat("20.0") diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_explicit_part_for_rho_and_exner.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_explicit_part_for_rho_and_exner.py index 347299fd46..9d6624d00f 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_explicit_part_for_rho_and_exner.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_explicit_part_for_rho_and_exner.py @@ -85,7 +85,7 @@ def reference( ) return dict(z_rho_expl=z_rho_expl, z_exner_expl=z_exner_expl) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: dtime = ta.wpfloat("1.0") rho_nnow = data_alloc.random_field(grid, dims.CellDim, dims.KDim, dtype=ta.wpfloat) diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_explicit_vertical_wind_from_advection_and_vertical_wind_density.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_explicit_vertical_wind_from_advection_and_vertical_wind_density.py index efd3ba9a10..fd6e7eb72e 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_explicit_vertical_wind_from_advection_and_vertical_wind_density.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_explicit_vertical_wind_from_advection_and_vertical_wind_density.py @@ -82,7 +82,7 @@ def reference( ) return dict(z_w_expl=z_w_expl, z_contr_w_fl_l=z_contr_w_fl_l) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: w_nnow = data_alloc.random_field(grid, dims.CellDim, dims.KDim, dtype=ta.wpfloat) ddt_w_adv_ntl1 = data_alloc.random_field(grid, dims.CellDim, dims.KDim, dtype=ta.vpfloat) diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_explicit_vertical_wind_speed_and_vertical_wind_times_density.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_explicit_vertical_wind_speed_and_vertical_wind_times_density.py index bdaf78fbc3..3cbf36e98d 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_explicit_vertical_wind_speed_and_vertical_wind_times_density.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_explicit_vertical_wind_speed_and_vertical_wind_times_density.py @@ -72,7 +72,7 @@ def reference( ) return dict(z_w_expl=z_w_expl, z_contr_w_fl_l=z_contr_w_fl_l) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: w_nnow = random_field(grid, dims.CellDim, dims.KDim, dtype=wpfloat) ddt_w_adv_ntl1 = random_field(grid, dims.CellDim, dims.KDim, dtype=vpfloat) diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_graddiv2_of_vn.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_graddiv2_of_vn.py index 3f9eca2afc..9df4526221 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_graddiv2_of_vn.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_graddiv2_of_vn.py @@ -49,7 +49,7 @@ def reference( z_graddiv2_vn = compute_graddiv2_of_vn_numpy(connectivities, geofac_grdiv, z_graddiv_vn) return dict(z_graddiv2_vn=z_graddiv2_vn) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: z_graddiv_vn = random_field(grid, dims.EdgeDim, dims.KDim, dtype=vpfloat) geofac_grdiv = random_field(grid, dims.EdgeDim, dims.E2C2EODim, dtype=wpfloat) diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_horizontal_advection_of_rho_and_theta.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_horizontal_advection_of_rho_and_theta.py index ad61d07c8a..07aab9f9b3 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_horizontal_advection_of_rho_and_theta.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_horizontal_advection_of_rho_and_theta.py @@ -251,7 +251,7 @@ def reference( ) return dict(out=(z_rho_e, z_theta_v_e)) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: p_vn = data_alloc.random_field(grid, dims.EdgeDim, dims.KDim, dtype=ta.wpfloat) p_vt = data_alloc.random_field(grid, dims.EdgeDim, dims.KDim, dtype=ta.vpfloat) diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_horizontal_advection_term_for_vertical_velocity.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_horizontal_advection_term_for_vertical_velocity.py index 0c47cf433c..c6d80e8216 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_horizontal_advection_term_for_vertical_velocity.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_horizontal_advection_term_for_vertical_velocity.py @@ -82,7 +82,7 @@ def reference( )[horizontal_start:horizontal_end, :] return dict(z_v_grad_w=z_v_grad_w) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: vn_ie = random_field(grid, dims.EdgeDim, dims.KDim, dtype=vpfloat) inv_dual_edge_length = random_field(grid, dims.EdgeDim, dtype=wpfloat) diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_horizontal_gradient_of_exner_pressure_for_flat_coordinates.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_horizontal_gradient_of_exner_pressure_for_flat_coordinates.py index 09ade5f64b..530e9e7e67 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_horizontal_gradient_of_exner_pressure_for_flat_coordinates.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_horizontal_gradient_of_exner_pressure_for_flat_coordinates.py @@ -53,7 +53,7 @@ def reference( ) return dict(z_gradh_exner=z_gradh_exner) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: inv_dual_edge_length = random_field(grid, dims.EdgeDim, dtype=wpfloat) z_exner_ex_pr = random_field(grid, dims.CellDim, dims.KDim, dtype=vpfloat) diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_horizontal_gradient_of_exner_pressure_for_multiple_levels.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_horizontal_gradient_of_exner_pressure_for_multiple_levels.py index 53555a19e6..373361c042 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_horizontal_gradient_of_exner_pressure_for_multiple_levels.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_horizontal_gradient_of_exner_pressure_for_multiple_levels.py @@ -91,7 +91,7 @@ def reference( ) return dict(z_gradh_exner=z_gradh_exner) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: inv_dual_edge_length = random_field(grid, dims.EdgeDim, dtype=ta.wpfloat) z_exner_ex_pr = random_field(grid, dims.CellDim, dims.KDim, dtype=ta.vpfloat) diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_horizontal_gradient_of_exner_pressure_for_nonflat_coordinates.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_horizontal_gradient_of_exner_pressure_for_nonflat_coordinates.py index 0369fc2b9c..c07e738947 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_horizontal_gradient_of_exner_pressure_for_nonflat_coordinates.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_horizontal_gradient_of_exner_pressure_for_nonflat_coordinates.py @@ -68,7 +68,7 @@ def reference( ) return dict(z_gradh_exner=z_gradh_exner) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: inv_dual_edge_length = random_field(grid, dims.EdgeDim, dtype=wpfloat) z_exner_ex_pr = random_field(grid, dims.CellDim, dims.KDim, dtype=vpfloat) diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_horizontal_kinetic_energy.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_horizontal_kinetic_energy.py index a81376ec23..a97d8d7a1c 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_horizontal_kinetic_energy.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_horizontal_kinetic_energy.py @@ -43,7 +43,7 @@ def reference( vn_ie, z_vt_ie, z_kin_hor_e = compute_horizontal_kinetic_energy_numpy(vn, vt) return dict(vn_ie=vn_ie, z_vt_ie=z_vt_ie, z_kin_hor_e=z_kin_hor_e) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: vn = random_field(grid, dims.EdgeDim, dims.KDim, dtype=wpfloat) vt = random_field(grid, dims.EdgeDim, dims.KDim, dtype=vpfloat) diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_horizontal_velocity_quantities_and_fluxes.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_horizontal_velocity_quantities_and_fluxes.py index 3990a90e9d..32cde480f0 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_horizontal_velocity_quantities_and_fluxes.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_horizontal_velocity_quantities_and_fluxes.py @@ -275,7 +275,7 @@ def reference( contravariant_correction_at_edges_on_model_levels=contravariant_correction_at_edges_on_model_levels, ) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: spatially_averaged_vn = data_alloc.zero_field(grid, dims.EdgeDim, dims.KDim) horizontal_gradient_of_normal_wind_divergence = data_alloc.zero_field( diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_hydrostatic_correction_term.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_hydrostatic_correction_term.py index 7eed5b8929..0eb6d71696 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_hydrostatic_correction_term.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_hydrostatic_correction_term.py @@ -130,7 +130,7 @@ def reference( ) return dict(z_hydro_corr=z_hydro_corr) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: ikoffset = data_alloc.zero_field( grid, dims.EdgeDim, dims.E2CDim, dims.KDim, dtype=gtx.int32 diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_mass_flux.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_mass_flux.py index 330d0410a0..63121c1961 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_mass_flux.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_mass_flux.py @@ -54,7 +54,7 @@ def reference( return dict(mass_fl_e=mass_fl_e, z_theta_v_fl_e=z_theta_v_fl_e) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: z_rho_e = random_field(grid, dims.EdgeDim, dims.KDim, dtype=wpfloat) z_vn_avg = random_field(grid, dims.EdgeDim, dims.KDim, dtype=wpfloat) diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_maximum_cfl_and_clip_contravariant_vertical_velocity.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_maximum_cfl_and_clip_contravariant_vertical_velocity.py index 2cd2a83c8f..84cbf72c48 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_maximum_cfl_and_clip_contravariant_vertical_velocity.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_maximum_cfl_and_clip_contravariant_vertical_velocity.py @@ -70,7 +70,7 @@ def reference( z_w_con_c=z_w_con_c, ) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: ddqz_z_half = random_field(grid, dims.CellDim, dims.KDim, dtype=ta.vpfloat) z_w_con_c = random_field(grid, dims.CellDim, dims.KDim, dtype=ta.vpfloat) diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_perturbation_of_rho_and_theta.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_perturbation_of_rho_and_theta.py index 79d910c5b9..9c3bc1fc47 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_perturbation_of_rho_and_theta.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_perturbation_of_rho_and_theta.py @@ -51,7 +51,7 @@ def reference( ) return dict(z_rth_pr_1=z_rth_pr_1, z_rth_pr_2=z_rth_pr_2) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: rho = random_field(grid, dims.CellDim, dims.KDim, dtype=wpfloat) rho_ref_mc = random_field(grid, dims.CellDim, dims.KDim, dtype=vpfloat) diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_perturbation_of_rho_and_theta_and_rho_interface_cell_centers.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_perturbation_of_rho_and_theta_and_rho_interface_cell_centers.py index e224318650..cab2d5ca4c 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_perturbation_of_rho_and_theta_and_rho_interface_cell_centers.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_perturbation_of_rho_and_theta_and_rho_interface_cell_centers.py @@ -66,7 +66,7 @@ def reference( ) return dict(rho_ic=rho_ic, z_rth_pr_1=z_rth_pr_1, z_rth_pr_2=z_rth_pr_2) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: wgtfac_c = random_field(grid, dims.CellDim, dims.KDim, dtype=vpfloat) rho = random_field(grid, dims.CellDim, dims.KDim, dtype=wpfloat) diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_perturbed_quantities_and_interpolation.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_perturbed_quantities_and_interpolation.py index a173e626f1..14089fbaac 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_perturbed_quantities_and_interpolation.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_perturbed_quantities_and_interpolation.py @@ -347,7 +347,7 @@ def reference( d2dz2_of_temporal_extrapolation_of_perturbed_exner_on_model_levels=d2dz2_of_temporal_extrapolation_of_perturbed_exner_on_model_levels, ) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: reference_rho_at_cells_on_model_levels = data_alloc.random_field( grid, dims.CellDim, dims.KDim diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_results_for_thermodynamic_variables.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_results_for_thermodynamic_variables.py index 2efbdbddd9..6345bc6d8b 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_results_for_thermodynamic_variables.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_results_for_thermodynamic_variables.py @@ -102,7 +102,7 @@ def reference( ) return dict(rho_new=rho_new, exner_new=exner_new, theta_v_new=theta_v_new) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: z_rho_expl = data_alloc.random_field(grid, dims.CellDim, dims.KDim, dtype=ta.wpfloat) vwind_impl_wgt = data_alloc.random_field(grid, dims.CellDim, dtype=ta.wpfloat) diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_rho_virtual_potential_temperatures_and_pressure_gradient.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_rho_virtual_potential_temperatures_and_pressure_gradient.py index 6f71a1f98a..721e38564e 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_rho_virtual_potential_temperatures_and_pressure_gradient.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_rho_virtual_potential_temperatures_and_pressure_gradient.py @@ -128,7 +128,7 @@ def reference( z_th_ddz_exner_c=z_th_ddz_exner_c, ) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: dtime = ta.wpfloat("1.0") wgt_nnow_rth = ta.wpfloat("2.0") diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_solver_coefficients_matrix.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_solver_coefficients_matrix.py index da06853a0a..120347b429 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_solver_coefficients_matrix.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_solver_coefficients_matrix.py @@ -74,7 +74,7 @@ def reference( ) return dict(z_beta=z_beta, z_alpha=z_alpha) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: exner_nnow = data_alloc.random_field(grid, dims.CellDim, dims.KDim, dtype=ta.wpfloat) rho_nnow = data_alloc.random_field(grid, dims.CellDim, dims.KDim, dtype=ta.wpfloat) diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_tangential_wind.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_tangential_wind.py index fbcc397990..4655ee9780 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_tangential_wind.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_tangential_wind.py @@ -44,7 +44,7 @@ def reference( vt = compute_tangential_wind_numpy(connectivities, vn, rbf_vec_coeff_e) return dict(vt=vt) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: vn = random_field(grid, dims.EdgeDim, dims.KDim, dtype=wpfloat) rbf_vec_coeff_e = random_field(grid, dims.EdgeDim, dims.E2C2EDim, dtype=wpfloat) diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_theta_and_exner.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_theta_and_exner.py index ff5bc26e71..b5d49fccae 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_theta_and_exner.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_theta_and_exner.py @@ -43,7 +43,7 @@ def reference( return dict(theta_v=theta_v, exner=exner) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: rd_o_cvd = ta.wpfloat("10.0") rd_o_p0ref = ta.wpfloat("20.0") diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_virtual_potential_temperatures_and_pressure_gradient.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_virtual_potential_temperatures_and_pressure_gradient.py index 4ef0d53930..2d3eb8fd2a 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_virtual_potential_temperatures_and_pressure_gradient.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_virtual_potential_temperatures_and_pressure_gradient.py @@ -92,7 +92,7 @@ def reference( z_th_ddz_exner_c=z_th_ddz_exner_c, ) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: wgtfac_c = random_field(grid, dims.CellDim, dims.KDim, dtype=vpfloat) z_rth_pr_2 = random_field(grid, dims.CellDim, dims.KDim, dtype=vpfloat) diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_vn_on_lateral_boundary.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_vn_on_lateral_boundary.py index 50aec37834..55ee685d0c 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_vn_on_lateral_boundary.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_compute_vn_on_lateral_boundary.py @@ -36,7 +36,7 @@ def reference( vn_new = vn_now + dtime * grf_tend_vn return dict(vn_new=vn_new) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: grf_tend_vn = random_field(grid, dims.EdgeDim, dims.KDim, dtype=ta.wpfloat) vn_now = random_field(grid, dims.EdgeDim, dims.KDim, dtype=ta.wpfloat) diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_copy_cell_kdim_field_to_vp.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_copy_cell_kdim_field_to_vp.py index e1408308a9..7f4d22ee23 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_copy_cell_kdim_field_to_vp.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_copy_cell_kdim_field_to_vp.py @@ -38,7 +38,7 @@ def reference( field_copy = copy_cell_kdim_field_to_vp_numpy(field) return dict(field_copy=field_copy) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: field = random_field(grid, dims.CellDim, dims.KDim, dtype=wpfloat) field_copy = zero_field(grid, dims.CellDim, dims.KDim, dtype=vpfloat) diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_extrapolate_at_top.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_extrapolate_at_top.py index 74c9b6845d..e35da36b5c 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_extrapolate_at_top.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_extrapolate_at_top.py @@ -51,7 +51,7 @@ def reference( vn_ie = extrapolate_at_top_numpy(wgtfacq_e, vn) return dict(vn_ie=vn_ie) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: wgtfacq_e = random_field(grid, dims.EdgeDim, dims.KDim, dtype=vpfloat) vn = random_field(grid, dims.EdgeDim, dims.KDim, dtype=wpfloat) diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_extrapolate_temporally_exner_pressure.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_extrapolate_temporally_exner_pressure.py index a87d532ff4..aa18002e4a 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_extrapolate_temporally_exner_pressure.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_extrapolate_temporally_exner_pressure.py @@ -57,7 +57,7 @@ def reference( return dict(z_exner_ex_pr=z_exner_ex_pr, exner_pr=exner_pr) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: exner = random_field(grid, dims.CellDim, dims.KDim, dtype=wpfloat) exner_ref_mc = random_field(grid, dims.CellDim, dims.KDim, dtype=vpfloat) diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_init_cell_kdim_field_with_zero_wp.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_init_cell_kdim_field_with_zero_wp.py index a0c2e0f902..814b9a7ba8 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_init_cell_kdim_field_with_zero_wp.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_init_cell_kdim_field_with_zero_wp.py @@ -49,7 +49,7 @@ def reference( field_with_zero_wp = np.zeros_like(field_with_zero_wp) return dict(field_with_zero_wp=field_with_zero_wp) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: field_with_zero_wp = zero_field(grid, dims.CellDim, dims.KDim, dtype=wpfloat) diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_init_two_edge_kdim_fields_with_zero_wp.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_init_two_edge_kdim_fields_with_zero_wp.py index 77c5de7055..080bac1441 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_init_two_edge_kdim_fields_with_zero_wp.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_init_two_edge_kdim_fields_with_zero_wp.py @@ -40,7 +40,7 @@ def reference( edge_kdim_field_with_zero_wp_2=edge_kdim_field_with_zero_wp_2, ) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: edge_kdim_field_with_zero_wp_1 = zero_field(grid, dims.EdgeDim, dims.KDim, dtype=wpfloat) edge_kdim_field_with_zero_wp_2 = zero_field(grid, dims.EdgeDim, dims.KDim, dtype=wpfloat) diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_interpolate_cell_field_to_half_levels_vp.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_interpolate_cell_field_to_half_levels_vp.py index 4cc48fd101..b23f88234f 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_interpolate_cell_field_to_half_levels_vp.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_interpolate_cell_field_to_half_levels_vp.py @@ -50,7 +50,7 @@ def reference( ) return dict(interpolation_to_half_levels_vp=interpolation_to_half_levels_vp) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: interpolant = random_field(grid, dims.CellDim, dims.KDim, dtype=ta.vpfloat) wgtfac_c = random_field(grid, dims.CellDim, dims.KDim, dtype=ta.vpfloat) diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_interpolate_contravariant_vertical_velocity_to_full_levels.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_interpolate_contravariant_vertical_velocity_to_full_levels.py index 12f5fd8506..dfbcc454d3 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_interpolate_contravariant_vertical_velocity_to_full_levels.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_interpolate_contravariant_vertical_velocity_to_full_levels.py @@ -40,7 +40,7 @@ def reference( z_w_con_c_full = interpolate_contravariant_vertical_velocity_to_full_levels_numpy(z_w_con_c) return dict(z_w_con_c_full=z_w_con_c_full) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: z_w_con_c = random_field( grid, dims.CellDim, dims.KDim, extend={dims.KDim: 1}, dtype=vpfloat diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_interpolate_rho_theta_v_to_half_levels_and_compute_temperature_vertical_gradient.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_interpolate_rho_theta_v_to_half_levels_and_compute_temperature_vertical_gradient.py index e9ab186490..ac6a273aae 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_interpolate_rho_theta_v_to_half_levels_and_compute_temperature_vertical_gradient.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_interpolate_rho_theta_v_to_half_levels_and_compute_temperature_vertical_gradient.py @@ -182,7 +182,7 @@ def reference( pressure_buoyancy_acceleration_at_cells_on_half_levels=pressure_buoyancy_acceleration_at_cells_on_half_levels, ) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: w = data_alloc.random_field(grid, dims.CellDim, dims.KDim) contravariant_correction_at_cells_on_half_levels = data_alloc.random_field( diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_interpolate_to_cell_center.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_interpolate_to_cell_center.py index 8f018db9ca..5c0602bd22 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_interpolate_to_cell_center.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_interpolate_to_cell_center.py @@ -51,7 +51,7 @@ def reference( interpolation = interpolate_to_cell_center_numpy(connectivities, interpolant, e_bln_c_s) return dict(interpolation=interpolation) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: interpolant = data_alloc.random_field(grid, dims.EdgeDim, dims.KDim, dtype=ta.vpfloat) e_bln_c_s = data_alloc.random_field(grid, dims.CellDim, dims.C2EDim, dtype=ta.wpfloat) diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_interpolate_to_surface.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_interpolate_to_surface.py index 2dc775909d..875d6f728e 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_interpolate_to_surface.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_interpolate_to_surface.py @@ -51,7 +51,7 @@ def reference( ) return dict(interpolation_to_surface=interpolation_to_surface) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: interpolant = random_field(grid, dims.CellDim, dims.KDim, dtype=vpfloat) wgtfacq_c = random_field(grid, dims.CellDim, dims.KDim, dtype=vpfloat) diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_interpolate_vn_and_vt_to_ie_and_compute_ekin_on_edges.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_interpolate_vn_and_vt_to_ie_and_compute_ekin_on_edges.py index b998025020..42502132b3 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_interpolate_vn_and_vt_to_ie_and_compute_ekin_on_edges.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_interpolate_vn_and_vt_to_ie_and_compute_ekin_on_edges.py @@ -45,7 +45,7 @@ def reference( z_kin_hor_e[:, 0] = 0 return dict(vn_ie=vn_ie, z_vt_ie=z_vt_ie, z_kin_hor_e=z_kin_hor_e) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: wgtfac_e = zero_field(grid, dims.EdgeDim, dims.KDim, dtype=vpfloat) vn = random_field(grid, dims.EdgeDim, dims.KDim, dtype=wpfloat) diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_interpolate_vn_to_half_levels_and_compute_kinetic_energy_on_edges.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_interpolate_vn_to_half_levels_and_compute_kinetic_energy_on_edges.py index b2a19e3566..1c179606de 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_interpolate_vn_to_half_levels_and_compute_kinetic_energy_on_edges.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_interpolate_vn_to_half_levels_and_compute_kinetic_energy_on_edges.py @@ -84,7 +84,7 @@ def reference( z_kin_hor_e=z_kin_hor_e, ) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: wgtfac_e = random_field(grid, dims.EdgeDim, dims.KDim, dtype=vpfloat) vn = random_field(grid, dims.EdgeDim, dims.KDim, dtype=wpfloat) diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_interpolate_vt_to_interface_edges.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_interpolate_vt_to_interface_edges.py index 4fc1660fb6..88a3c4b887 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_interpolate_vt_to_interface_edges.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_interpolate_vt_to_interface_edges.py @@ -50,7 +50,7 @@ def reference( z_vt_ie[subset] = interpolate_vt_to_interface_edges_numpy(wgtfac_e, vt)[subset] return dict(z_vt_ie=z_vt_ie) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: wgtfac_e = data_alloc.random_field(grid, dims.EdgeDim, dims.KDim, dtype=ta.vpfloat) vt = data_alloc.random_field(grid, dims.EdgeDim, dims.KDim, dtype=ta.vpfloat) diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_mo_icon_interpolation_scalar_cells2verts_scalar_ri_dsl.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_mo_icon_interpolation_scalar_cells2verts_scalar_ri_dsl.py index 3ca6d13109..a251f10706 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_mo_icon_interpolation_scalar_cells2verts_scalar_ri_dsl.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_mo_icon_interpolation_scalar_cells2verts_scalar_ri_dsl.py @@ -49,7 +49,7 @@ def reference( p_vert_out=p_vert_out, ) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: p_cell_in = random_field(grid, dims.CellDim, dims.KDim, dtype=wpfloat) c_intp = random_field(grid, dims.VertexDim, dims.V2CDim, dtype=wpfloat) diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_mo_math_divrot_rot_vertex_ri_dsl.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_mo_math_divrot_rot_vertex_ri_dsl.py index b819687c83..27cf49018d 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_mo_math_divrot_rot_vertex_ri_dsl.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_mo_math_divrot_rot_vertex_ri_dsl.py @@ -45,7 +45,7 @@ def reference( rot_vec = mo_math_divrot_rot_vertex_ri_dsl_numpy(connectivities, vec_e, geofac_rot) return dict(rot_vec=rot_vec) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: vec_e = random_field(grid, dims.EdgeDim, dims.KDim, dtype=wpfloat) geofac_rot = random_field(grid, dims.VertexDim, dims.V2EDim, dtype=wpfloat) diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_set_lower_boundary_condition_for_w_and_contravariant_correction.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_set_lower_boundary_condition_for_w_and_contravariant_correction.py index af727d761e..61a19e760a 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_set_lower_boundary_condition_for_w_and_contravariant_correction.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_set_lower_boundary_condition_for_w_and_contravariant_correction.py @@ -51,7 +51,7 @@ def reference( ) return dict(w_nnew=w_nnew, z_contr_w_fl_l=z_contr_w_fl_l) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: w_concorr_c = random_field(grid, dims.CellDim, dims.KDim, dtype=vpfloat) z_contr_w_fl_l = zero_field(grid, dims.CellDim, dims.KDim, dtype=wpfloat) diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_set_theta_v_prime_ic_at_lower_boundary.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_set_theta_v_prime_ic_at_lower_boundary.py index 122f1913ef..bd115a4409 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_set_theta_v_prime_ic_at_lower_boundary.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_set_theta_v_prime_ic_at_lower_boundary.py @@ -63,7 +63,7 @@ def reference( ) return dict(z_theta_v_pr_ic=z_theta_v_pr_ic, theta_v_ic=theta_v_ic) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: wgtfacq_c = random_field(grid, dims.CellDim, dims.KDim, dtype=vpfloat) z_rth_pr = random_field(grid, dims.CellDim, dims.KDim, dtype=vpfloat) diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_solve_tridiagonal_matrix_for_w_back_substitution.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_solve_tridiagonal_matrix_for_w_back_substitution.py index 076e84b767..aca2b603b2 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_solve_tridiagonal_matrix_for_w_back_substitution.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_solve_tridiagonal_matrix_for_w_back_substitution.py @@ -52,7 +52,7 @@ def reference( w_new = solve_tridiagonal_matrix_for_w_back_substitution_numpy(connectivities, z_q=z_q, w=w) return dict(w=w_new) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: z_q = random_field(grid, dims.CellDim, dims.KDim, dtype=vpfloat) w = random_field(grid, dims.CellDim, dims.KDim, dtype=wpfloat) diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_solve_tridiagonal_matrix_for_w_forward_sweep.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_solve_tridiagonal_matrix_for_w_forward_sweep.py index 7bd38f9619..3a9ad4037b 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_solve_tridiagonal_matrix_for_w_forward_sweep.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_solve_tridiagonal_matrix_for_w_forward_sweep.py @@ -92,7 +92,7 @@ def reference( ) return dict(z_q=z_q_ref, w=w_ref) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base_grid.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: vwind_impl_wgt = data_alloc.random_field(grid, dims.CellDim, dtype=ta.wpfloat) theta_v_ic = data_alloc.random_field(grid, dims.CellDim, dims.KDim, dtype=ta.wpfloat) diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_spatially_average_flux_or_velocity.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_spatially_average_flux_or_velocity.py index d9d8ae062c..f09acf69b3 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_spatially_average_flux_or_velocity.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_spatially_average_flux_or_velocity.py @@ -53,7 +53,7 @@ def reference( return dict(spatially_averaged_flux_or_velocity=spatially_averaged_flux_or_velocity) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: e_flx_avg = random_field(grid, dims.EdgeDim, dims.E2C2EODim, dtype=wpfloat) flux_or_velocity = random_field(grid, dims.EdgeDim, dims.KDim, dtype=wpfloat) diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_update_density_exner_wind.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_update_density_exner_wind.py index 612a940991..2fc3e61d21 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_update_density_exner_wind.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_update_density_exner_wind.py @@ -42,7 +42,7 @@ def reference( w_new = w_now + dtime * grf_tend_w return dict(rho_new=rho_new, exner_new=exner_new, w_new=w_new) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: rho_now = random_field(grid, dims.CellDim, dims.KDim, dtype=ta.wpfloat) grf_tend_rho = random_field(grid, dims.CellDim, dims.KDim, dtype=ta.wpfloat) diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_update_dynamical_exner_time_increment.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_update_dynamical_exner_time_increment.py index ffcb582b55..456828fed6 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_update_dynamical_exner_time_increment.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_update_dynamical_exner_time_increment.py @@ -58,7 +58,7 @@ def reference( ) return dict(exner_dyn_incr=exner_dyn_incr) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: ndyn_substeps_var, dtime = wpfloat("10.0"), wpfloat("12.0") exner = random_field(grid, dims.CellDim, dims.KDim, dtype=wpfloat) diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_update_mass_flux_weighted.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_update_mass_flux_weighted.py index 5a0e5422da..f63b88cfe2 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_update_mass_flux_weighted.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_update_mass_flux_weighted.py @@ -60,7 +60,7 @@ def reference( ) return dict(mass_flx_ic=mass_flx_ic) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: r_nsubsteps = wpfloat("10.0") rho_ic = random_field(grid, dims.CellDim, dims.KDim, dtype=wpfloat) diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_update_mass_volume_flux.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_update_mass_volume_flux.py index 64cd7fab4f..b0a497719d 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_update_mass_volume_flux.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_update_mass_volume_flux.py @@ -67,7 +67,7 @@ def reference( ) return dict(mass_flx_ic=mass_flx_ic, vol_flx_ic=vol_flx_ic) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: z_contr_w_fl_l = data_alloc.random_field(grid, dims.CellDim, dims.KDim, dtype=ta.wpfloat) rho_ic = data_alloc.random_field(grid, dims.CellDim, dims.KDim, dtype=ta.wpfloat) diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_update_theta_v.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_update_theta_v.py index 3aaaf1d99f..47777ce620 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_update_theta_v.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_update_theta_v.py @@ -51,7 +51,7 @@ def reference( ) return dict(theta_v_new=theta_v_new) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: mask_prog_halo_c = random_mask(grid, dims.CellDim) rho_now = random_field(grid, dims.CellDim, dims.KDim, dtype=wpfloat) diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_update_wind.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_update_wind.py index 32f31fe859..087dba1111 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_update_wind.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_update_wind.py @@ -35,7 +35,7 @@ def reference( w_new = w_now + dtime * grf_tend_w return dict(w_new=w_new) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: dtime = wpfloat("10.0") w_now = random_field(grid, dims.CellDim, dims.KDim, dtype=wpfloat) diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_vertically_implicit_dycore_solver_at_corrector_step.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_vertically_implicit_dycore_solver_at_corrector_step.py index 88a9336687..1afb564317 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_vertically_implicit_dycore_solver_at_corrector_step.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_vertically_implicit_dycore_solver_at_corrector_step.py @@ -414,6 +414,7 @@ def reference( f"lprep_adv[{p['lprep_adv']}]__" f"is_iau_active[{p['is_iau_active']}]" ), + scope="class", ) def input_data( self, request: pytest.FixtureRequest, grid: base.Grid diff --git a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_vertically_implicit_dycore_solver_at_predictor_step.py b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_vertically_implicit_dycore_solver_at_predictor_step.py index 97ad07ae63..76b39d5cb7 100644 --- a/model/atmosphere/dycore/tests/dycore/stencil_tests/test_vertically_implicit_dycore_solver_at_predictor_step.py +++ b/model/atmosphere/dycore/tests/dycore/stencil_tests/test_vertically_implicit_dycore_solver_at_predictor_step.py @@ -406,6 +406,7 @@ def reference( ] ], ids=lambda param: f"at_first_substep[{param['at_first_substep']}]__is_iau_active[{param['is_iau_active']}]__divdamp_type[{param['divdamp_type']}]", + scope="class", ) def input_data( self, request: pytest.FixtureRequest, grid: base.Grid diff --git a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_T_from_internal_energy.py b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_T_from_internal_energy.py index 1dddcb000c..ac21d6e87f 100644 --- a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_T_from_internal_energy.py +++ b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_T_from_internal_energy.py @@ -32,7 +32,7 @@ def reference( ) -> dict: return dict(temperature=np.full(u.shape, 255.75599999999997)) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid): return dict( u=data_alloc.constant_field( diff --git a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_cloud_to_graupel.py b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_cloud_to_graupel.py index c362dd7ece..92e4f31efd 100644 --- a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_cloud_to_graupel.py +++ b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_cloud_to_graupel.py @@ -25,7 +25,7 @@ def reference( ) -> dict: return dict(riming_graupel_rate=np.full(t.shape, 2.7054723496793982e-10)) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid): return dict( t=data_alloc.constant_field(grid, 256.983, dims.CellDim, dims.KDim, dtype=wpfloat), diff --git a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_cloud_to_graupel_default.py b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_cloud_to_graupel_default.py index 9000f55ab3..0a443a32d5 100644 --- a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_cloud_to_graupel_default.py +++ b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_cloud_to_graupel_default.py @@ -25,7 +25,7 @@ def reference( ) -> dict: return dict(riming_graupel_rate=np.full(t.shape, 0.0)) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid): return dict( t=data_alloc.constant_field(grid, 281.787, dims.CellDim, dims.KDim, dtype=wpfloat), diff --git a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_cloud_to_rain.py b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_cloud_to_rain.py index 4a6b064888..604c7e5e84 100644 --- a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_cloud_to_rain.py +++ b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_cloud_to_rain.py @@ -25,7 +25,7 @@ def reference( ) -> dict: return dict(conversion_rate=np.full(t.shape, 0.0045484481075162512)) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid): return dict( t=data_alloc.constant_field(grid, 267.25, dims.CellDim, dims.KDim, dtype=wpfloat), diff --git a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_cloud_to_rain_default.py b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_cloud_to_rain_default.py index 820355c8c2..aec955d9a1 100644 --- a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_cloud_to_rain_default.py +++ b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_cloud_to_rain_default.py @@ -25,7 +25,7 @@ def reference( ) -> dict: return dict(conversion_rate=np.full(t.shape, 0.0)) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid): return dict( t=data_alloc.constant_field(grid, 281.787, dims.CellDim, dims.KDim, dtype=wpfloat), diff --git a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_cloud_to_snow.py b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_cloud_to_snow.py index 90a9f18d34..499a1a2ead 100644 --- a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_cloud_to_snow.py +++ b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_cloud_to_snow.py @@ -31,7 +31,7 @@ def reference( ) -> dict: return dict(riming_snow_rate=np.full(t.shape, 9.5431874564438999e-10)) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid): return dict( t=data_alloc.constant_field(grid, 256.571, dims.CellDim, dims.KDim, dtype=wpfloat), diff --git a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_cloud_to_snow_default.py b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_cloud_to_snow_default.py index 701a03e949..434535c60a 100644 --- a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_cloud_to_snow_default.py +++ b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_cloud_to_snow_default.py @@ -31,7 +31,7 @@ def reference( ) -> dict: return dict(riming_snow_rate=np.full(t.shape, 0.0)) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid): return dict( t=data_alloc.constant_field(grid, 281.787, dims.CellDim, dims.KDim, dtype=wpfloat), diff --git a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_cloud_x_ice.py b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_cloud_x_ice.py index ae897cab44..92365821d5 100644 --- a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_cloud_x_ice.py +++ b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_cloud_x_ice.py @@ -25,7 +25,7 @@ def reference( ) -> dict: return dict(freezing_rate=np.full(t.shape, -1.5008166666666666e-08)) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid): return dict( t=data_alloc.constant_field( diff --git a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_cloud_x_ice_default.py b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_cloud_x_ice_default.py index 2a09f91f90..dfa1d12cf7 100644 --- a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_cloud_x_ice_default.py +++ b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_cloud_x_ice_default.py @@ -25,7 +25,7 @@ def reference( ) -> dict: return dict(freezing_rate=np.full(t.shape, 0.0)) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid): return dict( t=data_alloc.constant_field(grid, 256.835, dims.CellDim, dims.KDim, dtype=wpfloat), diff --git a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_deposition_auto_conversion.py b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_deposition_auto_conversion.py index 377c940ed3..cc57f67b89 100644 --- a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_deposition_auto_conversion.py +++ b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_deposition_auto_conversion.py @@ -26,7 +26,7 @@ class TestDepositionAutoConversion(StencilTest): def reference(grid, qi: np.ndarray, m_ice: np.ndarray, ice_dep: np.ndarray, **kwargs) -> dict: return dict(conversion_rate=np.full(qi.shape, 6.6430804299795412e-08)) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid): return dict( qi=data_alloc.constant_field( diff --git a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_deposition_auto_conversion_default.py b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_deposition_auto_conversion_default.py index 971bc9c76b..213dfae725 100644 --- a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_deposition_auto_conversion_default.py +++ b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_deposition_auto_conversion_default.py @@ -25,7 +25,7 @@ class TestDepositionAutoConversionDefault(StencilTest): def reference(grid, qi: np.ndarray, m_ice: np.ndarray, ice_dep: np.ndarray, **kwargs) -> dict: return dict(conversion_rate=np.full(qi.shape, 0.0)) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid): return dict( qi=data_alloc.constant_field(grid, 2.02422e-23, dims.CellDim, dims.KDim, dtype=wpfloat), diff --git a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_deposition_factor.py b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_deposition_factor.py index d89b8452a9..477099fde9 100644 --- a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_deposition_factor.py +++ b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_deposition_factor.py @@ -23,7 +23,7 @@ class TestDepositionFactor(StencilTest): def reference(grid, t: np.ndarray, qvsi: np.ndarray, **kwargs) -> dict: return dict(deposition_rate=np.full(t.shape, 1.3234329478493952e-05)) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid): return dict( t=data_alloc.constant_field(grid, 272.731, dims.CellDim, dims.KDim, dtype=wpfloat), diff --git a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_dqsatdT_rho.py b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_dqsatdT_rho.py index 65522326e2..3fbcd9fd1b 100644 --- a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_dqsatdT_rho.py +++ b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_dqsatdT_rho.py @@ -23,7 +23,7 @@ class TestQsatRho(StencilTest): def reference(grid, qs: np.ndarray, t: np.ndarray, **kwargs) -> dict: return dict(derivative=np.full(t.shape, 0.00030825070286492049)) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid): return dict( qs=data_alloc.constant_field(grid, 0.00448941, dims.CellDim, dims.KDim, dtype=wpfloat), diff --git a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_fall_speed.py b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_fall_speed.py index 162ad4c301..e76ba68ce9 100644 --- a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_fall_speed.py +++ b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_fall_speed.py @@ -26,7 +26,7 @@ def reference( ) -> dict: return dict(speed=np.full(density.shape, 0.67882452435647411)) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid): return dict( density=data_alloc.zero_field(grid, dims.CellDim, dims.KDim, dtype=wpfloat), diff --git a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_graupel_to_rain.py b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_graupel_to_rain.py index 6f52329dc9..163cc8c4f0 100644 --- a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_graupel_to_rain.py +++ b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_graupel_to_rain.py @@ -31,7 +31,7 @@ def reference( ) -> dict: return dict(rain_rate=np.full(t.shape, 5.9748142538569357e-13)) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid): return dict( t=data_alloc.constant_field(grid, 280.156, dims.CellDim, dims.KDim, dtype=wpfloat), diff --git a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_graupel_to_rain_default.py b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_graupel_to_rain_default.py index bd8b18b74e..967ae71bc7 100644 --- a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_graupel_to_rain_default.py +++ b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_graupel_to_rain_default.py @@ -31,7 +31,7 @@ def reference( ) -> dict: return dict(rain_rate=np.full(t.shape, 0.0)) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid): return dict( t=data_alloc.constant_field(grid, 280.156, dims.CellDim, dims.KDim, dtype=wpfloat), diff --git a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_ice_deposition_nucleation.py b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_ice_deposition_nucleation.py index 374b5c738e..7bf89f923a 100644 --- a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_ice_deposition_nucleation.py +++ b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_ice_deposition_nucleation.py @@ -34,7 +34,7 @@ def reference( ) -> dict: return dict(vapor_deposition_rate=np.full(t.shape, 1.6836299999999999e-13)) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid): return dict( t=data_alloc.constant_field(grid, 160.9, dims.CellDim, dims.KDim, dtype=wpfloat), diff --git a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_ice_deposition_nucleation_default.py b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_ice_deposition_nucleation_default.py index b18697e349..0c5c8bab80 100644 --- a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_ice_deposition_nucleation_default.py +++ b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_ice_deposition_nucleation_default.py @@ -34,7 +34,7 @@ def reference( ) -> dict: return dict(vapor_deposition_rate=np.full(t.shape, 0.0)) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid): return dict( t=data_alloc.constant_field(grid, 272.731, dims.CellDim, dims.KDim, dtype=wpfloat), diff --git a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_ice_mass.py b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_ice_mass.py index bb9bdf1a45..e41fd42a79 100644 --- a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_ice_mass.py +++ b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_ice_mass.py @@ -23,7 +23,7 @@ class TestIceNumber(StencilTest): def reference(grid, qi: np.ndarray, ni: np.ndarray, **kwargs) -> dict: return dict(mass=np.full(qi.shape, 1.0e-12)) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid): return dict( qi=data_alloc.constant_field(grid, 2.02422e-23, dims.CellDim, dims.KDim, dtype=wpfloat), diff --git a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_ice_number.py b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_ice_number.py index 05b5fa336c..6e5d64554f 100644 --- a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_ice_number.py +++ b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_ice_number.py @@ -23,7 +23,7 @@ class TestIceNumber(StencilTest): def reference(grid, t: np.ndarray, rho: np.ndarray, **kwargs) -> dict: return dict(number=np.full(t.shape, 5.0507995893464388)) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid): return dict( t=data_alloc.constant_field(grid, 272.731, dims.CellDim, dims.KDim, dtype=wpfloat), diff --git a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_ice_sticking.py b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_ice_sticking.py index 52532333b9..fdf3c129f9 100644 --- a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_ice_sticking.py +++ b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_ice_sticking.py @@ -23,7 +23,7 @@ class TestIceSticking(StencilTest): def reference(grid, t: np.ndarray, **kwargs) -> dict: return dict(sticking_factor=np.full(t.shape, 0.8697930232044021)) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid): return dict( t=data_alloc.constant_field(grid, 271.6, dims.CellDim, dims.KDim, dtype=wpfloat), diff --git a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_ice_to_graupel.py b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_ice_to_graupel.py index 4f2bff9e32..51442a70bb 100644 --- a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_ice_to_graupel.py +++ b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_ice_to_graupel.py @@ -31,7 +31,7 @@ def reference( ) -> dict: return dict(aggregation=np.full(rho.shape, 7.1049436957697864e-19)) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid): return dict( rho=data_alloc.constant_field(grid, 1.04848, dims.CellDim, dims.KDim, dtype=wpfloat), diff --git a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_ice_to_graupel_default.py b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_ice_to_graupel_default.py index 4f2bff9e32..51442a70bb 100644 --- a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_ice_to_graupel_default.py +++ b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_ice_to_graupel_default.py @@ -31,7 +31,7 @@ def reference( ) -> dict: return dict(aggregation=np.full(rho.shape, 7.1049436957697864e-19)) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid): return dict( rho=data_alloc.constant_field(grid, 1.04848, dims.CellDim, dims.KDim, dtype=wpfloat), diff --git a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_ice_to_snow.py b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_ice_to_snow.py index 7072fc1c8c..149db77c98 100644 --- a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_ice_to_snow.py +++ b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_ice_to_snow.py @@ -25,7 +25,7 @@ def reference( ) -> dict: return dict(conversion_rate=np.full(qi.shape, 3.3262745200740486e-11)) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid): return dict( qi=data_alloc.constant_field(grid, 6.43223e-08, dims.CellDim, dims.KDim, dtype=wpfloat), diff --git a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_ice_to_snow_default.py b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_ice_to_snow_default.py index bf6ad46db8..5640ad38f1 100644 --- a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_ice_to_snow_default.py +++ b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_ice_to_snow_default.py @@ -25,7 +25,7 @@ def reference( ) -> dict: return dict(conversion_rate=np.full(qi.shape, 0.0)) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid): return dict( qi=data_alloc.constant_field(grid, 7.95122e-25, dims.CellDim, dims.KDim, dtype=wpfloat), diff --git a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_internal_energy.py b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_internal_energy.py index 3da5d59413..bf72e66b00 100644 --- a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_internal_energy.py +++ b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_internal_energy.py @@ -32,7 +32,7 @@ def reference( ) -> dict: return dict(energy=np.full(t.shape, 38265357.270336017)) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid): return dict( t=data_alloc.constant_field(grid, 255.756, dims.CellDim, dims.KDim, dtype=wpfloat), diff --git a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_qsat_ice_rho.py b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_qsat_ice_rho.py index e29dc9911a..22fc1080b5 100644 --- a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_qsat_ice_rho.py +++ b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_qsat_ice_rho.py @@ -23,7 +23,7 @@ class TestQsatIceRho(StencilTest): def reference(grid, t: np.ndarray, rho: np.ndarray, **kwargs) -> dict: return dict(pressure=np.full(t.shape, 0.0074981245870634101)) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid): return dict( t=data_alloc.constant_field(grid, 281.787, dims.CellDim, dims.KDim, dtype=wpfloat), diff --git a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_qsat_rho.py b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_qsat_rho.py index 8e29622ff0..9125f0a9c0 100644 --- a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_qsat_rho.py +++ b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_qsat_rho.py @@ -23,7 +23,7 @@ class TestQsatRho(StencilTest): def reference(grid, t: np.ndarray, rho: np.ndarray, **kwargs) -> dict: return dict(pressure=np.full(t.shape, 0.0069027592942577506)) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid): return dict( t=data_alloc.constant_field(grid, 281.787, dims.CellDim, dims.KDim, dtype=wpfloat), diff --git a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_qsat_rho_tmelt.py b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_qsat_rho_tmelt.py index 6e13021be7..3c07dd56a3 100644 --- a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_qsat_rho_tmelt.py +++ b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_qsat_rho_tmelt.py @@ -23,7 +23,7 @@ class TestQsatRho(StencilTest): def reference(grid, rho: np.ndarray, **kwargs) -> dict: return dict(pressure=np.full(rho.shape, 0.0038828182695875113)) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid): return dict( rho=data_alloc.constant_field(grid, 1.24783, dims.CellDim, dims.KDim, dtype=wpfloat), diff --git a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_rain_to_graupel_1.py b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_rain_to_graupel_1.py index bc1c75ce0d..dd54512f8d 100644 --- a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_rain_to_graupel_1.py +++ b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_rain_to_graupel_1.py @@ -35,7 +35,7 @@ def reference( ) -> dict: return dict(conversion_rate=np.full(t.shape, 5.1570340525841922e-17)) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid): return dict( t=data_alloc.constant_field(grid, 258.542, dims.CellDim, dims.KDim, dtype=wpfloat), diff --git a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_rain_to_graupel_2.py b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_rain_to_graupel_2.py index 1a26ea9b2e..072ae7a88c 100644 --- a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_rain_to_graupel_2.py +++ b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_rain_to_graupel_2.py @@ -35,7 +35,7 @@ def reference( ) -> dict: return dict(conversion_rate=np.full(t.shape, 1.0044914238516472e-12)) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid): return dict( t=data_alloc.constant_field(grid, 230.542, dims.CellDim, dims.KDim, dtype=wpfloat), diff --git a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_rain_to_graupel_3.py b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_rain_to_graupel_3.py index 0d6a3dc0a5..9cc0e37897 100644 --- a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_rain_to_graupel_3.py +++ b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_rain_to_graupel_3.py @@ -35,7 +35,7 @@ def reference( ) -> dict: return dict(conversion_rate=np.full(t.shape, 5.1423851647153399e-17)) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid): return dict( t=data_alloc.constant_field(grid, 258.542, dims.CellDim, dims.KDim, dtype=wpfloat), diff --git a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_rain_to_graupel_default.py b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_rain_to_graupel_default.py index 00ece8df68..b07e864fce 100644 --- a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_rain_to_graupel_default.py +++ b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_rain_to_graupel_default.py @@ -35,7 +35,7 @@ def reference( ) -> dict: return dict(conversion_rate=np.full(t.shape, 0.0)) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid): return dict( t=data_alloc.constant_field(grid, 272.731, dims.CellDim, dims.KDim, dtype=wpfloat), diff --git a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_rain_to_vapor.py b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_rain_to_vapor.py index c5528bc37a..fe66e7d746 100644 --- a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_rain_to_vapor.py +++ b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_rain_to_vapor.py @@ -32,7 +32,7 @@ def reference( ) -> dict: return dict(conversion_rate=np.full(t.shape, 2.8556697055499901e-19)) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid): return dict( t=data_alloc.constant_field(grid, 258.542, dims.CellDim, dims.KDim, dtype=wpfloat), diff --git a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_rain_to_vapor_default.py b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_rain_to_vapor_default.py index fb681877af..7aa1a3af79 100644 --- a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_rain_to_vapor_default.py +++ b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_rain_to_vapor_default.py @@ -32,7 +32,7 @@ def reference( ) -> dict: return dict(conversion_rate=np.full(t.shape, 0.0)) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid): return dict( t=data_alloc.constant_field(grid, 258.542, dims.CellDim, dims.KDim, dtype=wpfloat), diff --git a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_sat_pres_ice.py b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_sat_pres_ice.py index d56e9a0a01..382e3863ba 100644 --- a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_sat_pres_ice.py +++ b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_sat_pres_ice.py @@ -23,7 +23,7 @@ class TestSatPresIce(StencilTest): def reference(grid, t: np.ndarray, **kwargs) -> dict: return dict(pressure=np.full(t.shape, 1216.7746246067475)) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid): return dict( t=data_alloc.constant_field(grid, 281.787, dims.CellDim, dims.KDim, dtype=wpfloat), diff --git a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_sat_pres_water.py b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_sat_pres_water.py index 6bde29be18..c38dfbc385 100644 --- a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_sat_pres_water.py +++ b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_sat_pres_water.py @@ -23,7 +23,7 @@ class TestSatPresWater(StencilTest): def reference(grid, t: np.ndarray, **kwargs) -> dict: return dict(pressure=np.full(t.shape, 1120.1604149806028)) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid): return dict( t=data_alloc.constant_field(grid, 281.787, dims.CellDim, dims.KDim, dtype=wpfloat), diff --git a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_saturation_adjustment.py b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_saturation_adjustment.py index d83df25624..f79134b775 100644 --- a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_saturation_adjustment.py +++ b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_saturation_adjustment.py @@ -38,7 +38,7 @@ def reference( mask_out=np.full(te.shape, False), ) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid): return dict( te=data_alloc.constant_field( diff --git a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_saturation_adjustment2.py b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_saturation_adjustment2.py index b8b685e11b..44b92a6895 100644 --- a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_saturation_adjustment2.py +++ b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_saturation_adjustment2.py @@ -43,7 +43,7 @@ def reference( qce_out=np.full(te.shape, 9.5724552280369163e-007), ) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid): return dict( te=data_alloc.constant_field( diff --git a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_snow_lambda.py b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_snow_lambda.py index 3c30334f90..3a1e32a4de 100644 --- a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_snow_lambda.py +++ b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_snow_lambda.py @@ -24,7 +24,7 @@ class TestSnowLambda(StencilTest): def reference(grid, rho: np.ndarray, qs: np.ndarray, ns: np.ndarray, **kwargs) -> dict: return dict(riming_snow_rate=np.full(rho.shape, 1.0e10)) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid): return dict( rho=data_alloc.constant_field(grid, 1.12204, dims.CellDim, dims.KDim, dtype=wpfloat), diff --git a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_snow_number.py b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_snow_number.py index 0887fae8c9..a23b2824df 100644 --- a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_snow_number.py +++ b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_snow_number.py @@ -23,7 +23,7 @@ class TestSnowNumber(StencilTest): def reference(grid, t: np.ndarray, rho: np.ndarray, qs: np.ndarray, **kwargs) -> dict: return dict(number=np.full(t.shape, 3813750.0)) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid): return dict( t=data_alloc.constant_field(grid, 276.302, dims.CellDim, dims.KDim, dtype=wpfloat), diff --git a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_snow_number_default.py b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_snow_number_default.py index 86c5a7aacd..82c8236ce3 100644 --- a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_snow_number_default.py +++ b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_snow_number_default.py @@ -23,7 +23,7 @@ class TestSnowNumberDefault(StencilTest): def reference(grid, t: np.ndarray, rho: np.ndarray, qs: np.ndarray, **kwargs) -> dict: return dict(number=np.full(t.shape, 8.00e5)) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid): return dict( t=data_alloc.constant_field(grid, 276.302, dims.CellDim, dims.KDim, dtype=wpfloat), diff --git a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_snow_to_graupel.py b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_snow_to_graupel.py index e69fc05ae6..4a0fda7d1c 100644 --- a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_snow_to_graupel.py +++ b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_snow_to_graupel.py @@ -25,7 +25,7 @@ def reference( ) -> dict: return dict(conversion_rate=np.full(t.shape, 6.2696154545048011e-10)) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid): return dict( t=data_alloc.constant_field(grid, 265.85, dims.CellDim, dims.KDim, dtype=wpfloat), diff --git a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_snow_to_graupel_default.py b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_snow_to_graupel_default.py index 1614d1aa14..1c16f82ba5 100644 --- a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_snow_to_graupel_default.py +++ b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_snow_to_graupel_default.py @@ -25,7 +25,7 @@ def reference( ) -> dict: return dict(conversion_rate=np.full(t.shape, 0.0)) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid): return dict( t=data_alloc.constant_field(grid, 281.157, dims.CellDim, dims.KDim, dtype=wpfloat), diff --git a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_snow_to_rain.py b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_snow_to_rain.py index 4b25992492..4641f61415 100644 --- a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_snow_to_rain.py +++ b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_snow_to_rain.py @@ -31,7 +31,7 @@ def reference( ) -> dict: return dict(conversion_rate=np.full(t.shape, 3.7268547760462804e-07)) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid): return dict( t=data_alloc.constant_field(grid, 275.83, dims.CellDim, dims.KDim, dtype=wpfloat), diff --git a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_snow_to_rain_default.py b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_snow_to_rain_default.py index b3a6b6ff6c..b8c9be3a7b 100644 --- a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_snow_to_rain_default.py +++ b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_snow_to_rain_default.py @@ -31,7 +31,7 @@ def reference( ) -> dict: return dict(conversion_rate=np.full(t.shape, 0.0)) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid): return dict( t=data_alloc.constant_field(grid, 265.83, dims.CellDim, dims.KDim, dtype=wpfloat), diff --git a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_vapor_x_graupel.py b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_vapor_x_graupel.py index 318c53c90e..fd3935b94a 100644 --- a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_vapor_x_graupel.py +++ b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_vapor_x_graupel.py @@ -34,7 +34,7 @@ def reference( ) -> dict: return dict(exchange_rate=np.full(t.shape, -6.8498666666666675e-13)) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid): return dict( t=data_alloc.constant_field(grid, 278.026, dims.CellDim, dims.KDim, dtype=wpfloat), diff --git a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_vapor_x_graupel_default.py b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_vapor_x_graupel_default.py index 8420bd7063..c58e8456e3 100644 --- a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_vapor_x_graupel_default.py +++ b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_vapor_x_graupel_default.py @@ -34,7 +34,7 @@ def reference( ) -> dict: return dict(exchange_rate=np.full(t.shape, 0.0)) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid): return dict( t=data_alloc.constant_field(grid, 278.026, dims.CellDim, dims.KDim, dtype=wpfloat), diff --git a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_vapor_x_ice.py b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_vapor_x_ice.py index e76dc730df..78b5f03800 100644 --- a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_vapor_x_ice.py +++ b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_vapor_x_ice.py @@ -32,7 +32,7 @@ def reference( ) -> dict: return dict(vapor_deposition_rate=np.full(qi.shape, 2.2106162342610385e-09)) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid): return dict( qi=data_alloc.constant_field(grid, 9.53048e-07, dims.CellDim, dims.KDim, dtype=wpfloat), diff --git a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_vapor_x_ice_default.py b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_vapor_x_ice_default.py index e45648728a..7a0a4bb672 100644 --- a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_vapor_x_ice_default.py +++ b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_vapor_x_ice_default.py @@ -32,7 +32,7 @@ def reference( ) -> dict: return dict(vapor_deposition_rate=np.full(qi.shape, 0.0)) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid): return dict( qi=data_alloc.constant_field(grid, 2.02422e-23, dims.CellDim, dims.KDim, dtype=wpfloat), diff --git a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_vapor_x_snow.py b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_vapor_x_snow.py index bb074808aa..5aad429eea 100644 --- a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_vapor_x_snow.py +++ b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_vapor_x_snow.py @@ -38,7 +38,7 @@ def reference( ) -> dict: return dict(vapor_deposition_rate=np.full(t.shape, -8.6584296264775935e-13)) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid): return dict( t=data_alloc.constant_field(grid, 278.748, dims.CellDim, dims.KDim, dtype=wpfloat), diff --git a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_vapor_x_snow_default.py b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_vapor_x_snow_default.py index 26b02e3dee..4804b68423 100644 --- a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_vapor_x_snow_default.py +++ b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_vapor_x_snow_default.py @@ -38,7 +38,7 @@ def reference( ) -> dict: return dict(vapor_deposition_rate=np.full(t.shape, 0.0)) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid): return dict( t=data_alloc.constant_field(grid, 278.748, dims.CellDim, dims.KDim, dtype=wpfloat), diff --git a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_vel_scale_factor_ice.py b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_vel_scale_factor_ice.py index 8b9f9795e8..cd84439f51 100644 --- a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_vel_scale_factor_ice.py +++ b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_vel_scale_factor_ice.py @@ -25,7 +25,7 @@ class TestVelScaleFactorIce(StencilTest): def reference(grid, xrho: np.ndarray, **kwargs) -> dict: return dict(scale_factor=np.full(xrho.shape, 1.1158596098981044)) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid): return dict( xrho=data_alloc.constant_field(grid, 1.17873, dims.CellDim, dims.KDim, dtype=wpfloat), diff --git a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_vel_scale_factor_snow.py b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_vel_scale_factor_snow.py index 18e7048ab7..4848eaaeed 100644 --- a/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_vel_scale_factor_snow.py +++ b/model/atmosphere/subgrid_scale_physics/muphys/tests/muphys/stencil_tests/test_vel_scale_factor_snow.py @@ -27,7 +27,7 @@ def reference( ) -> dict: return dict(scale_factor=np.full(xrho.shape, 0.06633230453931642)) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid): return dict( xrho=data_alloc.constant_field(grid, 1.17787, dims.CellDim, dims.KDim, dtype=wpfloat), diff --git a/model/common/tests/common/interpolation/stencil_tests/test_cell_2_edge_interpolation.py b/model/common/tests/common/interpolation/stencil_tests/test_cell_2_edge_interpolation.py index eb8ad994c6..c37509a11d 100644 --- a/model/common/tests/common/interpolation/stencil_tests/test_cell_2_edge_interpolation.py +++ b/model/common/tests/common/interpolation/stencil_tests/test_cell_2_edge_interpolation.py @@ -40,7 +40,7 @@ def reference( out_field=out_field, ) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict: in_field = data_alloc.random_field(grid, dims.CellDim, dims.KDim, dtype=ta.wpfloat) coeff = data_alloc.random_field(grid, dims.EdgeDim, dims.E2CDim, dtype=ta.wpfloat) diff --git a/model/common/tests/common/interpolation/stencil_tests/test_compute_cell_2_vertex_interpolation.py b/model/common/tests/common/interpolation/stencil_tests/test_compute_cell_2_vertex_interpolation.py index b68124bbda..e5e71acb1d 100644 --- a/model/common/tests/common/interpolation/stencil_tests/test_compute_cell_2_vertex_interpolation.py +++ b/model/common/tests/common/interpolation/stencil_tests/test_compute_cell_2_vertex_interpolation.py @@ -41,7 +41,7 @@ def reference( vert_out=out_field, ) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict: cell_in = data_alloc.random_field(grid, dims.CellDim, dims.KDim, dtype=types.wpfloat) c_int = data_alloc.random_field(grid, dims.VertexDim, dims.V2CDim, dtype=types.wpfloat) diff --git a/model/common/tests/common/interpolation/stencil_tests/test_diagnose_pressure.py b/model/common/tests/common/interpolation/stencil_tests/test_diagnose_pressure.py index 2f0471e4fe..8f21503c83 100644 --- a/model/common/tests/common/interpolation/stencil_tests/test_diagnose_pressure.py +++ b/model/common/tests/common/interpolation/stencil_tests/test_diagnose_pressure.py @@ -52,7 +52,7 @@ def reference( pressure_ifc=pressure_ifc, ) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict: ddqz_z_full = data_alloc.random_field( grid, dims.CellDim, dims.KDim, low=1.0, dtype=ta.wpfloat diff --git a/model/common/tests/common/interpolation/stencil_tests/test_diagnose_surface_pressure.py b/model/common/tests/common/interpolation/stencil_tests/test_diagnose_surface_pressure.py index 55e0967f6a..175f289bff 100644 --- a/model/common/tests/common/interpolation/stencil_tests/test_diagnose_surface_pressure.py +++ b/model/common/tests/common/interpolation/stencil_tests/test_diagnose_surface_pressure.py @@ -47,7 +47,7 @@ def reference( surface_pressure=surface_pressure, ) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict: low = 1.0e-2 exner = data_alloc.random_field(grid, dims.CellDim, dims.KDim, low=1.0e-6, dtype=ta.wpfloat) diff --git a/model/common/tests/common/interpolation/stencil_tests/test_diagnose_temperature.py b/model/common/tests/common/interpolation/stencil_tests/test_diagnose_temperature.py index 1e03d6b648..cdb20d25d3 100644 --- a/model/common/tests/common/interpolation/stencil_tests/test_diagnose_temperature.py +++ b/model/common/tests/common/interpolation/stencil_tests/test_diagnose_temperature.py @@ -45,7 +45,7 @@ def reference( temperature=temperature, ) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict: theta_v = data_alloc.random_field( grid, dims.CellDim, dims.KDim, low=1.0e-4, high=1.0, dtype=ta.wpfloat diff --git a/model/common/tests/common/interpolation/stencil_tests/test_edge_2_cell_vector_rbf_interpolation.py b/model/common/tests/common/interpolation/stencil_tests/test_edge_2_cell_vector_rbf_interpolation.py index a4dea61823..dfd7a87175 100644 --- a/model/common/tests/common/interpolation/stencil_tests/test_edge_2_cell_vector_rbf_interpolation.py +++ b/model/common/tests/common/interpolation/stencil_tests/test_edge_2_cell_vector_rbf_interpolation.py @@ -41,7 +41,7 @@ def reference( return dict(p_v_out=p_v_out, p_u_out=p_u_out) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict: p_e_in = data_alloc.random_field(grid, dims.EdgeDim, dims.KDim, dtype=ta.wpfloat) ptr_coeff_1 = data_alloc.random_field(grid, dims.CellDim, dims.C2E2C2EDim, dtype=ta.wpfloat) diff --git a/model/common/tests/common/interpolation/stencil_tests/test_interpolate_edge_field_to_half_levels_vp.py b/model/common/tests/common/interpolation/stencil_tests/test_interpolate_edge_field_to_half_levels_vp.py index 027b0ab492..37ddca6117 100644 --- a/model/common/tests/common/interpolation/stencil_tests/test_interpolate_edge_field_to_half_levels_vp.py +++ b/model/common/tests/common/interpolation/stencil_tests/test_interpolate_edge_field_to_half_levels_vp.py @@ -46,7 +46,7 @@ def reference( ) return dict(interpolation_to_half_levels_vp=interpolation_to_half_levels_vp) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base_grid.Grid) -> dict: interpolant = random_field(grid, dims.EdgeDim, dims.KDim, dtype=vpfloat) wgtfac_e = random_field(grid, dims.EdgeDim, dims.KDim, dtype=vpfloat) diff --git a/model/common/tests/common/interpolation/stencil_tests/test_mo_intp_rbf_rbf_vec_interpol_vertex.py b/model/common/tests/common/interpolation/stencil_tests/test_mo_intp_rbf_rbf_vec_interpol_vertex.py index 07104cbd89..185e01a321 100644 --- a/model/common/tests/common/interpolation/stencil_tests/test_mo_intp_rbf_rbf_vec_interpol_vertex.py +++ b/model/common/tests/common/interpolation/stencil_tests/test_mo_intp_rbf_rbf_vec_interpol_vertex.py @@ -70,7 +70,7 @@ def reference( return dict(p_v_out=p_v_final_out, p_u_out=p_u_final_out) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict: p_e_in = data_alloc.random_field(grid, dims.EdgeDim, dims.KDim, dtype=wpfloat) ptr_coeff_1 = data_alloc.random_field(grid, dims.VertexDim, dims.V2EDim, dtype=wpfloat) diff --git a/model/common/tests/common/math/stencil_tests/test_cell_horizontal_gradients_by_green_gauss_method.py b/model/common/tests/common/math/stencil_tests/test_cell_horizontal_gradients_by_green_gauss_method.py index bf5d44ebd2..22835eb2a0 100644 --- a/model/common/tests/common/math/stencil_tests/test_cell_horizontal_gradients_by_green_gauss_method.py +++ b/model/common/tests/common/math/stencil_tests/test_cell_horizontal_gradients_by_green_gauss_method.py @@ -66,7 +66,7 @@ def reference( out=(p_grad_1_u, p_grad_1_v), ) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: scalar_field = random_field(grid, dims.CellDim, dims.KDim, dtype=vpfloat) geofac_grg_x = random_field(grid, dims.CellDim, dims.C2E2CODim, dtype=wpfloat) diff --git a/model/common/tests/common/math/stencil_tests/test_compute_first_vertical_derivative.py b/model/common/tests/common/math/stencil_tests/test_compute_first_vertical_derivative.py index 5cd46b15ff..8859a03c84 100644 --- a/model/common/tests/common/math/stencil_tests/test_compute_first_vertical_derivative.py +++ b/model/common/tests/common/math/stencil_tests/test_compute_first_vertical_derivative.py @@ -43,7 +43,7 @@ def reference( ) return dict(first_vertical_derivative=first_vertical_derivative) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict[str, gtx.Field | state_utils.ScalarType]: cell_kdim_field = random_field( grid, dims.CellDim, dims.KDim, extend={dims.KDim: 1}, dtype=vpfloat diff --git a/model/common/tests/common/math/unit_tests/test_helpers.py b/model/common/tests/common/math/unit_tests/test_helpers.py index e1de50194d..1b1c85c67b 100644 --- a/model/common/tests/common/math/unit_tests/test_helpers.py +++ b/model/common/tests/common/math/unit_tests/test_helpers.py @@ -66,7 +66,7 @@ def reference( average = 0.5 * (input_field + offset) return dict(average=average) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict: input_field = data_alloc.zero_field(grid, dims.EdgeDim, dims.KDim, extend={dims.KDim: 1}) result = data_alloc.random_field(grid, dims.EdgeDim, dims.KDim, extend={dims.KDim: 1}) @@ -100,7 +100,7 @@ def reference( res = 0.5 * (input_field + np.roll(input_field, shift=-1, axis=1))[:, : shp[1] - 1] return dict(average=res) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict: input_field = data_alloc.random_field(grid, dims.CellDim, dims.KDim, extend={dims.KDim: 1}) result = data_alloc.zero_field(grid, dims.CellDim, dims.KDim) diff --git a/model/common/tests/common/math/unit_tests/test_operators.py b/model/common/tests/common/math/unit_tests/test_operators.py index b487d1a50b..ed12104b56 100644 --- a/model/common/tests/common/math/unit_tests/test_operators.py +++ b/model/common/tests/common/math/unit_tests/test_operators.py @@ -37,7 +37,7 @@ def reference( nabla2_psi_c_np = reference_funcs.nabla2_on_cell_numpy(connectivities, psi_c, geofac_n2s) return dict(nabla2_psi_c=nabla2_psi_c_np) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base_grid.Grid) -> dict: psi_c = constant_field(grid, 1.0, dims.CellDim) geofac_n2s = constant_field(grid, 2.0, dims.CellDim, dims.C2E2CODim) @@ -66,7 +66,7 @@ def reference( nabla2_psi_c_np = reference_funcs.nabla2_on_cell_k_numpy(connectivities, psi_c, geofac_n2s) return dict(nabla2_psi_c=nabla2_psi_c_np) - @pytest.fixture + @pytest.fixture(scope="class") def input_data(self, grid: base.Grid) -> dict: psi_c = constant_field(grid, 1.0, dims.CellDim, dims.KDim) geofac_n2s = constant_field(grid, 2.0, dims.CellDim, dims.C2E2CODim) diff --git a/model/testing/src/icon4py/model/testing/stencil_tests.py b/model/testing/src/icon4py/model/testing/stencil_tests.py index f83798f029..d75d634393 100644 --- a/model/testing/src/icon4py/model/testing/stencil_tests.py +++ b/model/testing/src/icon4py/model/testing/stencil_tests.py @@ -9,8 +9,9 @@ from __future__ import annotations import dataclasses +import gc import os -from collections.abc import Callable, Mapping, Sequence +from collections.abc import Callable, Generator, Mapping, Sequence from typing import Any, ClassVar import gt4py.next as gtx @@ -34,18 +35,23 @@ def allocate_data( allocator: gtx_typing.FieldBufferAllocationUtil | None, - input_data: dict[str, gtx.Field | tuple[gtx.Field, ...]], -) -> dict[str, gtx.Field | tuple[gtx.Field, ...]]: + input_data: dict[str, gtx.Field | tuple[gtx.Field, ...] | None], +) -> dict[str, gtx.Field | tuple[gtx.Field, ...] | None]: _allocate_field = constructors.as_field.partial(allocator=allocator) # type:ignore[attr-defined] # TODO(havogt): check why it doesn't understand the fluid_partial - input_data = { - k: tuple(_allocate_field(domain=field.domain, data=field.ndarray) for field in v) - if isinstance(v, tuple) - else _allocate_field(domain=v.domain, data=v.ndarray) - if not gtx.is_scalar_type(v) and k != "domain" - else v - for k, v in input_data.items() - } - return input_data + gtx_input_data: dict[str, gtx.Field | tuple[gtx.Field, ...] | None] = {} + for k, v in input_data.items(): + if not gtx.is_scalar_type(v) and k != "domain" and v is not None: + if isinstance(v, tuple): + gtx_input_data[k] = tuple( + _allocate_field(domain=field.domain, data=field.ndarray) for field in v + ) + else: + gtx_input_data[k] = _allocate_field(domain=v.domain, data=v.ndarray) + input_data[k] = None # free original allocation in input_data + else: + gtx_input_data[k] = v + gc.collect() + return gtx_input_data @dataclasses.dataclass(frozen=True) @@ -155,7 +161,9 @@ class StencilTest: ... OUTPUTS = ("some_output",) ... STATIC_PARAMS = {"category_a": ["flag0"], "category_b": ["flag0", "flag1"]} ... - ... @pytest.fixture + ... @pytest.fixture( + ... scope="class" + ... ) # make sure that input data are not allocated multiple times ... def input_data(self): ... return {"some_input": ..., "some_output": ...} ... @@ -202,17 +210,20 @@ def _configured_program( test_func = device_utils.synchronized_function(program, allocator=backend) return test_func - @pytest.fixture + @pytest.fixture(scope="class") def _properly_allocated_input_data( self, - input_data: dict[str, gtx.Field | tuple[gtx.Field, ...]], + input_data: dict[str, gtx.Field | tuple[gtx.Field, ...] | None], backend_like: model_backends.BackendLike, - ) -> dict[str, gtx.Field | tuple[gtx.Field, ...]]: + ) -> Generator[dict[str, gtx.Field | tuple[gtx.Field, ...] | None]]: # TODO(havogt): this is a workaround, # because in the `input_data` fixture provided by the user # it does not allocate for the correct device. allocator = model_backends.get_allocator(backend_like) - return allocate_data(allocator=allocator, input_data=input_data) + gtx_allocated_data = allocate_data(allocator=allocator, input_data=input_data) + yield gtx_allocated_data + del gtx_allocated_data + gc.collect() def _verify_stencil_test( self, @@ -272,7 +283,7 @@ def __init_subclass__(cls, **kwargs: Any) -> None: # parametrization is only available in the concrete subclass definition if cls.STATIC_PARAMS is None: # not parametrized, return an empty tuple - cls.static_variant = staticmethod(pytest.fixture(lambda: ())) # type: ignore[method-assign, assignment] # we override with a non-parametrized function + cls.static_variant = staticmethod(pytest.fixture(lambda: (), scope="class")) # type: ignore[method-assign, assignment] # we override with a non-parametrized function else: cls.static_variant = staticmethod( # type: ignore[method-assign] pytest.fixture(params=cls.STATIC_PARAMS.items(), scope="class", ids=lambda p: p[0])(