-
Notifications
You must be signed in to change notification settings - Fork 49
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
Changes from all commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
63a3875
Implementations for as_offset
e3e8497
Some polishing and cleanup
08dee1c
further refactoring
2de8042
Edits for pre-commit and test
6878ea5
Edis for offset¨
53702e0
Test edit
f28690e
Remoed error message
96b2b53
Edits
1a59a39
Clean-up
2ca5685
Merge branch 'functional' into as_offset_builtin
nfarabullini 7489156
Preliminary edits
c5262ca
Merge branch 'functional' of https://github.com/GridTools/gt4py into …
7940452
Edits following change of syntax
f0b9470
Edit to embedded
61c2413
Cleanup
f66a6c0
Small edit
6917dc3
Edit to embedded
6658d4d
Edit to getter
54c97db
cleanup
e380f11
Edits for test
2f7e19d
clean
0caa514
Edit to test name
2855632
Edit import
358cbe6
Edit for test
cba682e
Small edit to test
d6c8387
Module for as_offset builtin
3b689a9
Edits for pre-commit
886c3f0
reverted some changes after merge
1c87907
rebase off of origin
a78922a
Error edits following review
bfadc35
Merge branch 'main' of https://github.com/GridTools/gt4py into as_off…
4746aa2
Ran pre-commit
5f3111d
Merge branch 'main' of https://github.com/GridTools/gt4py into as_off…
6d2d353
Ran pre-commit
0adde48
Update tests/next_tests/ffront_tests/test_type_deduction.py
nfarabullini 797c0f1
Merge branch 'main' into as_offset_builtin
nfarabullini 098aeb1
Ran pre-commit
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# GT4Py - GridTools Framework | ||
# | ||
# Copyright (c) 2014-2023, ETH Zurich | ||
# All rights reserved. | ||
# | ||
# This file is part of the GT4Py project and the GridTools framework. | ||
# GT4Py is free software: you can redistribute it and/or modify it under | ||
# the terms of the GNU General Public License as published by the | ||
# Free Software Foundation, either version 3 of the License, or any later | ||
# version. See the LICENSE.txt file at the top-level directory of this | ||
# distribution for a copy of the license or check <https://www.gnu.org/licenses/>. | ||
# | ||
# SPDX-License-Identifier: GPL-3.0-or-later | ||
|
||
from dataclasses import dataclass | ||
|
||
from gt4py.next.type_system import type_specifications as ts | ||
|
||
|
||
@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 | ||
|
||
|
||
as_offset = BuiltInFunction( | ||
ts.FunctionType( | ||
args=[ | ||
ts.DeferredType(constraint=ts.OffsetType), | ||
ts.DeferredType(constraint=ts.FieldType), | ||
], | ||
kwargs={}, | ||
returns=ts.DeferredType(constraint=ts.OffsetType), | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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?There was a problem hiding this comment.
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
common
I get this error: