Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

next fieldview embedded: if domain is present, out fields don't have to have matching domains #1403

Open
havogt opened this issue Dec 21, 2023 · 0 comments
Assignees
Labels
gt4py.next Issues concerning the new version with support for non-cartesian grids. triage: bug Something isn't working

Comments

@havogt
Copy link
Contributor

havogt commented Dec 21, 2023

Probably if an explicit domain is provided we only need to check that the provided domain is a subset of the out fields, i.e. something like

diff --git a/src/gt4py/next/embedded/operators.py b/src/gt4py/next/embedded/operators.py
index f50ace7..046eb57 100644
--- a/src/gt4py/next/embedded/operators.py
+++ b/src/gt4py/next/embedded/operators.py
@@ -90,10 +90,12 @@ def field_operator_call(op: EmbeddedOperator, args: Any, kwargs: Any):
         out = kwargs.pop("out")
         domain = kwargs.pop("domain", None)
 
-        flattened_out: tuple[common.Field, ...] = utils.flatten_nested_tuple((out,))
-        assert all(f.domain == flattened_out[0].domain for f in flattened_out)
-
-        out_domain = common.domain(domain) if domain is not None else flattened_out[0].domain
+        if domain:
+            out_domain = common.domain(domain)
+        else:
+            flattened_out: tuple[common.Field, ...] = utils.flatten_nested_tuple((out,))
+            assert all(f.domain == flattened_out[0].domain for f in flattened_out)
+            out_domain = flattened_out[0].domain
 
         new_context_kwargs["closure_column_range"] = _get_vertical_range(out_domain)
 
@havogt havogt added triage: bug Something isn't working gt4py.next Issues concerning the new version with support for non-cartesian grids. labels Dec 21, 2023
@havogt havogt self-assigned this Dec 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gt4py.next Issues concerning the new version with support for non-cartesian grids. triage: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant