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

types: Introduce abstract class LocalType #2433

Merged
merged 5 commits into from
Aug 19, 2024
Merged

types: Introduce abstract class LocalType #2433

merged 5 commits into from
Aug 19, 2024

Conversation

ZoeLeibowitz
Copy link
Contributor

No description provided.

Copy link

codecov bot commented Jul 31, 2024

Codecov Report

Attention: Patch coverage is 96.55172% with 1 line in your changes missing coverage. Please review.

Project coverage is 87.01%. Comparing base (cbd40c3) to head (fec3491).
Report is 6 commits behind head on master.

Files Patch % Lines
devito/types/basic.py 92.85% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

@ZoeLeibowitz ZoeLeibowitz added the API api (symbolics, types, ...) label Jul 31, 2024

Notes
-----
Subclasses should setup `liveness`.
Copy link
Contributor

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)
Copy link
Contributor

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__()?

@@ -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.
"""
Copy link
Contributor

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
Copy link
Contributor

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)

Copy link
Contributor

@FabioLuporini FabioLuporini left a 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

@mloubout mloubout merged commit 95d659f into master Aug 19, 2024
30 of 31 checks passed
@mloubout mloubout deleted the localtype branch August 19, 2024 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API api (symbolics, types, ...)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants