Skip to content

Commit

Permalink
typing works
Browse files Browse the repository at this point in the history
  • Loading branch information
oelbert committed Sep 5, 2024
1 parent 2d7062a commit d44551e
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions ndsl/stencils/testing/translate.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import ndsl.dsl.gt4py_utils as utils
from ndsl.dsl.stencil import StencilFactory
from ndsl.dsl.typing import Field, Float # noqa: F401
from ndsl.dsl.typing import Field, Float, Int # noqa: F401
from ndsl.quantity import Quantity
from ndsl.stencils.testing.grid import Grid # type: ignore

Expand Down Expand Up @@ -113,6 +113,12 @@ def make_storage_data(
elif not full_shape and len(array.shape) < 3 and axis == len(array.shape) - 1:
use_shape[1] = 1
start = (int(istart), int(jstart), int(kstart))
if 'float' in str(array.dtype):
dtype = Float
elif 'int' in str(array.dtype):
dtype = Int
else:
dtype = array.dtype
if names_4d:
return utils.make_storage_dict(
array,
Expand All @@ -123,7 +129,7 @@ def make_storage_data(
axis=axis,
names=names_4d,
backend=self.stencil_factory.backend,
dtype=array.dtype,
dtype=dtype,
)
else:
if len(array.shape) == 4:
Expand All @@ -138,7 +144,7 @@ def make_storage_data(
axis=axis,
read_only=read_only,
backend=self.stencil_factory.backend,
dtype=array.dtype,
dtype=dtype,
)

def storage_vars(self):
Expand Down

0 comments on commit d44551e

Please sign in to comment.