Skip to content

Commit

Permalink
misc: Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ZoeLeibowitz committed Aug 2, 2024
1 parent afa5311 commit fec3491
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
12 changes: 6 additions & 6 deletions devito/types/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ class ArrayBasic(AbstractFunction, LocalType):
__rkwargs__ = AbstractFunction.__rkwargs__ + ('is_const', 'liveness')

def __init_finalize__(self, *args, **kwargs):
self._liveness = kwargs.setdefault('liveness', 'lazy')
super().__init_finalize__(*args, **kwargs)

self._liveness = kwargs.get('liveness', 'lazy')
assert self._liveness in ['eager', 'lazy']

self._is_const = kwargs.get('is_const', False)

@classmethod
Expand Down Expand Up @@ -112,8 +115,8 @@ class Array(ArrayBasic):

is_Array = True

__rkwargs__ = (AbstractFunction.__rkwargs__ +
('dimensions', 'liveness', 'scope', 'initvalue'))
__rkwargs__ = (ArrayBasic.__rkwargs__ +
('dimensions', 'scope', 'initvalue'))

def __new__(cls, *args, **kwargs):
kwargs.update({'options': {'evaluate': False}})
Expand All @@ -127,9 +130,6 @@ def __new__(cls, *args, **kwargs):
def __init_finalize__(self, *args, **kwargs):
super().__init_finalize__(*args, **kwargs)

self._liveness = kwargs.get('liveness', 'lazy')
assert self._liveness in ['eager', 'lazy']

self._scope = kwargs.get('scope', 'heap')
assert self._scope in ['heap', 'stack', 'static', 'constant', 'shared']

Expand Down
7 changes: 6 additions & 1 deletion devito/types/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1672,7 +1672,7 @@ class LocalType(Basic):
Notes
-----
Subclasses should setup `liveness`.
Subclasses should setup `_liveness`.
"""

is_LocalType = True
Expand All @@ -1689,4 +1689,9 @@ def _mem_internal_eager(self):
def _mem_internal_lazy(self):
return self._liveness == 'lazy'

"""
A modifier added to the subclass C declaration when it appears
in a function signature. For example, a subclass might define `_C_modifier = '&'`
to impose pass-by-reference semantics.
"""
_C_modifier = None
6 changes: 0 additions & 6 deletions devito/types/object.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,12 +231,6 @@ def _C_free(self):
"""
return 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.
"""

@property
def _mem_global(self):
return self._is_global

0 comments on commit fec3491

Please sign in to comment.