Skip to content
Snippets Groups Projects

Draft: [FIX] Index fields exclusively containing coordinates are dropped by code generator

3 files
+ 41
4
Compare changes
  • Side-by-side
  • Inline

Files

+ 0
2
@@ -118,8 +118,6 @@ def create_indexed_kernel(assignments: NodeCollection,
@@ -118,8 +118,6 @@ def create_indexed_kernel(assignments: NodeCollection,
fields_read = assignments.rhs_fields
fields_read = assignments.rhs_fields
all_fields = fields_read.union(fields_written)
all_fields = fields_read.union(fields_written)
# extract the index fields based on the name. The original index field might have been modified
index_fields = [idx_field for idx_field in index_fields if idx_field.name in [f.name for f in all_fields]]
non_index_fields = [f for f in all_fields if f not in index_fields]
non_index_fields = [f for f in all_fields if f not in index_fields]
spatial_coordinates = {f.spatial_dimensions for f in non_index_fields}
spatial_coordinates = {f.spatial_dimensions for f in non_index_fields}
assert len(spatial_coordinates) == 1, f"Non-index fields do not have the same number of spatial coordinates " \
assert len(spatial_coordinates) == 1, f"Non-index fields do not have the same number of spatial coordinates " \
Loading