Skip to content

Commit 898cf61

Browse files
authored
Fix Line.__init__ for Python 3.7 with numpy 1.21.6 (#810)
* Translate coordinates to numpy array of type np.number in Line.init when not a DPF Field * Translate coordinates to numpy array of type np.number in Line.init when not a DPF Field
1 parent 9447973 commit 898cf61

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/ansys/dpf/core/geometry.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ class Line:
126126
def __init__(self, coordinates, n_points=100, server=None):
127127
"""Initialize line object from two 3D points and discretize."""
128128
if not isinstance(coordinates, Field):
129+
coordinates = np.asarray(coordinates, dtype=np.number)
129130
coordinates = field_from_array(coordinates)
130131
if not len(coordinates.data) == 2:
131132
raise ValueError("Only two points must be introduced to define a line")

0 commit comments

Comments
 (0)