From 1a573227268ebe02326f277a37c1c0790d8660eb Mon Sep 17 00:00:00 2001 From: jacques franc Date: Tue, 16 Sep 2025 15:02:40 +0200 Subject: [PATCH 1/6] wip --- .../geos/pv/plugins/PVFillPartialArrays.py | 37 ++++----- geos-pv/src/geos/pv/utils/details.py | 79 +++++++++++++++++++ 2 files changed, 98 insertions(+), 18 deletions(-) create mode 100644 geos-pv/src/geos/pv/utils/details.py diff --git a/geos-pv/src/geos/pv/plugins/PVFillPartialArrays.py b/geos-pv/src/geos/pv/plugins/PVFillPartialArrays.py index 218d6bfc..c98c82a7 100644 --- a/geos-pv/src/geos/pv/plugins/PVFillPartialArrays.py +++ b/geos-pv/src/geos/pv/plugins/PVFillPartialArrays.py @@ -30,7 +30,7 @@ update_paths() from geos.mesh.processing.FillPartialArrays import FillPartialArrays - +import geos.pv.utils.details __doc__ = """ Fill partial arrays of input mesh. @@ -47,21 +47,22 @@ """ -@smproxy.filter( name="PVFillPartialArrays", label="Fill Partial Arrays" ) -@smhint.xml( '' ) -@smproperty.input( name="Input", port_index=0 ) -@smdomain.datatype( - dataTypes=[ "vtkMultiBlockDataSet" ], - composite_data_supported=True, -) -class PVFillPartialArrays( VTKPythonAlgorithmBase ): +# @smproxy.filter( name="PVFillPartialArrays", label="Fill Partial Arrays" ) +# @smhint.xml( '' ) +# @smproperty.input( name="Input", port_index=0 ) +# @smdomain.datatype( +# dataTypes=[ "vtkMultiBlockDataSet" ], +# composite_data_supported=True, +# ) +@geos.pv.utils.details.SISOFilter(decorated_name="PVFillPartialArrays", decorated_label="Fill Partial Arrays",decorated_type="vtkMultiBlockDataSet") +class PVFillPartialArrays: def __init__( self: Self, ) -> None: """Fill a partial attribute with constant value per component.""" - super().__init__( nInputPorts=1, - nOutputPorts=1, - inputType="vtkMultiBlockDataSet", - outputType="vtkMultiBlockDataSet" ) + # super().__init__( nInputPorts=1, + # nOutputPorts=1, + # inputType="vtkMultiBlockDataSet", + # outputType="vtkMultiBlockDataSet" ) self.clearDictAttributesValues: bool = True self.dictAttributesValues: dict[ str, Union[ list[ Any ], None ] ] = {} @@ -99,13 +100,13 @@ def _setDictAttributesValues( self: Self, attributeName: str, values: str ) -> N if self.clearDictAttributesValues: self.dictAttributesValues = {} self.clearDictAttributesValues = False - + if attributeName is not None: if values is not None : self.dictAttributesValues[ attributeName ] = list( values.split( "," ) ) else: self.dictAttributesValues[ attributeName ] = None - + self.Modified() def RequestDataObject( @@ -156,13 +157,13 @@ def RequestData( outputMesh.ShallowCopy( inputMesh ) filter: FillPartialArrays = FillPartialArrays( outputMesh, - self.dictAttributesValues, + self.dictAttributesValues, True, ) - + if not filter.logger.hasHandlers(): filter.setLoggerHandler( VTKHandler() ) - + filter.applyFilter() self.clearDictAttributesValues = True diff --git a/geos-pv/src/geos/pv/utils/details.py b/geos-pv/src/geos/pv/utils/details.py new file mode 100644 index 00000000..97fd45f4 --- /dev/null +++ b/geos-pv/src/geos/pv/utils/details.py @@ -0,0 +1,79 @@ +# SPDX-License-Identifier: Apache-2.0 +# SPDX-FileCopyrightText: Copyright 2023-2024 TotalEnergies. +# SPDX-FileContributor: Martin Lemay, Romain Baville +# ruff: noqa: E402 # disable Module level import not at top of file +import sys +from pathlib import Path +from typing import Union, Any +from typing_extensions import Self + +# from functools import wraps +# from dataclasses import dataclass + +from paraview.util.vtkAlgorithm import ( # type: ignore[import-not-found] + VTKPythonAlgorithmBase, smdomain, smhint, smproperty, smproxy, +) # source: https://github.com/Kitware/ParaView/blob/master/Wrapping/Python/paraview/util/vtkAlgorithm.py +from paraview.detail.loghandler import ( # type: ignore[import-not-found] + VTKHandler, +) # source: https://github.com/Kitware/ParaView/blob/master/Wrapping/Python/paraview/detail/loghandler.py + +from vtkmodules.vtkCommonDataModel import ( + vtkMultiBlockDataSet, ) + +from vtkmodules.vtkCommonCore import ( + vtkInformation, + vtkInformationVector, +) + +# update sys.path to load all GEOS Python Package dependencies +geos_pv_path: Path = Path( __file__ ).parent.parent.parent.parent.parent +sys.path.insert( 0, str( geos_pv_path / "src" ) ) +from geos.pv.utils.config import update_paths + +update_paths() + +__doc__ = """ +Set of decorators that allow: + - quicker generation of MultiBlockDataSet to MultiBlockDataSet filters + - more stable logger strategy + +Usage is: + + @SISO(name='MyFilter',label='This is my filter',dtype='vtkMultiBlockDataSet') + class PVMyFilter: + ... + def __hidden_layer(self): + + +""" + +def SISOFilter(decorated_name, decorated_label, decorated_type): + """ + Decorate single input single output filter + """ + def decorated_class(cls): + @smproxy.filter( name=decorated_name, label=decorated_label ) + @smhint.xml( '' ) + @smproperty.input( name="Input", port_index=0 ) + @smdomain.datatype( + dataTypes=[ decorated_type ], + composite_data_supported=True, + ) + # @dataclass + # class WrappingClass(cls): + class WrappingClass(cls,VTKPythonAlgorithmBase): + + def __init__(self,*ar,**kw): + VTKPythonAlgorithmBase.__init__(self, nInputPorts=1, + nOutputPorts=1, + inputType=decorated_type, + outputType=decorated_type ) + cls.___init__(self,*ar,**kw) + WrappingClass.__name__ = cls.__name__ + WrappingClass.__module__ = cls.__module__ + + return WrappingClass + return decorated_class + + + From 84c0ba865030318340d16150fd61fb433c1d456b Mon Sep 17 00:00:00 2001 From: jacques franc Date: Tue, 30 Sep 2025 18:21:51 +0200 Subject: [PATCH 2/6] PoC --- .../geos/mesh/processing/FillPartialArrays.py | 27 +-------- .../geos/pv/plugins/PVFillPartialArrays.py | 30 +++++----- geos-utils/src/geos/utils/details.py | 55 +++++++++++++++++++ 3 files changed, 73 insertions(+), 39 deletions(-) create mode 100644 geos-utils/src/geos/utils/details.py diff --git a/geos-mesh/src/geos/mesh/processing/FillPartialArrays.py b/geos-mesh/src/geos/mesh/processing/FillPartialArrays.py index 1810bc73..492a77db 100644 --- a/geos-mesh/src/geos/mesh/processing/FillPartialArrays.py +++ b/geos-mesh/src/geos/mesh/processing/FillPartialArrays.py @@ -9,6 +9,7 @@ from geos.mesh.utils.arrayModifiers import fillPartialAttributes from geos.mesh.utils.arrayHelpers import getAttributePieceInfo +from geos.utils.details import addLogSupport from vtkmodules.vtkCommonDataModel import vtkMultiBlockDataSet __doc__ = """ @@ -51,13 +52,13 @@ loggerTitle: str = "Fill Partial Attribute" +@addLogSupport(loggerTitle= loggerTitle) class FillPartialArrays: def __init__( self: Self, multiBlockDataSet: vtkMultiBlockDataSet, dictAttributesValues: dict[ str, Union[ list[ Any ], None ] ], - speHandler: bool = False, ) -> None: """Fill partial attributes with constant value per component. @@ -75,30 +76,8 @@ def __init__( self.multiBlockDataSet: vtkMultiBlockDataSet = multiBlockDataSet self.dictAttributesValues: dict[ str, Union[ list[ Any ], None ] ] = dictAttributesValues - # Logger. - self.logger: Logger - if not speHandler: - self.logger = getLogger( loggerTitle, True ) - else: - self.logger = logging.getLogger( loggerTitle ) - self.logger.setLevel( logging.INFO ) - def setLoggerHandler( self: Self, handler: logging.Handler ) -> None: - """Set a specific handler for the filter logger. - - In this filter 4 log levels are use, .info, .error, .warning and .critical, be sure to have at least the same 4 levels. - - Args: - handler (logging.Handler): The handler to add. - """ - if not self.logger.hasHandlers(): - self.logger.addHandler( handler ) - else: - self.logger.warning( - "The logger already has an handler, to use yours set the argument 'speHandler' to True during the filter initialization." - ) - - def applyFilter( self: Self ) -> bool: + def applyFilter( self : Self ) -> bool: """Create a constant attribute per region in the mesh. Returns: diff --git a/geos-pv/src/geos/pv/plugins/PVFillPartialArrays.py b/geos-pv/src/geos/pv/plugins/PVFillPartialArrays.py index c98c82a7..a8773bbd 100644 --- a/geos-pv/src/geos/pv/plugins/PVFillPartialArrays.py +++ b/geos-pv/src/geos/pv/plugins/PVFillPartialArrays.py @@ -30,7 +30,7 @@ update_paths() from geos.mesh.processing.FillPartialArrays import FillPartialArrays -import geos.pv.utils.details +# import geos.pv.utils.details __doc__ = """ Fill partial arrays of input mesh. @@ -47,22 +47,22 @@ """ -# @smproxy.filter( name="PVFillPartialArrays", label="Fill Partial Arrays" ) -# @smhint.xml( '' ) -# @smproperty.input( name="Input", port_index=0 ) -# @smdomain.datatype( -# dataTypes=[ "vtkMultiBlockDataSet" ], -# composite_data_supported=True, -# ) -@geos.pv.utils.details.SISOFilter(decorated_name="PVFillPartialArrays", decorated_label="Fill Partial Arrays",decorated_type="vtkMultiBlockDataSet") -class PVFillPartialArrays: +@smproxy.filter( name="PVFillPartialArrays", label="Fill Partial Arrays" ) +@smhint.xml( '' ) +@smproperty.input( name="Input", port_index=0 ) +@smdomain.datatype( + dataTypes=[ "vtkMultiBlockDataSet" ], + composite_data_supported=True, +) +# @geos.pv.utils.details.SISOFilter(decorated_name="PVFillPartialArrays", decorated_label="Fill Partial Arrays",decorated_type="vtkMultiBlockDataSet") +class PVFillPartialArrays(VTKPythonAlgorithmBase): def __init__( self: Self, ) -> None: """Fill a partial attribute with constant value per component.""" - # super().__init__( nInputPorts=1, - # nOutputPorts=1, - # inputType="vtkMultiBlockDataSet", - # outputType="vtkMultiBlockDataSet" ) + super().__init__( nInputPorts=1, + nOutputPorts=1, + inputType="vtkMultiBlockDataSet", + outputType="vtkMultiBlockDataSet" ) self.clearDictAttributesValues: bool = True self.dictAttributesValues: dict[ str, Union[ list[ Any ], None ] ] = {} @@ -158,7 +158,7 @@ def RequestData( filter: FillPartialArrays = FillPartialArrays( outputMesh, self.dictAttributesValues, - True, + speHandler=True, ) if not filter.logger.hasHandlers(): diff --git a/geos-utils/src/geos/utils/details.py b/geos-utils/src/geos/utils/details.py new file mode 100644 index 00000000..cf6378e8 --- /dev/null +++ b/geos-utils/src/geos/utils/details.py @@ -0,0 +1,55 @@ +import logging +from geos.utils.Logger import Logger, getLogger +from functools import wraps +from typing import Type, TypeVar + + +__doc__ = """ + Decorators + +""" + +def addLogSupport(loggerTitle : str): + T = TypeVar('T') + def decorator(cls:Type[T]) -> Type[T]: + original_init = cls.__init__ + + @wraps(cls) + def new_init(self : T, *args, **kwargs): + + self.logger : Logger + + if kwargs.get('speHandler'): + kwargs.pop('speHandler') + self.logger = logging.getLogger( loggerTitle ) + self.logger.setLevel( logging.INFO ) + else: + self.logger = getLogger( loggerTitle, True) + + original_init(self,*args,*kwargs) + + @property + def logger(self : T)->Logger: + return self.logger + + def setLoggerHandler(self, handler : logging.Handler): + """Set a specific handler for the filter logger. + + In this filter 4 log levels are use, .info, .error, .warning and .critical, be sure to have at least the same 4 levels. + + Args: + handler (logging.Handler): The handler to add. + """ + if not self.logger.hasHandlers(): + self.logger.addHandler( handler ) + else: + self.logger.warning( + "The logger already has an handler, to use yours set the argument 'speHandler' to True during the filter initialization." + ) + + cls.__init__ = new_init + cls.setLoggerHandler = setLoggerHandler + + return cls + + return decorator \ No newline at end of file From f32fe2ec799b18138f61017bcf5a785fb4bdac4b Mon Sep 17 00:00:00 2001 From: jacques franc Date: Thu, 2 Oct 2025 10:24:07 +0200 Subject: [PATCH 3/6] decorator and precommit recipe --- .hooks/pre-commit.example | 20 ++++++++ geos-utils/src/geos/utils/details.py | 71 ++++++++++++++++------------ 2 files changed, 61 insertions(+), 30 deletions(-) create mode 100755 .hooks/pre-commit.example diff --git a/.hooks/pre-commit.example b/.hooks/pre-commit.example new file mode 100755 index 00000000..7c7dc461 --- /dev/null +++ b/.hooks/pre-commit.example @@ -0,0 +1,20 @@ +#!/bin/bash -e + +function run_precommit_checks +{ + python -m mypy --config-file ./.mypy.ini --check-untyped-defs $1 + python -m ruff check --unsafe-fixes --config .ruff.toml $1 + python -m yapf -r -i --style .style.yapf $1 + + return 0 +} + + +source ${ENV_PYTHON_PATH}/bin/activate + +sphinx-build -b html docs/ docs/_build -W +for file in $(git diff --name-only --cached | grep py) +do + run_precommit_checks $file +done + diff --git a/geos-utils/src/geos/utils/details.py b/geos-utils/src/geos/utils/details.py index cf6378e8..88bf7da0 100644 --- a/geos-utils/src/geos/utils/details.py +++ b/geos-utils/src/geos/utils/details.py @@ -1,55 +1,66 @@ import logging from geos.utils.Logger import Logger, getLogger from functools import wraps -from typing import Type, TypeVar - +from typing import Type, TypeVar, Callable, Protocol, Any __doc__ = """ - Decorators + Group of decorators and Protocols that will be used in filters to wrap behaviors without code replication """ -def addLogSupport(loggerTitle : str): - T = TypeVar('T') - def decorator(cls:Type[T]) -> Type[T]: - original_init = cls.__init__ - @wraps(cls) - def new_init(self : T, *args, **kwargs): +class HasLogger( Protocol ): + """Protocol for classes that have logging support.""" + + logger: Logger + + def setLoggerHandler( self, handler: logging.Handler ) -> None: + """Set a specific handler for the filter logger. + + In this filter 4 log levels are use, .info, .error, .warning and .critical, be sure to have at least the same 4 levels. + + Args: + handler (logging.Handler): The handler to add. + """ + pass + - self.logger : Logger +T = TypeVar( 'T', bound='HasLogger' ) - if kwargs.get('speHandler'): - kwargs.pop('speHandler') + +def addLogSupport( loggerTitle: str ) -> Callable[ [ Type[ T ] ], Type[ T ] ]: + """Decorator to add logger support in the class following existing architecture. + + Args: + loggerTitle (str): Title to display in the logger + """ + + def decorator( cls: Type[ T ] ) -> Type[ T ]: + original_init = cls.__init__ + + @wraps( original_init ) + def new_init( self: T, *args: Any, **kwargs: Any ) -> None: + spe_handler = kwargs.pop( 'speHandler', False ) + if spe_handler: self.logger = logging.getLogger( loggerTitle ) self.logger.setLevel( logging.INFO ) else: - self.logger = getLogger( loggerTitle, True) - - original_init(self,*args,*kwargs) - - @property - def logger(self : T)->Logger: - return self.logger - - def setLoggerHandler(self, handler : logging.Handler): - """Set a specific handler for the filter logger. + self.logger = getLogger( loggerTitle, True ) - In this filter 4 log levels are use, .info, .error, .warning and .critical, be sure to have at least the same 4 levels. + original_init( self, *args, **kwargs ) - Args: - handler (logging.Handler): The handler to add. - """ - if not self.logger.hasHandlers(): + def setLoggerHandler( self: T, handler: logging.Handler ) -> None: + # No docstring needed - Protocol defines the contract + if not self.logger.handlers: self.logger.addHandler( handler ) else: self.logger.warning( "The logger already has an handler, to use yours set the argument 'speHandler' to True during the filter initialization." ) - cls.__init__ = new_init - cls.setLoggerHandler = setLoggerHandler + cls.__init__ = new_init # type: ignore[assignment] + cls.setLoggerHandler = setLoggerHandler # type: ignore[assignment] return cls - return decorator \ No newline at end of file + return decorator From 6f6e65269824771b054dd529a2daf7815ac74144 Mon Sep 17 00:00:00 2001 From: jacques franc Date: Thu, 2 Oct 2025 10:55:15 +0200 Subject: [PATCH 4/6] clean up --- .hooks/pre-commit.example | 9 ++- .../geos/pv/plugins/PVFillPartialArrays.py | 25 +++--- geos-pv/src/geos/pv/utils/details.py | 79 ------------------- 3 files changed, 18 insertions(+), 95 deletions(-) delete mode 100644 geos-pv/src/geos/pv/utils/details.py diff --git a/.hooks/pre-commit.example b/.hooks/pre-commit.example index 7c7dc461..f4f188d7 100755 --- a/.hooks/pre-commit.example +++ b/.hooks/pre-commit.example @@ -2,18 +2,21 @@ function run_precommit_checks { + echo "running mypy" python -m mypy --config-file ./.mypy.ini --check-untyped-defs $1 + echo "running ruff" python -m ruff check --unsafe-fixes --config .ruff.toml $1 + echo "running yapf" python -m yapf -r -i --style .style.yapf $1 return 0 } -source ${ENV_PYTHON_PATH}/bin/activate +source ${ENV_PYTHON}/bin/activate -sphinx-build -b html docs/ docs/_build -W -for file in $(git diff --name-only --cached | grep py) +#sphinx-build -b html docs/ docs/_build -W +for file in $(git diff --name-only --cached | grep -e "modified\|added" | grep py) do run_precommit_checks $file done diff --git a/geos-pv/src/geos/pv/plugins/PVFillPartialArrays.py b/geos-pv/src/geos/pv/plugins/PVFillPartialArrays.py index a8773bbd..b6b89272 100644 --- a/geos-pv/src/geos/pv/plugins/PVFillPartialArrays.py +++ b/geos-pv/src/geos/pv/plugins/PVFillPartialArrays.py @@ -9,10 +9,10 @@ from paraview.util.vtkAlgorithm import ( # type: ignore[import-not-found] VTKPythonAlgorithmBase, smdomain, smhint, smproperty, smproxy, -) # source: https://github.com/Kitware/ParaView/blob/master/Wrapping/Python/paraview/util/vtkAlgorithm.py +) # source: https://github.com/Kitware/ParaView/blob/master/Wrapping/Python/paraview/util/vtkAlgorithm.py from paraview.detail.loghandler import ( # type: ignore[import-not-found] VTKHandler, -) # source: https://github.com/Kitware/ParaView/blob/master/Wrapping/Python/paraview/detail/loghandler.py +) # source: https://github.com/Kitware/ParaView/blob/master/Wrapping/Python/paraview/detail/loghandler.py from vtkmodules.vtkCommonDataModel import ( vtkMultiBlockDataSet, ) @@ -30,7 +30,7 @@ update_paths() from geos.mesh.processing.FillPartialArrays import FillPartialArrays -# import geos.pv.utils.details + __doc__ = """ Fill partial arrays of input mesh. @@ -54,8 +54,7 @@ dataTypes=[ "vtkMultiBlockDataSet" ], composite_data_supported=True, ) -# @geos.pv.utils.details.SISOFilter(decorated_name="PVFillPartialArrays", decorated_label="Fill Partial Arrays",decorated_type="vtkMultiBlockDataSet") -class PVFillPartialArrays(VTKPythonAlgorithmBase): +class PVFillPartialArrays( VTKPythonAlgorithmBase ): def __init__( self: Self, ) -> None: """Fill a partial attribute with constant value per component.""" @@ -67,8 +66,7 @@ def __init__( self: Self, ) -> None: self.clearDictAttributesValues: bool = True self.dictAttributesValues: dict[ str, Union[ list[ Any ], None ] ] = {} - - @smproperty.xml(""" + @smproperty.xml( """ None: attributeName | fillingValueComponent1 fillingValueComponent2 ...\n To fill the attribute with the default value, live a blanc. The default value is:\n 0 for uint type, -1 for int type and nan for float type. - + @@ -102,10 +100,10 @@ def _setDictAttributesValues( self: Self, attributeName: str, values: str ) -> N self.clearDictAttributesValues = False if attributeName is not None: - if values is not None : + if values is not None: self.dictAttributesValues[ attributeName ] = list( values.split( "," ) ) else: - self.dictAttributesValues[ attributeName ] = None + self.dictAttributesValues[ attributeName ] = None # type: ignore[unreachable] self.Modified() @@ -156,9 +154,10 @@ def RequestData( outputMesh.ShallowCopy( inputMesh ) - filter: FillPartialArrays = FillPartialArrays( outputMesh, - self.dictAttributesValues, - speHandler=True, + filter: FillPartialArrays = FillPartialArrays( + outputMesh, + self.dictAttributesValues, + speHandler=True, ) if not filter.logger.hasHandlers(): diff --git a/geos-pv/src/geos/pv/utils/details.py b/geos-pv/src/geos/pv/utils/details.py deleted file mode 100644 index 97fd45f4..00000000 --- a/geos-pv/src/geos/pv/utils/details.py +++ /dev/null @@ -1,79 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 -# SPDX-FileCopyrightText: Copyright 2023-2024 TotalEnergies. -# SPDX-FileContributor: Martin Lemay, Romain Baville -# ruff: noqa: E402 # disable Module level import not at top of file -import sys -from pathlib import Path -from typing import Union, Any -from typing_extensions import Self - -# from functools import wraps -# from dataclasses import dataclass - -from paraview.util.vtkAlgorithm import ( # type: ignore[import-not-found] - VTKPythonAlgorithmBase, smdomain, smhint, smproperty, smproxy, -) # source: https://github.com/Kitware/ParaView/blob/master/Wrapping/Python/paraview/util/vtkAlgorithm.py -from paraview.detail.loghandler import ( # type: ignore[import-not-found] - VTKHandler, -) # source: https://github.com/Kitware/ParaView/blob/master/Wrapping/Python/paraview/detail/loghandler.py - -from vtkmodules.vtkCommonDataModel import ( - vtkMultiBlockDataSet, ) - -from vtkmodules.vtkCommonCore import ( - vtkInformation, - vtkInformationVector, -) - -# update sys.path to load all GEOS Python Package dependencies -geos_pv_path: Path = Path( __file__ ).parent.parent.parent.parent.parent -sys.path.insert( 0, str( geos_pv_path / "src" ) ) -from geos.pv.utils.config import update_paths - -update_paths() - -__doc__ = """ -Set of decorators that allow: - - quicker generation of MultiBlockDataSet to MultiBlockDataSet filters - - more stable logger strategy - -Usage is: - - @SISO(name='MyFilter',label='This is my filter',dtype='vtkMultiBlockDataSet') - class PVMyFilter: - ... - def __hidden_layer(self): - - -""" - -def SISOFilter(decorated_name, decorated_label, decorated_type): - """ - Decorate single input single output filter - """ - def decorated_class(cls): - @smproxy.filter( name=decorated_name, label=decorated_label ) - @smhint.xml( '' ) - @smproperty.input( name="Input", port_index=0 ) - @smdomain.datatype( - dataTypes=[ decorated_type ], - composite_data_supported=True, - ) - # @dataclass - # class WrappingClass(cls): - class WrappingClass(cls,VTKPythonAlgorithmBase): - - def __init__(self,*ar,**kw): - VTKPythonAlgorithmBase.__init__(self, nInputPorts=1, - nOutputPorts=1, - inputType=decorated_type, - outputType=decorated_type ) - cls.___init__(self,*ar,**kw) - WrappingClass.__name__ = cls.__name__ - WrappingClass.__module__ = cls.__module__ - - return WrappingClass - return decorated_class - - - From 5437cc04940fcd39d6c4122e4b154934e44c3aa7 Mon Sep 17 00:00:00 2001 From: jacques franc Date: Thu, 2 Oct 2025 11:09:36 +0200 Subject: [PATCH 5/6] yapf uncommited --- geos-mesh/src/geos/mesh/processing/FillPartialArrays.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/geos-mesh/src/geos/mesh/processing/FillPartialArrays.py b/geos-mesh/src/geos/mesh/processing/FillPartialArrays.py index 492a77db..0f048c86 100644 --- a/geos-mesh/src/geos/mesh/processing/FillPartialArrays.py +++ b/geos-mesh/src/geos/mesh/processing/FillPartialArrays.py @@ -52,7 +52,7 @@ loggerTitle: str = "Fill Partial Attribute" -@addLogSupport(loggerTitle= loggerTitle) +@addLogSupport( loggerTitle=loggerTitle ) class FillPartialArrays: def __init__( @@ -76,8 +76,7 @@ def __init__( self.multiBlockDataSet: vtkMultiBlockDataSet = multiBlockDataSet self.dictAttributesValues: dict[ str, Union[ list[ Any ], None ] ] = dictAttributesValues - - def applyFilter( self : Self ) -> bool: + def applyFilter( self: Self ) -> bool: """Create a constant attribute per region in the mesh. Returns: From 0f6c3d4045c2d32bad999200dff81b8f450643bd Mon Sep 17 00:00:00 2001 From: jacques franc Date: Fri, 3 Oct 2025 15:35:24 +0200 Subject: [PATCH 6/6] docs corrections --- geos-mesh/src/geos/mesh/processing/FillPartialArrays.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/geos-mesh/src/geos/mesh/processing/FillPartialArrays.py b/geos-mesh/src/geos/mesh/processing/FillPartialArrays.py index 0f048c86..b7033537 100644 --- a/geos-mesh/src/geos/mesh/processing/FillPartialArrays.py +++ b/geos-mesh/src/geos/mesh/processing/FillPartialArrays.py @@ -70,8 +70,6 @@ def __init__( Args: multiBlockDataSet (vtkMultiBlockDataSet): The mesh where to fill the attribute. dictAttributesValues (dict[str, Any]): The dictionary with the attribute to fill as keys and the list of filling values as items. - speHandler (bool, optional): True to use a specific handler, False to use the internal handler. - Defaults to False. """ self.multiBlockDataSet: vtkMultiBlockDataSet = multiBlockDataSet self.dictAttributesValues: dict[ str, Union[ list[ Any ], None ] ] = dictAttributesValues