Skip to content

Commit

Permalink
Updating omdao_raft.py to new Numpy version
Browse files Browse the repository at this point in the history
Numpy doesn't like `if s_ring:` anymore. Replaced by `if np.any(s_ring)`
  • Loading branch information
lucas-carmo committed Dec 27, 2024
1 parent cb115de commit c3e9df7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions raft/omdao_raft.py
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ def compute(self, inputs, outputs, discrete_inputs, discrete_outputs):
ring_spacing = inputs[m_name+'ring_spacing']
n_stiff = 0 if ring_spacing == 0.0 else int(np.floor(s_height / ring_spacing))
s_ring = (np.arange(1, n_stiff + 0.1) - 0.5) * (ring_spacing / s_height)
if s_ring:
if np.any(s_ring):
if not m_shape == 'rect':
d_ring = np.interp(s_ring, s_grid, design['platform']['members'][i]['d'])
else:
Expand All @@ -623,7 +623,7 @@ def compute(self, inputs, outputs, discrete_inputs, discrete_outputs):
t_cap = t_cap[:-1]
di_cap = di_cap[:-1]
# Combine with ring stiffeners
if s_ring:
if np.any(s_ring):
s_cap = np.r_[s_ring, s_cap]
t_cap = np.r_[inputs[m_name+'ring_t']*np.ones(n_stiff), t_cap]
di_cap = np.r_[d_ring-2*inputs[m_name+'ring_h'], di_cap]
Expand Down

0 comments on commit c3e9df7

Please sign in to comment.