Skip to content

Commit 6f6e652

Browse files
committed
clean up
1 parent f32fe2e commit 6f6e652

File tree

3 files changed

+18
-95
lines changed

3 files changed

+18
-95
lines changed

.hooks/pre-commit.example

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,21 @@
22

33
function run_precommit_checks
44
{
5+
echo "running mypy"
56
python -m mypy --config-file ./.mypy.ini --check-untyped-defs $1
7+
echo "running ruff"
68
python -m ruff check --unsafe-fixes --config .ruff.toml $1
9+
echo "running yapf"
710
python -m yapf -r -i --style .style.yapf $1
811

912
return 0
1013
}
1114

1215

13-
source ${ENV_PYTHON_PATH}/bin/activate
16+
source ${ENV_PYTHON}/bin/activate
1417

15-
sphinx-build -b html docs/ docs/_build -W
16-
for file in $(git diff --name-only --cached | grep py)
18+
#sphinx-build -b html docs/ docs/_build -W
19+
for file in $(git diff --name-only --cached | grep -e "modified\|added" | grep py)
1720
do
1821
run_precommit_checks $file
1922
done

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

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99

1010
from paraview.util.vtkAlgorithm import ( # type: ignore[import-not-found]
1111
VTKPythonAlgorithmBase, smdomain, smhint, smproperty, smproxy,
12-
) # source: https://github.com/Kitware/ParaView/blob/master/Wrapping/Python/paraview/util/vtkAlgorithm.py
12+
) # source: https://github.com/Kitware/ParaView/blob/master/Wrapping/Python/paraview/util/vtkAlgorithm.py
1313
from paraview.detail.loghandler import ( # type: ignore[import-not-found]
1414
VTKHandler,
15-
) # source: https://github.com/Kitware/ParaView/blob/master/Wrapping/Python/paraview/detail/loghandler.py
15+
) # source: https://github.com/Kitware/ParaView/blob/master/Wrapping/Python/paraview/detail/loghandler.py
1616

1717
from vtkmodules.vtkCommonDataModel import (
1818
vtkMultiBlockDataSet, )
@@ -30,7 +30,7 @@
3030
update_paths()
3131

3232
from geos.mesh.processing.FillPartialArrays import FillPartialArrays
33-
# import geos.pv.utils.details
33+
3434
__doc__ = """
3535
Fill partial arrays of input mesh.
3636
@@ -54,8 +54,7 @@
5454
dataTypes=[ "vtkMultiBlockDataSet" ],
5555
composite_data_supported=True,
5656
)
57-
# @geos.pv.utils.details.SISOFilter(decorated_name="PVFillPartialArrays", decorated_label="Fill Partial Arrays",decorated_type="vtkMultiBlockDataSet")
58-
class PVFillPartialArrays(VTKPythonAlgorithmBase):
57+
class PVFillPartialArrays( VTKPythonAlgorithmBase ):
5958

6059
def __init__( self: Self, ) -> None:
6160
"""Fill a partial attribute with constant value per component."""
@@ -67,8 +66,7 @@ def __init__( self: Self, ) -> None:
6766
self.clearDictAttributesValues: bool = True
6867
self.dictAttributesValues: dict[ str, Union[ list[ Any ], None ] ] = {}
6968

70-
71-
@smproperty.xml("""
69+
@smproperty.xml( """
7270
<StringVectorProperty
7371
name="AttributeTable"
7472
number_of_elements="2"
@@ -80,7 +78,7 @@ def __init__( self: Self, ) -> None:
8078
attributeName | fillingValueComponent1 fillingValueComponent2 ...\n
8179
To fill the attribute with the default value, live a blanc. The default value is:\n
8280
0 for uint type, -1 for int type and nan for float type.
83-
</Documentation>
81+
</Documentation>
8482
<Hints>
8583
<AllowRestoreDefaults />
8684
<ShowComponentLabels>
@@ -102,10 +100,10 @@ def _setDictAttributesValues( self: Self, attributeName: str, values: str ) -> N
102100
self.clearDictAttributesValues = False
103101

104102
if attributeName is not None:
105-
if values is not None :
103+
if values is not None:
106104
self.dictAttributesValues[ attributeName ] = list( values.split( "," ) )
107105
else:
108-
self.dictAttributesValues[ attributeName ] = None
106+
self.dictAttributesValues[ attributeName ] = None # type: ignore[unreachable]
109107

110108
self.Modified()
111109

@@ -156,9 +154,10 @@ def RequestData(
156154

157155
outputMesh.ShallowCopy( inputMesh )
158156

159-
filter: FillPartialArrays = FillPartialArrays( outputMesh,
160-
self.dictAttributesValues,
161-
speHandler=True,
157+
filter: FillPartialArrays = FillPartialArrays(
158+
outputMesh,
159+
self.dictAttributesValues,
160+
speHandler=True,
162161
)
163162

164163
if not filter.logger.hasHandlers():

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

Lines changed: 0 additions & 79 deletions
This file was deleted.

0 commit comments

Comments
 (0)