You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Precision issue from Grid.__from_vert__() using np.unique() #305
Describe the bug
Currently, the Grid.__from_vert__() method uses numpy.unique() to identify duplicate nodes in the coordinates format, which may lead to precision inconsistencies. For example, two nodes whose coordinates are within a threshold of 10^-12 may be considered different nodes. This can cause errors when working with Grid objects that require precise node information.
To Reproduce
Create a Grid object using Grid.__from_vert__().
Initialize the Grid object with an input array that contains nodes with coordinates that are within a threshold of 10^-12.
Access the nodes using the Grid.nodes attribute.
Notice that duplicate nodes may be present, even though they should be considered the same node.
Expected behavior
I would expect that Grid.__from_vert__() identifies duplicate nodes based on a threshold of 10^-12. This would ensure that nodes with similar coordinates are considered the same node.
Additional context
This bug affects the precision of node information in Grid objects and can cause errors in downstream analysis. It would be helpful to update Grid.__from_vert__() to use a threshold when identifying duplicate nodes to ensure consistent behavior.
Activity