Skip to content

feat: add FillPartialArrays vtk filter and paraview plugin #105

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

Open
wants to merge 60 commits into
base: main
Choose a base branch
from

Conversation

RomainBaville
Copy link
Contributor

@RomainBaville RomainBaville commented Jun 20, 2025

This PR add the possibility to fill a partial arrays with values

  • the filling value can be chosen for each component
    • The default value is nan for float data, -1 for int data and 0 for uint data.
    • Modifications of the functions FillPartialAttributes and FillAllPartialAtributes to add the possibility of choosing the value
    • Modifications of the tests of the functions FillPartialAttributes and FillAllPartialAtributes
  • several attributes can be filled at the same time.

close #104

@RomainBaville RomainBaville marked this pull request as ready for review June 23, 2025 07:10
@RomainBaville RomainBaville changed the base branch from main to RomainBaville/feature/update_geos-mesh_utils August 6, 2025 16:35
Base automatically changed from RomainBaville/feature/update_geos-mesh_utils to main August 6, 2025 18:24
assert ( npArrayFilled == npArrayTest ).all()

vtkDataTypeFilled: int = attributeFilled.GetDataType()
assert vtkDataTypeTest == vtkDataTypeFilled
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
assert vtkDataTypeTest == vtkDataTypeFilled
assert vtkDataTypeFilled == vtkDataTypeTest

</StringVectorProperty>
""" )
def _setDictAttributesValues( self: Self, attributeName: str, values: str ) -> None:
"""Set the the dictionary with the region indexes and its corresponding list of value for each components.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"""Set the the dictionary with the region indexes and its corresponding list of value for each components.
"""Set the dictionary with the region indexes and its corresponding list of value for each components.


Args:
value (str): Input
attributeName (str): Name of the attribute to consider.
values (str): List of the filing values. If multiple components use a coma between the value of each component.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
values (str): List of the filing values. If multiple components use a coma between the value of each component.
values (str): List of the filing values. If multiple components use a comma between the value of each component.

Comment on lines +103 to +106
if attributeName is not None and values is not None :
self.dictAttributesValues[ attributeName ] = list( values.split( "," ) )
elif attributeName is not None and values is None:
self.dictAttributesValues[ attributeName ] = None
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if attributeName is not None and values is not None :
self.dictAttributesValues[ attributeName ] = list( values.split( "," ) )
elif attributeName is not None and values is None:
self.dictAttributesValues[ attributeName ] = None
if attributeName is not None:
if values is not None :
self.dictAttributesValues[ attributeName ] = list( values.split( "," ) )
else:
self.dictAttributesValues[ attributeName ] = None

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create vtk filter in geos-mesh and its associated pv plugin in geos-pv to fill partial arrays
2 participants