Skip to content

Commit 2cd9748

Browse files
committed
(BUGFIX) structuralframe.evaluate_value returns array
previously returned a tuple of arrays.
1 parent d01bc00 commit 2cd9748

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

LoopStructural/modelling/features/structural_frame.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Structural frames
33
"""
44
import logging
5-
5+
import numpy as np
66
logger = logging.getLogger(__name__)
77

88

@@ -86,7 +86,7 @@ def set_data(self, data):
8686
"""
8787
self.data = data
8888

89-
def evaluate_value(self, evaluation_points, i=None):
89+
def evaluate_value(self, evaluation_points):
9090
"""
9191
Evaluate the value of the structural frame for the points.
9292
Can optionally only evaluate one coordinate
@@ -100,11 +100,15 @@ def evaluate_value(self, evaluation_points, i=None):
100100
-------
101101
102102
"""
103-
if i is not None:
104-
self.features[i].support.evaluate_value(evaluation_points)
105-
return (self.features[0].support.evaluate_value(evaluation_points),
106-
self.features[1].support.evaluate_value(evaluation_points),
107-
self.features[2].support.evaluate_value(evaluation_points))
103+
v = np.zeros(evaluation_points.shape) #create new 3d array of correct length
104+
v[:] = np.nan
105+
v[:,0] = self.features[0].evaluate_value(evaluation_points)
106+
v[:,1] = self.features[1].evaluate_value(evaluation_points)
107+
v[:,2] = self.features[2].evaluate_value(evaluation_points)
108+
return v
109+
# return (self.features[0].evaluate_value(evaluation_points),
110+
# self.features[1].evaluate_value(evaluation_points),
111+
# self.features[2].evaluate_value(evaluation_points))
108112

109113
def evaluate_gradient(self, evaluation_points, i=None):
110114
"""

0 commit comments

Comments
 (0)