added default filter shape and mesh filter shape

This commit is contained in:
Ethan Peterson 2022-10-31 12:18:09 -04:00
parent 6218becb17
commit 5f0e3e14fb

View file

@ -102,6 +102,8 @@ class Filter(IDManagerMixin, metaclass=FilterMeta):
Unique identifier for the filter
num_bins : Integral
The number of filter bins
shape : tuple
The shape of the filter
"""
@ -205,6 +207,10 @@ class Filter(IDManagerMixin, metaclass=FilterMeta):
def num_bins(self):
return len(self.bins)
@property
def shape(self):
return (self.num_bins,)
def check_bins(self, bins):
"""Make sure given bins are valid for this filter.
@ -839,6 +845,10 @@ class MeshFilter(Filter):
else:
self.bins = list(mesh.indices)
@property
def shape(self):
return self.mesh.dimension
@property
def translation(self):
return self._translation