Skip to content

Commit ef282dc

Browse files
authored
fix: SISO categories display (#177)
* fix display of category * Change Filter to ApplyFilter
1 parent af46a35 commit ef282dc

File tree

9 files changed

+12
-14
lines changed

9 files changed

+12
-14
lines changed

geos-pv/src/geos/pv/plugins/PVClipToMainFrame.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def __init__( self ) -> None:
4747
if not self._realFilter.logger.hasHandlers():
4848
self._realFilter.SetLoggerHandler( VTKHandler() )
4949

50-
def Filter( self, inputMesh: vtkMultiBlockDataSet, outputMesh: vtkMultiBlockDataSet ) -> None:
50+
def ApplyFilter( self, inputMesh: vtkMultiBlockDataSet, outputMesh: vtkMultiBlockDataSet ) -> None:
5151
"""Is applying CreateConstantAttributePerRegion filter.
5252
5353
Args:

geos-pv/src/geos/pv/plugins/PVCreateConstantAttributePerRegion.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ def groupNewAttributeSettingsWidgets( self: Self ) -> None:
273273
"""Group the widgets to set the settings of the new attribute."""
274274
self.Modified()
275275

276-
def Filter( self, inputMesh: vtkDataSet, outputMesh: vtkDataSet ) -> None:
276+
def ApplyFilter( self, inputMesh: vtkDataSet, outputMesh: vtkDataSet ) -> None:
277277
"""Is applying CreateConstantAttributePerRegion filter.
278278
279279
Args:

geos-pv/src/geos/pv/plugins/PVFillPartialArrays.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def setDictAttributesValues( self: Self, attributeName: Optional[ str ], values:
9494

9595
self.Modified()
9696

97-
def Filter( self, inputMesh: vtkMultiBlockDataSet, outputMesh: vtkMultiBlockDataSet ) -> None:
97+
def ApplyFilter( self, inputMesh: vtkMultiBlockDataSet, outputMesh: vtkMultiBlockDataSet ) -> None:
9898
"""Is applying FillPartialArrays to the mesh and return with the class's dictionary for attributes values.
9999
100100
Args:

geos-pv/src/geos/pv/plugins/PVGeomechanicsCalculator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ def groupAdvancedPropertiesParameters( self: Self ) -> None:
227227
"""Organize groups."""
228228
self.Modified()
229229

230-
def Filter(
230+
def ApplyFilter(
231231
self: Self,
232232
inputMesh: vtkUnstructuredGrid | vtkMultiBlockDataSet,
233233
outputMesh: vtkUnstructuredGrid | vtkMultiBlockDataSet,

geos-pv/src/geos/pv/plugins/PVMeshQualityEnhanced.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ def _getQualityMetricsToUse( self: Self, selection: vtkDataArraySelection ) -> s
216216
metricsNames: set[ str ] = getArrayChoices( selection )
217217
return { getQualityMeasureIndexFromName( name ) for name in metricsNames }
218218

219-
def Filter( self, inputMesh: vtkUnstructuredGrid, outputMesh: vtkUnstructuredGrid ) -> None:
219+
def ApplyFilter( self, inputMesh: vtkUnstructuredGrid, outputMesh: vtkUnstructuredGrid ) -> None:
220220
"""Is applying MeshQualityEnhanced to the input Mesh.
221221
222222
Args:

geos-pv/src/geos/pv/plugins/PVPythonViewConfigurator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -817,7 +817,7 @@ def FillInputPortInformation( self: Self, port: int, info: vtkInformation ) -> i
817817
info.Set( self.INPUT_REQUIRED_DATA_TYPE(), "vtkDataObject" )
818818
return 1
819819

820-
def Filter( self, inputMesh: vtkDataObject, outputMesh: vtkDataObject ) -> None:
820+
def ApplyFilter( self, inputMesh: vtkDataObject, outputMesh: vtkDataObject ) -> None:
821821
"""Dummy interface for plugin to fit decorator reqs.
822822
823823
Args:

geos-pv/src/geos/pv/plugins/PVSplitMesh.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,14 @@
3636
"""
3737

3838

39-
@SISOFilter( category=FilterCategory.GEOS_UTILS,
40-
decoratedLabel="Split Mesh",
41-
decoratedType="vtkPointSet" )
39+
@SISOFilter( category=FilterCategory.GEOS_UTILS, decoratedLabel="Split Mesh", decoratedType="vtkPointSet" )
4240
class PVSplitMesh( VTKPythonAlgorithmBase ):
4341

4442
def __init__( self: Self ) -> None:
4543
"""Split mesh cells."""
4644
pass
4745

48-
def Filter( self: Self, inputMesh: vtkPointSet, outputMesh: vtkPointSet ) -> None:
46+
def ApplyFilter( self: Self, inputMesh: vtkPointSet, outputMesh: vtkPointSet ) -> None:
4947
"""Apply vtk filter.
5048
5149
Args:

geos-pv/src/geos/pv/plugins/PVSurfaceGeomechanics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def a02SetFrictionAngle( self: Self, value: float ) -> None:
116116
self.frictionAngle = value
117117
self.Modified()
118118

119-
def Filter( self: Self, inputMesh: vtkMultiBlockDataSet, outputMesh: vtkMultiBlockDataSet ) -> None:
119+
def ApplyFilter( self: Self, inputMesh: vtkMultiBlockDataSet, outputMesh: vtkMultiBlockDataSet ) -> None:
120120
"""Apply SurfaceGeomechanics filter to the mesh.
121121
122122
Args:

geos-pv/src/geos/pv/utils/details.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class IsSISOFilter( Protocol[ U ] ):
6565
"""Protocol to ensure that the wrapped filter defines the correct Filter core function."""
6666

6767
@abstractmethod
68-
def Filter(
68+
def ApplyFilter(
6969
self,
7070
inputMesh: U,
7171
outputMesh: U,
@@ -160,7 +160,7 @@ def RequestData(
160160

161161
outputMesh.ShallowCopy( inputMesh )
162162

163-
cls.Filter( self, inputMesh, outputMesh )
163+
cls.ApplyFilter( self, inputMesh, outputMesh )
164164
return 1
165165

166166
# Copy all methods and attributes from cls, including decorator metadata
@@ -187,7 +187,7 @@ def RequestData(
187187
)( WrappingClass )
188188
WrappingClass = smproperty.input( name="Input", port_index=0 )( WrappingClass )
189189
# Use enum value for category
190-
WrappingClass = smhint.xml( f'<ShowInMenu category="{category}"/>' )( WrappingClass )
190+
WrappingClass = smhint.xml( f'<ShowInMenu category="{category.value}"/>' )( WrappingClass )
191191
WrappingClass = smproxy.filter( name=getattr( cls, '__name__', str( cls ) ),
192192
label=decoratedLabel )( WrappingClass )
193193
return WrappingClass

0 commit comments

Comments
 (0)