Skip to content
Snippets Groups Projects
Commit 14986080 authored by Frederik Hennig's avatar Frederik Hennig
Browse files

Change FieldShapeSymbol to only store a single field name

parent a6924b47
Branches
Tags
No related merge requests found
Pipeline #64467 failed
...@@ -151,9 +151,9 @@ class Field: ...@@ -151,9 +151,9 @@ class Field:
total_dimensions = spatial_dimensions + index_dimensions total_dimensions = spatial_dimensions + index_dimensions
if index_shape is None or len(index_shape) == 0: if index_shape is None or len(index_shape) == 0:
shape = tuple([FieldShapeSymbol([field_name], i) for i in range(total_dimensions)]) shape = tuple([FieldShapeSymbol(field_name, i) for i in range(total_dimensions)])
else: else:
shape = tuple([FieldShapeSymbol([field_name], i) for i in range(spatial_dimensions)] + list(index_shape)) shape = tuple([FieldShapeSymbol(field_name, i) for i in range(spatial_dimensions)] + list(index_shape))
strides = tuple([FieldStrideSymbol(field_name, i) for i in range(total_dimensions)]) strides = tuple([FieldStrideSymbol(field_name, i) for i in range(total_dimensions)])
......
...@@ -106,7 +106,7 @@ class FieldStrideSymbol(TypedSymbol): ...@@ -106,7 +106,7 @@ class FieldStrideSymbol(TypedSymbol):
obj = FieldStrideSymbol.__xnew_cached_(cls, *args, **kwds) obj = FieldStrideSymbol.__xnew_cached_(cls, *args, **kwds)
return obj return obj
def __new_stage2__(cls, field_name, coordinate): def __new_stage2__(cls, field_name: str, coordinate: int):
from ..defaults import DEFAULTS from ..defaults import DEFAULTS
name = f"_stride_{field_name}_{coordinate}" name = f"_stride_{field_name}_{coordinate}"
...@@ -139,7 +139,7 @@ class FieldShapeSymbol(TypedSymbol): ...@@ -139,7 +139,7 @@ class FieldShapeSymbol(TypedSymbol):
obj = FieldShapeSymbol.__xnew_cached_(cls, *args, **kwds) obj = FieldShapeSymbol.__xnew_cached_(cls, *args, **kwds)
return obj return obj
def __new_stage2__(cls, field_names, coordinate): def __new_stage2__(cls, field_name: str, coordinate: int):
from ..defaults import DEFAULTS from ..defaults import DEFAULTS
names = "_".join([field_name for field_name in field_names]) names = "_".join([field_name for field_name in field_names])
...@@ -147,7 +147,7 @@ class FieldShapeSymbol(TypedSymbol): ...@@ -147,7 +147,7 @@ class FieldShapeSymbol(TypedSymbol):
obj = super(FieldShapeSymbol, cls).__xnew__( obj = super(FieldShapeSymbol, cls).__xnew__(
cls, name, DEFAULTS.index_dtype, positive=True cls, name, DEFAULTS.index_dtype, positive=True
) )
obj.field_names = tuple(field_names) obj.field_name = field_name
obj.coordinate = coordinate obj.coordinate = coordinate
return obj return obj
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment