-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Add missing tests for array helpers #208
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: Add missing tests for array helpers #208
Conversation
…tArray already exist
| - get the mapping between cells or points shared by two meshes | ||
| The check functions: | ||
| - check of an attribute is on an mesh for a piece (one for dataset, one for multiblockDataset, one for the both and one for a list of attributes) |
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.
| - check of an attribute is on an mesh for a piece (one for dataset, one for multiblockDataset, one for the both and one for a list of attributes) | |
| - check if an attribute is on a mesh (one for dataset, one for multiblockDataset, one for the both and one for a list of attributes) |
| Returns: | ||
| set[str]: Set of attribute names present in input mesh. | ||
| (set[str]): Set of attribute names present in input 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.
| (set[str]): Set of attribute names present in input mesh. | |
| set[str]: Set of attribute names present in input mesh. |
| def sortArrayByGlobalIds( data: Union[ vtkCellData, vtkPointData ], arr: npt.NDArray[ np.float64 ] ) -> None: | ||
| """Sort an array following global Ids. | ||
| Args: | ||
| data (vtkFieldData): Global Ids array. | ||
| arr (npt.NDArray[ np.float64 ]): Array to sort. | ||
| """ | ||
| globalids: Optional[ npt.NDArray[ np.int64 ] ] = getNumpyGlobalIdsArray( data ) | ||
| if globalids is not None: | ||
| arr = arr[ np.argsort( globalids ) ] | ||
| else: | ||
| logging.warning( "No sorting was performed." ) |
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.
I am surprised by the complete removal of this function. The function getNumpyArrayByName is not a duplicate.
| coordElementTo.add( cellPointsTo.GetPoint( idPointTo ) ) | ||
|
|
||
| idElementFrom: int = 0 | ||
| ElementFromFund: bool = False |
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.
| ElementFromFund: bool = False | |
| elementFromFund: bool = False |
Should be modified in the rest of the code also
| idElementFrom += 1 | ||
| elif isinstance( meshFrom, vtkMultiBlockDataSet ): | ||
| listDataSetFromIds: list[ int ] = getBlockElementIndexesFlatten( meshFrom ) | ||
| for DataSetFromId in listDataSetFromIds: |
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 DataSetFromId in listDataSetFromIds: | |
| for dataSetFromId in listDataSetFromIds: |
idem
| listDataSetFromIds: list[ int ] = getBlockElementIndexesFlatten( meshFrom ) | ||
| for DataSetFromId in listDataSetFromIds: | ||
| dataSetFrom: vtkDataSet = vtkDataSet.SafeDownCast( meshFrom.GetDataSet( DataSetFromId ) ) | ||
| DataSetFromMap: npt.NDArray = computeElementMapping( dataSetFrom, meshTo, piece )[ 0 ] |
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.
| DataSetFromMap: npt.NDArray = computeElementMapping( dataSetFrom, meshTo, piece )[ 0 ] | |
| dataSetFromMap: npt.NDArray = computeElementMapping( dataSetFrom, meshTo, piece )[ 0 ] |
idem
This PR amis to:
This PR close #209