|
51 | 51 | "idBlock, attributeName, nbComponentsTest, componentNamesTest, piece, listValues, listValuesTest, vtkDataTypeTest", |
52 | 52 | [ |
53 | 53 | # Test fill an attribute on point and on cell. |
54 | | - ( 3, "PointAttribute", 3, ( "AX1", "AX2", "AX3" ), Piece.POINTS, None, [ np.float64( np.nan ), np.float64( np.nan ), np.float64( np.nan ) ], VTK_DOUBLE ), |
55 | | - ( 3, "CellAttribute", 3, ( "AX1", "AX2", "AX3" ), Piece.CELLS, None, [ np.float64( np.nan ), np.float64( np.nan ), np.float64( np.nan ) ], VTK_DOUBLE ), |
| 54 | + ( 3, "PointAttribute", 3, ( "AX1", "AX2", "AX3" ), Piece.POINTS, None, |
| 55 | + [ np.float64( np.nan ), np.float64( np.nan ), |
| 56 | + np.float64( np.nan ) ], VTK_DOUBLE ), |
| 57 | + ( 3, "CellAttribute", 3, ( "AX1", "AX2", "AX3" ), Piece.CELLS, None, |
| 58 | + [ np.float64( np.nan ), np.float64( np.nan ), |
| 59 | + np.float64( np.nan ) ], VTK_DOUBLE ), |
56 | 60 | # Test fill attributes with different number of component with or without component names. |
57 | 61 | ( 3, "PORO", 1, (), Piece.CELLS, None, [ np.float32( np.nan ) ], VTK_FLOAT ), |
58 | | - ( 1, "collocated_nodes", 2, ( None, None ), Piece.POINTS, None, [ np.int64( -1 ), np.int64( -1 ) ], VTK_ID_TYPE ), |
| 62 | + ( 1, "collocated_nodes", 2, |
| 63 | + ( None, None ), Piece.POINTS, None, [ np.int64( -1 ), np.int64( -1 ) ], VTK_ID_TYPE ), |
59 | 64 | # Test fill an attribute with different type of value. |
60 | 65 | ( 3, "FAULT", 1, (), Piece.CELLS, None, [ np.int32( -1 ) ], VTK_INT ), |
61 | 66 | ( 3, "FAULT", 1, (), Piece.CELLS, [ 4 ], [ np.int32( 4 ) ], VTK_INT ), |
62 | 67 | ( 3, "PORO", 1, (), Piece.CELLS, [ 4 ], [ np.float32( 4 ) ], VTK_FLOAT ), |
63 | | - ( 1, "collocated_nodes", 2, ( None, None ), Piece.POINTS, [ 4, 4 ], [ np.int64( 4 ), np.int64( 4 ) ], VTK_ID_TYPE ), |
64 | | - ( 3, "CellAttribute", 3, ( "AX1", "AX2", "AX3" ), Piece.CELLS, [ 4, 4, 4 ], [ np.float64( 4 ), np.float64( 4 ), np.float64( 4 ) ], VTK_DOUBLE ), |
| 68 | + ( 1, "collocated_nodes", 2, |
| 69 | + ( None, None ), Piece.POINTS, [ 4, 4 ], [ np.int64( 4 ), np.int64( 4 ) ], VTK_ID_TYPE ), |
| 70 | + ( 3, "CellAttribute", 3, ( "AX1", "AX2", "AX3" ), Piece.CELLS, [ 4, 4, 4 ], |
| 71 | + [ np.float64( 4 ), np.float64( 4 ), np.float64( 4 ) ], VTK_DOUBLE ), |
65 | 72 | ] ) |
66 | 73 | def test_fillPartialAttributes( |
67 | 74 | dataSetTest: vtkMultiBlockDataSet, |
@@ -181,10 +188,7 @@ def test_createConstantAttributeMultiBlock( |
181 | 188 | """Test creation of constant attribute in multiblock dataset.""" |
182 | 189 | multiBlockDataSetTest: vtkMultiBlockDataSet = dataSetTest( "multiblock" ) |
183 | 190 | values: list[ float ] = [ np.nan ] |
184 | | - assert arrayModifiers.createConstantAttributeMultiBlock( multiBlockDataSetTest, |
185 | | - values, |
186 | | - attributeName, |
187 | | - piece=piece ) |
| 191 | + assert arrayModifiers.createConstantAttributeMultiBlock( multiBlockDataSetTest, values, attributeName, piece=piece ) |
188 | 192 |
|
189 | 193 | elementaryBlockIndexes: list[ int ] = getBlockElementIndexesFlatten( multiBlockDataSetTest ) |
190 | 194 | for blockIndex in elementaryBlockIndexes: |
@@ -552,7 +556,8 @@ def test_renameAttributeMultiblock( |
552 | 556 | assert data.HasArray( newAttributeName ) == 1 |
553 | 557 |
|
554 | 558 |
|
555 | | -@pytest.mark.parametrize( "attributeName, piece", [ ( "CellAttribute", Piece.CELLS ), ( "PointAttribute", Piece.POINTS ) ] ) |
| 559 | +@pytest.mark.parametrize( "attributeName, piece", [ ( "CellAttribute", Piece.CELLS ), |
| 560 | + ( "PointAttribute", Piece.POINTS ) ] ) |
556 | 561 | def test_renameAttributeDataSet( |
557 | 562 | dataSetTest: vtkDataSet, |
558 | 563 | attributeName: str, |
|
0 commit comments