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

Implementations for as_offset #1143

Merged
merged 37 commits into from
Mar 6, 2023

Conversation

nfarabullini
Copy link
Contributor

@nfarabullini nfarabullini commented Jan 27, 2023

Implementation of

 @field_operator(backend=fieldview_backend)
  def offset_index_field_fo(
      a: Field[[IDim, KDim], float64],
      offset_field: Field[[IDim, KDim], int64],
  ) -> Field[[IDim, KDim], float64]:
      return a(as_offset(Ioff, offset_field))

where as_offset shifts a field of values wrt to a field of offset values

@nfarabullini nfarabullini marked this pull request as draft January 27, 2023 10:40
@nfarabullini nfarabullini requested a review from DropD February 2, 2023 15:09
@nfarabullini nfarabullini marked this pull request as ready for review February 2, 2023 15:09
@nfarabullini nfarabullini changed the base branch from functional to main February 8, 2023 15:34
Copy link
Contributor

@DropD DropD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a small clarity improvement (probably copy pasta)

@DropD DropD self-assigned this Mar 2, 2023
Comment on lines +20 to +28
@dataclass
class BuiltInFunction:
__gt_type: ts.FunctionType

def __call__(self, *args, **kwargs):
"""Act as an empty place holder for the built in function."""

def __gt_type__(self):
return self.__gt_type
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be in a ffront/common.py or something?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if I move it to commonI get this error:

    dim: func_common.Dimension
E   AttributeError: partially initialized module 'gt4py.next.common' has no attribute 'Dimension' (most likely due to a circular import)

@nfarabullini nfarabullini requested a review from DropD March 6, 2023 12:47
@nfarabullini nfarabullini merged commit 1fa3535 into GridTools:main Mar 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants