From 8238e8dd7d6146d488afc41c2699bc1315935f60 Mon Sep 17 00:00:00 2001 From: Hannes Vogt Date: Fri, 26 Jan 2024 14:31:44 +0100 Subject: [PATCH] more renames --- .../ffront_tests/test_arg_call_interface.py | 4 ++-- .../feature_tests/ffront_tests/test_bound_args.py | 2 +- .../feature_tests/ffront_tests/test_execution.py | 14 +++++++------- .../ffront_tests/test_math_builtin_execution.py | 4 ++-- .../feature_tests/ffront_tests/test_program.py | 10 +++++----- .../ffront_tests/test_embedded_regression.py | 8 ++++---- .../ffront_tests/test_icon_like_scan.py | 10 +++++----- 7 files changed, 26 insertions(+), 26 deletions(-) diff --git a/tests/next_tests/integration_tests/feature_tests/ffront_tests/test_arg_call_interface.py b/tests/next_tests/integration_tests/feature_tests/ffront_tests/test_arg_call_interface.py index ddeb8f8ee6..354323afeb 100644 --- a/tests/next_tests/integration_tests/feature_tests/ffront_tests/test_arg_call_interface.py +++ b/tests/next_tests/integration_tests/feature_tests/ffront_tests/test_arg_call_interface.py @@ -59,7 +59,7 @@ def testee(a: IField, b: IField, c: IField) -> IField: pos_args = [args[name] for name in arg_names] kw_args = {name: args[name] for name in kwarg_names} - testee.with_backend(cartesian_case.backend)( + testee.with_backend(cartesian_case.executor)( *pos_args, **kw_args, out=out, offset_provider=cartesian_case.offset_provider ) @@ -85,7 +85,7 @@ def testee(a: IField, b: IField, out: IField): pos_args = [args[name] for name in arg_names] kw_args = {name: args[name] for name in kwarg_names} - testee.with_backend(cartesian_case.backend)( + testee.with_backend(cartesian_case.executor)( *pos_args, **kw_args, offset_provider=cartesian_case.offset_provider ) diff --git a/tests/next_tests/integration_tests/feature_tests/ffront_tests/test_bound_args.py b/tests/next_tests/integration_tests/feature_tests/ffront_tests/test_bound_args.py index 355cff9774..e4baedc6ee 100644 --- a/tests/next_tests/integration_tests/feature_tests/ffront_tests/test_bound_args.py +++ b/tests/next_tests/integration_tests/feature_tests/ffront_tests/test_bound_args.py @@ -52,7 +52,7 @@ def fieldop_args(a: cases.IField, condition: bool, scalar: int32) -> cases.IFiel scalar = 0 if not condition else scalar return a + scalar - @gtx.program(backend=cartesian_case.backend) + @gtx.program(backend=cartesian_case.executor) def program_args(a: cases.IField, condition: bool, scalar: int32, out: cases.IField): fieldop_args(a, condition, scalar, out=out) diff --git a/tests/next_tests/integration_tests/feature_tests/ffront_tests/test_execution.py b/tests/next_tests/integration_tests/feature_tests/ffront_tests/test_execution.py index 7822b4385a..9482860d13 100644 --- a/tests/next_tests/integration_tests/feature_tests/ffront_tests/test_execution.py +++ b/tests/next_tests/integration_tests/feature_tests/ffront_tests/test_execution.py @@ -614,7 +614,7 @@ def simple_scan_operator(carry: float) -> float: @pytest.mark.uses_lift_expressions @pytest.mark.uses_scan_nested def test_solve_triag(cartesian_case): - if cartesian_case.backend == gtfn.run_gtfn_with_temporaries: + if cartesian_case.executor == gtfn.run_gtfn_with_temporaries: pytest.xfail("Temporary extraction does not work correctly in combination with scans.") @gtx.scan_operator(axis=KDim, forward=True, init=(0.0, 0.0)) @@ -716,7 +716,7 @@ def testee(a: cases.EField, b: cases.EField) -> cases.VField: @pytest.mark.uses_scan def test_ternary_scan(cartesian_case): - if cartesian_case.backend in [gtfn.run_gtfn_with_temporaries]: + if cartesian_case.executor in [gtfn.run_gtfn_with_temporaries]: pytest.xfail("Temporary extraction does not work correctly in combination with scans.") @gtx.scan_operator(axis=KDim, forward=True, init=0.0) @@ -741,7 +741,7 @@ def simple_scan_operator(carry: float, a: float) -> float: @pytest.mark.uses_scan_without_field_args @pytest.mark.uses_tuple_returns def test_scan_nested_tuple_output(forward, cartesian_case): - if cartesian_case.backend in [gtfn.run_gtfn_with_temporaries]: + if cartesian_case.executor in [gtfn.run_gtfn_with_temporaries]: pytest.xfail("Temporary extraction does not work correctly in combination with scans.") init = (1, (2, 3)) @@ -959,7 +959,7 @@ def test_domain_input_bounds_1(cartesian_case): def fieldop_domain(a: cases.IJField) -> cases.IJField: return a + a - @gtx.program(backend=cartesian_case.backend) + @gtx.program(backend=cartesian_case.executor) def program_domain( a: cases.IJField, out: cases.IJField, @@ -1060,7 +1060,7 @@ def prog(inp: cases.IKField, k_index: gtx.Field[[KDim], gtx.IndexType], out: cas def test_undefined_symbols(cartesian_case): with pytest.raises(errors.DSLError, match="Undeclared symbol"): - @gtx.field_operator(backend=cartesian_case.backend) + @gtx.field_operator(backend=cartesian_case.executor) def return_undefined(): return undefined_symbol @@ -1160,7 +1160,7 @@ def test_tuple_unpacking_too_many_values(cartesian_case): match=(r"Too many values to unpack \(expected 3\)."), ): - @gtx.field_operator(backend=cartesian_case.backend) + @gtx.field_operator(backend=cartesian_case.executor) def _star_unpack() -> tuple[int32, float64, int32]: a, b, c = (1, 2.0, 3, 4, 5, 6, 7.0) return a, b, c @@ -1171,7 +1171,7 @@ def test_tuple_unpacking_too_few_values(cartesian_case): errors.DSLError, match=(r"Assignment value must be of type tuple, got 'int32'.") ): - @gtx.field_operator(backend=cartesian_case.backend) + @gtx.field_operator(backend=cartesian_case.executor) def _invalid_unpack() -> tuple[int32, float64, int32]: a, b, c = 1 return a diff --git a/tests/next_tests/integration_tests/feature_tests/ffront_tests/test_math_builtin_execution.py b/tests/next_tests/integration_tests/feature_tests/ffront_tests/test_math_builtin_execution.py index 96200e4b0b..e076ec4227 100644 --- a/tests/next_tests/integration_tests/feature_tests/ffront_tests/test_math_builtin_execution.py +++ b/tests/next_tests/integration_tests/feature_tests/ffront_tests/test_math_builtin_execution.py @@ -118,7 +118,7 @@ def make_builtin_field_operator(builtin_name: str, backend: Optional[ppi.Program @pytest.mark.parametrize("builtin_name, inputs", math_builtin_test_data()) def test_math_function_builtins_execution(cartesian_case, builtin_name: str, inputs): - if cartesian_case.backend is None: + if cartesian_case.executor is None: # TODO(havogt) find a way that works for embedded pytest.xfail("Test does not have a field view program.") if builtin_name == "gamma": @@ -131,7 +131,7 @@ def test_math_function_builtins_execution(cartesian_case, builtin_name: str, inp expected = ref_impl(*inputs) out = cartesian_case.as_field([IDim], np.zeros_like(expected)) - builtin_field_op = make_builtin_field_operator(builtin_name, cartesian_case.backend) + builtin_field_op = make_builtin_field_operator(builtin_name, cartesian_case.executor) builtin_field_op(*inps, out=out, offset_provider={}) diff --git a/tests/next_tests/integration_tests/feature_tests/ffront_tests/test_program.py b/tests/next_tests/integration_tests/feature_tests/ffront_tests/test_program.py index 073bbb9550..df0009d0d4 100644 --- a/tests/next_tests/integration_tests/feature_tests/ffront_tests/test_program.py +++ b/tests/next_tests/integration_tests/feature_tests/ffront_tests/test_program.py @@ -40,7 +40,7 @@ def test_identity_fo_execution(cartesian_case, identity_def): - identity = gtx.field_operator(identity_def, backend=cartesian_case.backend) + identity = gtx.field_operator(identity_def, backend=cartesian_case.executor) in_field = cases.allocate(cartesian_case, identity, "in_field").strategy( cases.ConstInitializer(1) @@ -88,13 +88,13 @@ def shift_by_one_program(in_field: cases.IFloatField, out_field: cases.IFloatFie def test_copy_execution(cartesian_case, copy_program_def): - copy_program = gtx.program(copy_program_def, backend=cartesian_case.backend) + copy_program = gtx.program(copy_program_def, backend=cartesian_case.executor) cases.verify_with_default_data(cartesian_case, copy_program, ref=lambda in_field: in_field) def test_double_copy_execution(cartesian_case, double_copy_program_def): - double_copy_program = gtx.program(double_copy_program_def, backend=cartesian_case.backend) + double_copy_program = gtx.program(double_copy_program_def, backend=cartesian_case.executor) cases.verify_with_default_data( cartesian_case, double_copy_program, ref=lambda in_field, intermediate_field: in_field @@ -102,7 +102,7 @@ def test_double_copy_execution(cartesian_case, double_copy_program_def): def test_copy_restricted_execution(cartesian_case, copy_restrict_program_def): - copy_restrict_program = gtx.program(copy_restrict_program_def, backend=cartesian_case.backend) + copy_restrict_program = gtx.program(copy_restrict_program_def, backend=cartesian_case.executor) cases.verify_with_default_data( cartesian_case, @@ -224,7 +224,7 @@ def prog( def test_wrong_argument_type(cartesian_case, copy_program_def): - copy_program = gtx.program(copy_program_def, backend=cartesian_case.backend) + copy_program = gtx.program(copy_program_def, backend=cartesian_case.executor) inp = cartesian_case.as_field([JDim], np.ones((cartesian_case.default_sizes[JDim],))) out = cases.allocate(cartesian_case, copy_program, "out").strategy(cases.ConstInitializer(1))() diff --git a/tests/next_tests/integration_tests/multi_feature_tests/ffront_tests/test_embedded_regression.py b/tests/next_tests/integration_tests/multi_feature_tests/ffront_tests/test_embedded_regression.py index f4b1cf7bd3..65f017a518 100644 --- a/tests/next_tests/integration_tests/multi_feature_tests/ffront_tests/test_embedded_regression.py +++ b/tests/next_tests/integration_tests/multi_feature_tests/ffront_tests/test_embedded_regression.py @@ -81,7 +81,7 @@ def copy_program(a: IField, b: IField) -> IField: def test_missing_arg_field_operator(cartesian_case): # noqa: F811 # fixtures """Test that calling a field_operator without required args raises an error.""" - @gtx.field_operator(backend=cartesian_case.backend) + @gtx.field_operator(backend=cartesian_case.executor) def copy(a: IField) -> IField: return a @@ -97,7 +97,7 @@ def copy(a: IField) -> IField: def test_missing_arg_scan_operator(cartesian_case): # noqa: F811 # fixtures """Test that calling a scan_operator without required args raises an error.""" - @gtx.scan_operator(backend=cartesian_case.backend, axis=KDim, init=0.0, forward=True) + @gtx.scan_operator(backend=cartesian_case.executor, axis=KDim, init=0.0, forward=True) def sum(state: float, a: float) -> float: return state + a @@ -122,7 +122,7 @@ def copy(a: IField) -> IField: with pytest.raises(errors.DSLError, match="Invalid call"): - @gtx.program(backend=cartesian_case.backend) + @gtx.program(backend=cartesian_case.executor) def copy_program(a: IField, b: IField) -> IField: copy(a) @@ -130,7 +130,7 @@ def copy_program(a: IField, b: IField) -> IField: with pytest.raises(TypeError, match="'offset_provider'"): - @gtx.program(backend=cartesian_case.backend) + @gtx.program(backend=cartesian_case.executor) def copy_program(a: IField, b: IField) -> IField: copy(a, out=b) diff --git a/tests/next_tests/integration_tests/multi_feature_tests/ffront_tests/test_icon_like_scan.py b/tests/next_tests/integration_tests/multi_feature_tests/ffront_tests/test_icon_like_scan.py index 8cdb037c08..f1a5b41f81 100644 --- a/tests/next_tests/integration_tests/multi_feature_tests/ffront_tests/test_icon_like_scan.py +++ b/tests/next_tests/integration_tests/multi_feature_tests/ffront_tests/test_icon_like_scan.py @@ -248,14 +248,14 @@ def test_solve_nonhydro_stencil_52_like_z_q(test_setup): @pytest.mark.uses_tuple_returns def test_solve_nonhydro_stencil_52_like_z_q_tup(test_setup): if ( - test_setup.case.backend + test_setup.case.executor == test_definitions.ProgramBackendId.GTFN_CPU_WITH_TEMPORARIES.load().executor ): pytest.xfail( "Needs implementation of scan projector. Breaks in type inference as executed" "again after CollapseTuple." ) - if test_setup.case.backend == test_definitions.ProgramBackendId.ROUNDTRIP.load().executor: + if test_setup.case.executor == test_definitions.ProgramBackendId.ROUNDTRIP.load().executor: pytest.xfail("Needs proper handling of tuple[Column] <-> Column[tuple].") cases.verify( @@ -275,7 +275,7 @@ def test_solve_nonhydro_stencil_52_like_z_q_tup(test_setup): @pytest.mark.uses_tuple_returns def test_solve_nonhydro_stencil_52_like(test_setup): if ( - test_setup.case.backend + test_setup.case.executor == test_definitions.ProgramBackendId.GTFN_CPU_WITH_TEMPORARIES.load().executor ): pytest.xfail("Temporary extraction does not work correctly in combination with scans.") @@ -297,11 +297,11 @@ def test_solve_nonhydro_stencil_52_like(test_setup): @pytest.mark.uses_tuple_returns def test_solve_nonhydro_stencil_52_like_with_gtfn_tuple_merge(test_setup): if ( - test_setup.case.backend + test_setup.case.executor == test_definitions.ProgramBackendId.GTFN_CPU_WITH_TEMPORARIES.load().executor ): pytest.xfail("Temporary extraction does not work correctly in combination with scans.") - if test_setup.case.backend == test_definitions.ProgramBackendId.ROUNDTRIP.load().executor: + if test_setup.case.executor == test_definitions.ProgramBackendId.ROUNDTRIP.load().executor: pytest.xfail("Needs proper handling of tuple[Column] <-> Column[tuple].") cases.run(