-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Adding a diff filter #193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Update to the last version of the main
geos-processing/src/geos/processing/generic_processing_tools/AttributesDiff.py
Show resolved
Hide resolved
Co-authored-by: Jacques Franc <49998870+jafranc@users.noreply.github.com>
| __doc__ = """ | ||
| Attributes Diff is a vtk that compute L1 and L2 differences between attributes shared by two identical meshes. | ||
|
|
||
| Input meshes cans be vtkDataSet or vtkMultiBlockDataSet. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Input meshes cans be vtkDataSet or vtkMultiBlockDataSet. | |
| Input meshes can be vtkDataSet or vtkMultiBlockDataSet. |
| self.dicNbElements: dict[ Piece, int ] = {} | ||
|
|
||
| self.dicSharedAttributes: dict[ Piece, set[ str ] ] = {} | ||
| self.dicAttributesToCompare: dict[ Piece, set[ str ] ] = {} | ||
| self.dicAttributesDiffNames: dict[ Piece, list[ str ] ] = {} | ||
| self.dicAttributesArray: dict[ Piece, npt.NDArray[ np.float32 ] ] = {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| self.dicNbElements: dict[ Piece, int ] = {} | |
| self.dicSharedAttributes: dict[ Piece, set[ str ] ] = {} | |
| self.dicAttributesToCompare: dict[ Piece, set[ str ] ] = {} | |
| self.dicAttributesDiffNames: dict[ Piece, list[ str ] ] = {} | |
| self.dicAttributesArray: dict[ Piece, npt.NDArray[ np.float32 ] ] = {} | |
| self.dictNbElements: dict[ Piece, int ] = {} | |
| self.dictSharedAttributes: dict[ Piece, set[ str ] ] = {} | |
| self.dictAttributesToCompare: dict[ Piece, set[ str ] ] = {} | |
| self.dictAttributesDiffNames: dict[ Piece, list[ str ] ] = {} | |
| self.dictAttributesArray: dict[ Piece, npt.NDArray[ np.float32 ] ] = {} |
I think we can afford the t of dict for these variables names :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same for similar variables in the rest of the code
| def getDicAttributesToCompare( self: Self ) -> dict[ Piece, set[ str ] ]: | ||
| """Getter of the dictionary of the attribute to compare per localization.""" | ||
| return self.dicAttributesToCompare | ||
|
|
||
| def getDicAttributesDiffNames( self: Self ) -> dict[ Piece, list[ str ] ]: | ||
| """Getter of the dictionary with the name of the attribute created with the calculated attributes diff.""" | ||
| return self.dicAttributesDiffNames |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing return type docstring in these two functions
| else: | ||
| listBlockId: list[ int ] = getBlockElementIndexesFlatten( self.outputMesh ) | ||
| l2Max: Any = 0 | ||
| for BlockId in listBlockId: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| for BlockId in listBlockId: | |
| for blockId in listBlockId: |
| from geos.utils.pieceEnum import Piece | ||
|
|
||
| __doc__ = """ | ||
| Attributes Diff is a vtk that compute L1 and L2 differences between attributes shared by two identical meshes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Attributes Diff is a vtk that compute L1 and L2 differences between attributes shared by two identical meshes. | |
| Attributes Diff is a vtk filter that computes L1 and L2 differences between attributes shared by two identical meshes. |
| # TODO: Create meshes for test | ||
| @pytest.mark.parametrize( "mesh1Name, mesh2Name", [] ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| # TODO: Create meshes for test | |
| @pytest.mark.parametrize( "mesh1Name, mesh2Name", [] ) | |
| # TODO: Create meshes for test | |
| @pytest.mark.skip( "Add data for test" ) | |
| @pytest.mark.parametrize( "mesh1Name, mesh2Name", [] ) |
| AttributesDiffFilter: AttributesDiff = AttributesDiff() | ||
| AttributesDiffFilter.setMeshes( [ mesh1, mesh2 ] ) | ||
| AttributesDiffFilter.logSharedAttributeInfo() | ||
| dicAttributesToCompare: dict[ Piece, set[ str ] ] = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same remark for dic -> dict in variables names in this file
Adding a diff filter in VTK and paraview that allows to