-
Notifications
You must be signed in to change notification settings - Fork 0
feat: VTK filters for mesh-doctor #124
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?
feat: VTK filters for mesh-doctor #124
Conversation
…_filters_for_mesh_doctor
…_filters_for_mesh_doctor
…_filters_for_mesh_doctor
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.
The code is good and essay to read but some typing and docstrings are missing.
More over, I don't understand some points :
- why the check check_fractures is not also check in the function AllChecks.
- why the doc is duplicaded (a file.rst and a doc part in the filter files)
- why you use the VTKPythonAlgorithmBase for the filter while the mesh exists already, and with the VTKPythonWrapping we use, the vtk objects are pointers. Meshes can be updated without the VTKPythonAlgorithmBase pipline.
- why in the filter you use member function to set some variable (mesh, tolerance ...) while they can set as arguments.
At least, the function get_vtk_constant_str in genericHelpers needs to be updated. For now it can return a false name because severals VTK_CONSTANT refers to the same number.
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.
It seems good for me, thanks for your answer.
I have just a comment about the logger, for the moment it works but a specific handle has to be used for paraview. With your method, it will not easy but it can be done in a future pr.
@@ -1,11 +1,11 @@ | |||
from dataclasses import dataclass | |||
from typing import List, Tuple |
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.
Why import "List" and "Tuple" from typing while "list" and "tuple" already are in python?
@@ -1,8 +1,9 @@ | |||
from dataclasses import dataclass | |||
from typing import Dict, FrozenSet, List, Set |
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.
Why import "List", "Dict", "FrozenSet" and "Set" from typing while "list", "dict", "frozenset" and "set" already are in python?
listValues=listValues, | ||
attributeName=field_info.name, | ||
onPoints=onPoints ) | ||
if not success: |
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.
createConstantAttributeDataSet already log an error if the attribute is not created.
success = createConstantAttributeDataSet( dataSet=mesh, | ||
listValues=listValues, | ||
attributeName=field_info.name, | ||
onPoints=onPoints ) |
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.
You use another logger as the internal one used by this function, you should give your logger to the function (logger=setup_logger) to be sure to keep the same dysplay and names.
|
||
io_logger.info( "Reader did not match the file format." ) |
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.
Why use .info and not .warning or .error? The function didn't succed to read the file.
writer.SetInputData( mesh ) | ||
writer.SetDataModeToBinary() if toBinary else writer.SetDataModeToAscii() | ||
return writer.Write() | ||
if not output_mesh: |
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.
Why do you test again output_mesh? You could raise the ValueError after the for.
Closes #80