Commit 7b6fcddb authored by Mikkel Friis-Møller's avatar Mikkel Friis-Møller Committed by Mads M. Pedersen
Browse files


parent 36b1d6cc
Pipeline #8073 passed with stages
in 7 minutes and 7 seconds
......@@ -119,7 +119,15 @@ class SpacingComp(ConstraintComponent):
from matplotlib.pyplot import Circle
import matplotlib.pyplot as plt
ax = ax or plt.gca()
for x, y in zip(self.x, self.y):
if isinstance(self.x, tuple):
x_plot = self.x[0]
x_plot = self.x
if isinstance(self.y, tuple):
y_plot = self.y[0]
y_plot = self.y
for x, y in zip(x_plot, y_plot):
circle = Circle((x, y), self.min_spacing / 2, color='k', ls='--', fill=False)
......@@ -88,12 +88,10 @@ class XYPlotComp(NoPlot):
def setup(self):
if topfarm.x_key in self.problem.design_vars:
self.min_x, self.max_x = self.problem.design_vars[topfarm.x_key][1:-1]
units_x = self.problem.design_vars[topfarm.x_key][-1]
units_x = None
if topfarm.y_key in self.problem.design_vars:
self.min_y, self.max_y = self.problem.design_vars[topfarm.y_key][1:-1]
units_y = self.problem.design_vars[topfarm.y_key][-1]
units_y = None
......@@ -192,13 +190,15 @@ class XYPlotComp(NoPlot):
# find limits
if (topfarm.x_key in self.problem.design_vars and
isinstance(self.problem.design_vars[topfarm.x_key], tuple)):
min_x, max_x = self.min_x, self.max_x
isinstance(self.problem.design_vars[topfarm.x_key], tuple) and
len(self.problem.design_vars[topfarm.x_key]) == 4):
min_x, max_x = self.problem.design_vars[topfarm.x_key][1:-1]
min_x, max_x = min(inputs[topfarm.x_key]), max(inputs[topfarm.x_key])
if (topfarm.y_key in self.problem.design_vars and
isinstance(self.problem.design_vars[topfarm.y_key], tuple)):
min_y, max_y = self.min_y, self.max_y
isinstance(self.problem.design_vars[topfarm.y_key], tuple) and
len(self.problem.design_vars[topfarm.y_key]) == 4):
min_y, max_y = self.problem.design_vars[topfarm.y_key][1:-1]
min_y, max_y = min(inputs[topfarm.y_key]), max(inputs[topfarm.y_key])
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment