Skip to content

Commit 198b040

Browse files
committed
misc: More clean up
1 parent c0a62d2 commit 198b040

4 files changed

Lines changed: 11 additions & 82 deletions

File tree

devito/petsc/types/metadata.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,7 @@ def _make_initial_guess(self, expr):
722722
)
723723
else:
724724
return None
725-
725+
726726

727727
class ConstrainBC:
728728
"""
@@ -769,7 +769,7 @@ def _make_increment_expr(self, expr):
769769
)
770770
else:
771771
return None
772-
772+
773773
def _make_point_bc_exprs(self, exprs):
774774
"""
775775
Return a list of symbolic expressions
@@ -801,7 +801,7 @@ def _make_point_bc_expr(self, expr):
801801
)
802802
else:
803803
return None
804-
804+
805805

806806
def targets_to_arrays(array, targets):
807807
"""
@@ -825,4 +825,3 @@ def targets_to_arrays(array, targets):
825825
array.subs(dict(zip(array.indices, i))) for i in space_indices
826826
]
827827
return frozendict(zip(targets, array_targets))
828-

devito/petsc/types/object.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from ctypes import POINTER, c_char
2-
from functools import cached_property
32

43
from devito.tools import CustomDtype, dtype_to_ctype, as_tuple, CustomIntType
54
from devito.types import (
@@ -12,7 +11,8 @@
1211
from devito.petsc.iet.nodes import petsc_call
1312

1413

15-
# TODO: unnecessary use of "CALLBACK" types - just create a simple way of destroying or not destroying a certain type
14+
# TODO: unnecessary use of "CALLBACK" types - just create a simple
15+
# way of destroying or not destroying a certain type
1616

1717

1818
class PetscMixin:
@@ -212,12 +212,6 @@ class SingleIS(PetscObject):
212212
dtype = CustomDtype('IS')
213213

214214

215-
# class SingleISDestroy(SingleIS):
216-
# @property
217-
# def _C_free(self):
218-
# return petsc_call('ISDestroy', [Byref(self.function)])
219-
220-
221215
class PetscSectionGlobal(PetscObject):
222216
dtype = CustomDtype('PetscSection')
223217

@@ -328,7 +322,7 @@ class CallbackPointerIS(PETScArrayObject):
328322
@property
329323
def dtype(self):
330324
return CustomDtype('IS', modifier=' *')
331-
325+
332326

333327
class CallbackPointerPetscInt(PETScArrayObject):
334328
"""
@@ -384,7 +378,8 @@ class NofSubMats(Scalar, LocalType):
384378
pass
385379

386380

387-
# Can this be attached to the consrain bc object in metadata maybe? probs shoulnd't be here
381+
# Can this be attached to the consrain bc object in metadata maybe? probs
382+
# shoulnd't be here
388383
Counter = PetscInt(name='count')
389384

390385

devito/types/dimension.py

Lines changed: 0 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -822,70 +822,6 @@ def __init_finalize__(self, name, parent, thickness, functions=None,
822822
@cached_property
823823
def bound_symbols(self):
824824
return self.parent.bound_symbols
825-
826-
827-
# class CustomBoundSubDimension(SubDimension):
828-
829-
# # have is_CustomSub = True ... here?
830-
831-
# __rargs__ = SubDimension.__rargs__ + ('custom_left', 'custom_right')
832-
833-
# def __init_finalize__(self, name, parent, thickness, local,
834-
# custom_left=0, custom_right=0, **kwargs):
835-
# self._custom_left = custom_left
836-
# self._custom_right = custom_right
837-
# super().__init_finalize__(name, parent, thickness, local)
838-
839-
# @property
840-
# def custom_left(self):
841-
# return self._custom_left
842-
843-
# @property
844-
# def custom_right(self):
845-
# return self._custom_right
846-
847-
# @cached_property
848-
# def _interval(self):
849-
# left = self.custom_left
850-
# right = self.custom_right
851-
# return sympy.Interval(left, right)
852-
853-
854-
# class CustomBoundSpaceDimension(SpaceDimension):
855-
856-
# # have is_CustomSub = True ... here?
857-
858-
# __rargs__ = SpaceDimension.__rargs__ + ('custom_left', 'custom_right')
859-
860-
# def __init_finalize__(self, name,
861-
# custom_left=0, custom_right=0, **kwargs):
862-
# self._custom_left = custom_left
863-
# self._custom_right = custom_right
864-
# super().__init_finalize__(name, **kwargs)
865-
866-
# @property
867-
# def custom_left(self):
868-
# return self._custom_left
869-
870-
# @property
871-
# def custom_right(self):
872-
# return self._custom_right
873-
874-
# @cached_property
875-
# def _interval(self):
876-
# left = self.custom_left
877-
# right = self.custom_right
878-
# return sympy.Interval(left, right)
879-
880-
# @cached_property
881-
# def symbolic_min(self):
882-
# """Symbol defining the minimum point of the Dimension."""
883-
# return Scalar(name=self.max_name, dtype=np.int32, is_const=True)
884-
885-
# @cached_property
886-
# def symbolic_max(self):
887-
# """Symbol defining the maximum point of the Dimension."""
888-
# return Scalar(name=self.max_name, dtype=np.int32, is_const=True)
889825

890826

891827
class SubsamplingFactor(Scalar):

devito/types/misc.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
# Moved in 1.13
99
from sympy.core.basic import ordering_of_classes
1010

11-
from devito.types import Array, CompositeObject, Indexed, Symbol, LocalObject, ArrayObject
12-
from devito.types.basic import IndexedData, DataSymbol
11+
from devito.types import Array, CompositeObject, Indexed, Symbol, LocalObject
12+
from devito.types.basic import IndexedData
1313
from devito.tools import CustomDtype, Pickable, as_tuple, frozendict
1414

1515
__all__ = ['Timer', 'Pointer', 'VolatileInt', 'FIndexed', 'Wildcard', 'Fence',
@@ -149,7 +149,6 @@ def bind(self, pname):
149149
findexed = self.func(accessor=accessor)
150150

151151
return ((define, expr), findexed)
152-
153152

154153
@property
155154
def linear_index(self):
@@ -162,7 +161,7 @@ def linear_index(self):
162161
for idx, d in zip(indices, f.dimensions[1:])
163162
]
164163
items.append(indices[-1])
165-
164+
166165
return sympy.Add(*items, evaluate=False)
167166

168167
func = Pickable._rebuild

0 commit comments

Comments
 (0)