-
Notifications
You must be signed in to change notification settings - Fork 231
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
types: Introduce abstract class LocalType #2433
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2433 +/- ##
=======================================
Coverage 87.01% 87.01%
=======================================
Files 236 236
Lines 44899 44900 +1
Branches 8363 8361 -2
=======================================
+ Hits 39069 39071 +2
+ Misses 5101 5100 -1
Partials 729 729 ☔ View full report in Codecov by Sentry. |
devito/types/basic.py
Outdated
|
||
Notes | ||
----- | ||
Subclasses should setup `liveness`. |
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 set up _liveness
|
||
def __init_finalize__(self, *args, **kwargs): | ||
self._liveness = kwargs.setdefault('liveness', 'lazy') | ||
super().__init_finalize__(*args, **kwargs) |
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.
Is there a reason self._liveness
is set before super().__init_finalize__()
?
devito/types/object.py
Outdated
@@ -235,21 +231,12 @@ def _C_free(self): | |||
""" | |||
return None | |||
|
|||
_C_modifier = None | |||
""" | |||
A modifier added to the LocalObject's C declaration when the object appears | |||
in a function signature. For example, a subclass might define `_C_modifier = '&'` | |||
to impose pass-by-reference semantics. | |||
""" |
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.
Move this docstring to LocalType
? Not sure why it was below _C_modifier
instead of above in the first place
in a function signature. For example, a subclass might define `_C_modifier = '&'` | ||
to impose pass-by-reference semantics. | ||
""" | ||
_C_modifier = None |
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.
FWIW, with the advent of CustomDType this might not be necessary anymore. Have a look maybe when you got time (not for this PR)
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.
Looks good to me, thanks
No description provided.