You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: geos-mesh/src/geos/mesh/utils/arrayModifiers.py
+21-12Lines changed: 21 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -60,6 +60,7 @@ def fillPartialAttributes(
60
60
onPoints: bool=False,
61
61
listValues: Union[ list[ Any ], None ] =None,
62
62
logger: Union[ Logger, None ] =None,
63
+
fillAll: bool=False,
63
64
) ->bool:
64
65
"""Fill input partial attribute of multiBlockDataSet with a constant value per component.
65
66
@@ -75,6 +76,8 @@ def fillPartialAttributes(
75
76
nan for float VTK arrays.
76
77
logger (Union[Logger, None], optional): A logger to manage the output messages.
77
78
Defaults to None, an internal logger is used.
79
+
fillAll (bool, optional): True if fillPartialAttributes is used by fillAllPartialAttributes, else False.
80
+
Defaults to False.
78
81
79
82
Returns:
80
83
bool: True if the attribute was correctly created and filled, False if not.
@@ -105,32 +108,29 @@ def fillPartialAttributes(
105
108
# Set the default value depending of the type of the attribute to fill
106
109
iflistValuesisNone:
107
110
defaultValue: Any
108
-
logger.warning( f"The attribute {attributeName} is filled with the default value for each component." )
111
+
mess: str=f"The attribute {attributeName} is filled with the default value for each component.\n"
109
112
# Default value for float types is nan.
110
113
ifvtkDataTypein ( VTK_FLOAT, VTK_DOUBLE ):
111
114
defaultValue=valueType( np.nan )
112
-
logger.warning(
113
-
f"{attributeName} vtk data type is {vtkDataType} corresponding to {defaultValue.dtype} numpy type, default value is automatically set to nan."
114
-
)
115
+
mess=mess+f"{attributeName} vtk data type is {vtkDataType} corresponding to {defaultValue.dtype} numpy type, default value is automatically set to nan."
f"{attributeName} vtk data type is {vtkDataType} corresponding to {defaultValue.dtype} numpy type, default value is automatically set to -1."
120
-
)
119
+
mess=mess+f"{attributeName} vtk data type is {vtkDataType} corresponding to {defaultValue.dtype} numpy type, default value is automatically set to -1."
"""Fill all partial attributes of a multiBlockDataSet with the default value. All components of each attributes are filled with the same value. Depending of the type of the attribute, the default value is different 0, -1 and nan for respectively uint, int and float vtk type.
161
+
"""Fill all partial attributes of a multiBlockDataSet with the default value.
162
+
163
+
All components of each attributes are filled with the same value. Depending of the type of the attribute's data, the default value is different:
164
+
0 for uint data,
165
+
-1 for int data,
166
+
nan float data,
162
167
163
168
Args:
164
169
multiBlockDataSet (vtkMultiBlockDataSet | vtkCompositeDataSet | vtkDataObject): MultiBlockDataSet where to fill attributes.
0 commit comments