-
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
feat[next]: Embedded support for skip value connectivities #1441
feat[next]: Embedded support for skip value connectivities #1441
Conversation
tests/next_tests/integration_tests/multi_feature_tests/fvm_nabla_setup.py
Outdated
Show resolved
Hide resolved
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.
It looks correct to me. My comments are mostly about style, and some questions and typo fixes.
tests/next_tests/unit_tests/embedded_tests/test_nd_array_field.py
Outdated
Show resolved
Hide resolved
tests/next_tests/unit_tests/embedded_tests/test_nd_array_field.py
Outdated
Show resolved
Hide resolved
tests/next_tests/unit_tests/embedded_tests/test_nd_array_field.py
Outdated
Show resolved
Hide resolved
tests/next_tests/unit_tests/embedded_tests/test_nd_array_field.py
Outdated
Show resolved
Hide resolved
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.
Last questions and comments...
_codomain: common.DimT | ||
_skip_value: Optional[core_defs.IntegralScalar] |
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.
Out of scope of this PR but just to not forget: it doesn't make sense to use a property for plain attribute access just because a property was defined in a parent class. We could add a simple utility to eve to disable parent properties by overwriting them with a non-data descriptor like this:
def disable_property(default=...) -> functools.cached_property:
return functools.cached_property(lambda _: default)
then this should work:
_codomain: common.DimT | |
_skip_value: Optional[core_defs.IntegralScalar] | |
codomain: common.DimT = disable_property() | |
skip_value: Optional[core_defs.IntegralScalar] = disable_property() |
Inside a dataclass, it would also work to define a field with a default like this:
codomain: common.DimT = dataclasses.field(default=...)
although this would change the semantics by making codomain
optional, where disable_property
wouldn't affect the behavior of the dataclass at all.
tests/next_tests/integration_tests/feature_tests/ffront_tests/test_gt4py_builtins.py
Outdated
Show resolved
Hide resolved
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.
ILGTM.
common._DEFAULT_SKIP_VALUE = -1
, currently we don't support execution with skip_values which are different than that default.Additional changes: