Skip to content

Commit 33e8249

Browse files
committed
clean ruff and yapf
1 parent ebe20dd commit 33e8249

File tree

8 files changed

+37
-18
lines changed

8 files changed

+37
-18
lines changed

geos-processing/src/geos/processing/generic_processing_tools/AttributeMapping.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import numpy as np
66
import numpy.typing as npt
77
import logging
8-
from typing_extensions import Self, Union
8+
from typing_extensions import ( Self, Union )
99
from vtkmodules.vtkCommonDataModel import ( vtkDataSet, vtkMultiBlockDataSet )
1010
from geos.mesh.utils.arrayModifiers import transferAttributeWithElementMap
1111
from geos.mesh.utils.arrayHelpers import ( computeElementMapping, getAttributeSet, isAttributeGlobal )

geos-processing/src/geos/processing/generic_processing_tools/SplitMesh.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88

99
from vtkmodules.util.vtkAlgorithm import VTKPythonAlgorithmBase
1010
from vtkmodules.vtkCommonCore import ( vtkPoints, vtkIdTypeArray, vtkDataArray )
11-
from vtkmodules.vtkCommonDataModel import ( vtkUnstructuredGrid, vtkCellArray, vtkCellData, vtkCell, vtkCellTypes, VTK_TRIANGLE, VTK_QUAD, VTK_TETRA, VTK_HEXAHEDRON, VTK_PYRAMID, VTK_WEDGE, VTK_POLYHEDRON, VTK_POLYGON )
11+
from vtkmodules.vtkCommonDataModel import ( vtkUnstructuredGrid, vtkCellArray, vtkCellData, vtkCell, vtkCellTypes,
12+
VTK_TRIANGLE, VTK_QUAD, VTK_TETRA, VTK_HEXAHEDRON, VTK_PYRAMID, VTK_WEDGE,
13+
VTK_POLYHEDRON, VTK_POLYGON )
1214
from vtkmodules.util.numpy_support import ( numpy_to_vtk, vtk_to_numpy )
1315

1416
from geos.utils.Logger import ( Logger, getLogger )
@@ -105,7 +107,7 @@ def applyFilter( self: Self ) -> None:
105107
nbPolyhedra: int = counts.getTypeCount( VTK_POLYHEDRON )
106108
assert counts.getTypeCount( VTK_WEDGE ) == 0, "Input mesh contains wedges that are not currently supported."
107109
assert nbPolyhedra * nbPolygon == 0, ( "Input mesh is composed of both polygons and polyhedra,"
108-
" but it must contains only one of the two." )
110+
" but it must contains only one of the two." )
109111
nbNewPoints: int = 0
110112
nbNewPoints = nbHex * 19 + nbTet * 6 + nbPyr * 9 if nbPolyhedra > 0 else nbTriangles * 3 + nbQuad * 5
111113
nbNewCells: int = nbHex * 8 + nbTet * 8 + nbPyr * 10 * nbTriangles * 4 + nbQuad * 4
@@ -146,7 +148,7 @@ def applyFilter( self: Self ) -> None:
146148
self._transferCellArrays( self.outputMesh )
147149
self.logger.info( f"The filter { self.logger.name } succeeded." )
148150
except Exception as e:
149-
self.logger.error( f"The filter {self.logger.name } failed.\n{ e }")
151+
self.logger.error( f"The filter {self.logger.name } failed.\n{ e }" )
150152

151153
return
152154

@@ -160,7 +162,8 @@ def _getCellCounts( self: Self ) -> CellTypeCounts:
160162
Returns:
161163
CellTypeCounts: cell type counts
162164
"""
163-
cellTypeCounterEnhancedFilter: CellTypeCounterEnhanced = CellTypeCounterEnhanced( self.inputMesh, self.speHandler )
165+
cellTypeCounterEnhancedFilter: CellTypeCounterEnhanced = CellTypeCounterEnhanced(
166+
self.inputMesh, self.speHandler )
164167
if self.speHandler and len( cellTypeCounterEnhancedFilter.logger.handlers ) == 0:
165168
cellTypeCounterEnhancedFilter.setLoggerHandler( self.handler )
166169
cellTypeCounterEnhancedFilter.applyFilter()

geos-processing/src/geos/processing/pre_processing/CellTypeCounterEnhanced.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,11 @@
4646

4747
class CellTypeCounterEnhanced():
4848

49-
def __init__( self: Self, inputMesh: vtkUnstructuredGrid, speHandler: bool = False, ) -> None:
49+
def __init__(
50+
self: Self,
51+
inputMesh: vtkUnstructuredGrid,
52+
speHandler: bool = False,
53+
) -> None:
5054
"""CellTypeCounterEnhanced filter computes mesh stats.
5155
5256
Args:

geos-processing/src/geos/processing/pre_processing/MeshQualityEnhanced.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,17 @@ def getQualityMetricArrayName( metric: int ) -> str:
101101
"""
102102
return QUALITY_ARRAY_NAME + "_" + "".join( getQualityMeasureNameFromIndex( metric ).split( " " ) )
103103

104+
104105
loggerTitle: str = "Mesh Quality Enhanced"
105106

106107

107108
class MeshQualityEnhanced():
108109

109-
def __init__( self: Self, inputMesh: vtkUnstructuredGrid, speHandler: bool = False, ) -> None:
110+
def __init__(
111+
self: Self,
112+
inputMesh: vtkUnstructuredGrid,
113+
speHandler: bool = False,
114+
) -> None:
110115
"""Enhanced vtkMeshQuality filter.
111116
112117
Args:
@@ -323,7 +328,8 @@ def getOutput( self: Self ) -> vtkUnstructuredGrid:
323328

324329
def _computeCellTypeCounts( self: Self ) -> None:
325330
"""Compute cell type counts."""
326-
cellTypeCounterEnhancedFilter: CellTypeCounterEnhanced = CellTypeCounterEnhanced( self._outputMesh, self.speHandler )
331+
cellTypeCounterEnhancedFilter: CellTypeCounterEnhanced = CellTypeCounterEnhanced(
332+
self._outputMesh, self.speHandler )
327333
if self.speHandler and len( cellTypeCounterEnhancedFilter.logger.handlers ) == 0:
328334
cellTypeCounterEnhancedFilter.setLoggerHandler( self.handler )
329335
cellTypeCounterEnhancedFilter.applyFilter()

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
from paraview.util.vtkAlgorithm import ( # type: ignore[import-not-found]
1111
VTKPythonAlgorithmBase, smdomain, smhint, smproperty, smproxy )
1212
from paraview.detail.loghandler import ( # type: ignore[import-not-found]
13-
VTKHandler ) # source: https://github.com/Kitware/ParaView/blob/master/Wrapping/Python/paraview/detail/loghandler.py
13+
VTKHandler
14+
) # source: https://github.com/Kitware/ParaView/blob/master/Wrapping/Python/paraview/detail/loghandler.py
1415

1516
from vtkmodules.vtkCommonCore import (
1617
vtkInformation,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ def RequestData(
598598
array_type=VTK_DOUBLE ) # type: ignore[no-untyped-call]
599599
newAttr.SetName( column )
600600
output.AddColumn( newAttr )
601-
self.logger.info( f"The plugin { self.logger.name } succeeded.")
601+
self.logger.info( f"The plugin { self.logger.name } succeeded." )
602602
except Exception as e:
603603
self.logger.error( f"The plugin { self.logger.name } failed.\n{ e }" )
604604
return 0

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

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
VTKPythonAlgorithmBase, smdomain, smproperty,
1111
)
1212
from paraview.detail.loghandler import ( # type: ignore[import-not-found]
13-
VTKHandler ) # source: https://github.com/Kitware/ParaView/blob/master/Wrapping/Python/paraview/detail/loghandler.py
13+
VTKHandler
14+
) # source: https://github.com/Kitware/ParaView/blob/master/Wrapping/Python/paraview/detail/loghandler.py
1415
from vtkmodules.vtkCommonCore import (
1516
vtkDataArraySelection, )
1617
from vtkmodules.vtkCommonDataModel import (
@@ -244,11 +245,11 @@ def ApplyFilter( self, inputMesh: vtkUnstructuredGrid, outputMesh: vtkUnstructur
244245
if len( self.meshQualityEnhancedFilter.logger.handlers ) == 0:
245246
self.meshQualityEnhancedFilter.setLoggerHandler( VTKHandler() )
246247
self.meshQualityEnhancedFilter.SetCellQualityMetrics( triangleMetrics=triangleMetrics,
247-
quadMetrics=quadMetrics,
248-
tetraMetrics=tetraMetrics,
249-
pyramidMetrics=pyrMetrics,
250-
wedgeMetrics=wedgeMetrics,
251-
hexaMetrics=hexaMetrics )
248+
quadMetrics=quadMetrics,
249+
tetraMetrics=tetraMetrics,
250+
pyramidMetrics=pyrMetrics,
251+
wedgeMetrics=wedgeMetrics,
252+
hexaMetrics=hexaMetrics )
252253
self.meshQualityEnhancedFilter.SetOtherMeshQualityMetrics( otherMetrics )
253254
self.meshQualityEnhancedFilter.applyFilter()
254255

@@ -261,7 +262,10 @@ def ApplyFilter( self, inputMesh: vtkUnstructuredGrid, outputMesh: vtkUnstructur
261262
self._blockIndex += 1
262263
return
263264

264-
def saveFile( self: Self, stats: QualityMetricSummary, ) -> None:
265+
def saveFile(
266+
self: Self,
267+
stats: QualityMetricSummary,
268+
) -> None:
265269
"""Export mesh quality metric summary file."""
266270
try:
267271
assert self._filename is not None, "Mesh quality summary report file path is undefined."

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
from paraview.util.vtkAlgorithm import ( # type: ignore[import-not-found]
1010
VTKPythonAlgorithmBase )
1111
from paraview.detail.loghandler import ( # type: ignore[import-not-found]
12-
VTKHandler ) # source: https://github.com/Kitware/ParaView/blob/master/Wrapping/Python/paraview/detail/loghandler.py
12+
VTKHandler
13+
) # source: https://github.com/Kitware/ParaView/blob/master/Wrapping/Python/paraview/detail/loghandler.py
1314

1415
from vtkmodules.vtkCommonDataModel import (
1516
vtkPointSet, )

0 commit comments

Comments
 (0)