Skip to content

Commit f2c0526

Browse files
authored
Remove deprecated function from plot_wing (#409)
* Fix deprecated CaseReader call * Fixed deprecated call in plot_wingbox
1 parent dcdb76b commit f2c0526

4 files changed

Lines changed: 17 additions & 234 deletions

File tree

openaerostruct/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "2.6.0"
1+
__version__ = "2.6.1"

openaerostruct/examples/run_aerostruct_uCRM_multipoint.py

Lines changed: 6 additions & 225 deletions
Original file line numberDiff line numberDiff line change
@@ -34,231 +34,12 @@
3434
# We use the coordinates available from airfoiltools.com. Using such a large number of coordinates is not necessary.
3535
# The first and last x-coordinates of the upper and lower surfaces must be the same
3636

37-
upper_x = np.array(
38-
[
39-
0.1,
40-
0.11,
41-
0.12,
42-
0.13,
43-
0.14,
44-
0.15,
45-
0.16,
46-
0.17,
47-
0.18,
48-
0.19,
49-
0.2,
50-
0.21,
51-
0.22,
52-
0.23,
53-
0.24,
54-
0.25,
55-
0.26,
56-
0.27,
57-
0.28,
58-
0.29,
59-
0.3,
60-
0.31,
61-
0.32,
62-
0.33,
63-
0.34,
64-
0.35,
65-
0.36,
66-
0.37,
67-
0.38,
68-
0.39,
69-
0.4,
70-
0.41,
71-
0.42,
72-
0.43,
73-
0.44,
74-
0.45,
75-
0.46,
76-
0.47,
77-
0.48,
78-
0.49,
79-
0.5,
80-
0.51,
81-
0.52,
82-
0.53,
83-
0.54,
84-
0.55,
85-
0.56,
86-
0.57,
87-
0.58,
88-
0.59,
89-
0.6,
90-
],
91-
dtype="complex128",
92-
)
93-
lower_x = np.array(
94-
[
95-
0.1,
96-
0.11,
97-
0.12,
98-
0.13,
99-
0.14,
100-
0.15,
101-
0.16,
102-
0.17,
103-
0.18,
104-
0.19,
105-
0.2,
106-
0.21,
107-
0.22,
108-
0.23,
109-
0.24,
110-
0.25,
111-
0.26,
112-
0.27,
113-
0.28,
114-
0.29,
115-
0.3,
116-
0.31,
117-
0.32,
118-
0.33,
119-
0.34,
120-
0.35,
121-
0.36,
122-
0.37,
123-
0.38,
124-
0.39,
125-
0.4,
126-
0.41,
127-
0.42,
128-
0.43,
129-
0.44,
130-
0.45,
131-
0.46,
132-
0.47,
133-
0.48,
134-
0.49,
135-
0.5,
136-
0.51,
137-
0.52,
138-
0.53,
139-
0.54,
140-
0.55,
141-
0.56,
142-
0.57,
143-
0.58,
144-
0.59,
145-
0.6,
146-
],
147-
dtype="complex128",
148-
)
149-
upper_y = np.array(
150-
[
151-
0.0447,
152-
0.046,
153-
0.0472,
154-
0.0484,
155-
0.0495,
156-
0.0505,
157-
0.0514,
158-
0.0523,
159-
0.0531,
160-
0.0538,
161-
0.0545,
162-
0.0551,
163-
0.0557,
164-
0.0563,
165-
0.0568,
166-
0.0573,
167-
0.0577,
168-
0.0581,
169-
0.0585,
170-
0.0588,
171-
0.0591,
172-
0.0593,
173-
0.0595,
174-
0.0597,
175-
0.0599,
176-
0.06,
177-
0.0601,
178-
0.0602,
179-
0.0602,
180-
0.0602,
181-
0.0602,
182-
0.0602,
183-
0.0601,
184-
0.06,
185-
0.0599,
186-
0.0598,
187-
0.0596,
188-
0.0594,
189-
0.0592,
190-
0.0589,
191-
0.0586,
192-
0.0583,
193-
0.058,
194-
0.0576,
195-
0.0572,
196-
0.0568,
197-
0.0563,
198-
0.0558,
199-
0.0553,
200-
0.0547,
201-
0.0541,
202-
],
203-
dtype="complex128",
204-
)
205-
lower_y = np.array(
206-
[
207-
-0.0447,
208-
-0.046,
209-
-0.0473,
210-
-0.0485,
211-
-0.0496,
212-
-0.0506,
213-
-0.0515,
214-
-0.0524,
215-
-0.0532,
216-
-0.054,
217-
-0.0547,
218-
-0.0554,
219-
-0.056,
220-
-0.0565,
221-
-0.057,
222-
-0.0575,
223-
-0.0579,
224-
-0.0583,
225-
-0.0586,
226-
-0.0589,
227-
-0.0592,
228-
-0.0594,
229-
-0.0595,
230-
-0.0596,
231-
-0.0597,
232-
-0.0598,
233-
-0.0598,
234-
-0.0598,
235-
-0.0598,
236-
-0.0597,
237-
-0.0596,
238-
-0.0594,
239-
-0.0592,
240-
-0.0589,
241-
-0.0586,
242-
-0.0582,
243-
-0.0578,
244-
-0.0573,
245-
-0.0567,
246-
-0.0561,
247-
-0.0554,
248-
-0.0546,
249-
-0.0538,
250-
-0.0529,
251-
-0.0519,
252-
-0.0509,
253-
-0.0497,
254-
-0.0485,
255-
-0.0472,
256-
-0.0458,
257-
-0.0444,
258-
],
259-
dtype="complex128",
260-
)
261-
37+
# fmt: off
38+
upper_x = np.array([0.1, 0.11, 0.12, 0.13, 0.14, 0.15, 0.16, 0.17, 0.18, 0.19, 0.2, 0.21, 0.22, 0.23, 0.24, 0.25, 0.26, 0.27, 0.28, 0.29, 0.3, 0.31, 0.32, 0.33, 0.34, 0.35, 0.36, 0.37, 0.38, 0.39, 0.4, 0.41, 0.42, 0.43, 0.44, 0.45, 0.46, 0.47, 0.48, 0.49, 0.5, 0.51, 0.52, 0.53, 0.54, 0.55, 0.56, 0.57, 0.58, 0.59, 0.6], dtype="complex128")
39+
lower_x = np.array([0.1, 0.11, 0.12, 0.13, 0.14, 0.15, 0.16, 0.17, 0.18, 0.19, 0.2, 0.21, 0.22, 0.23, 0.24, 0.25, 0.26, 0.27, 0.28, 0.29, 0.3, 0.31, 0.32, 0.33, 0.34, 0.35, 0.36, 0.37, 0.38, 0.39, 0.4, 0.41, 0.42, 0.43, 0.44, 0.45, 0.46, 0.47, 0.48, 0.49, 0.5, 0.51, 0.52, 0.53, 0.54, 0.55, 0.56, 0.57, 0.58, 0.59, 0.6], dtype="complex128")
40+
upper_y = np.array([0.0447, 0.046, 0.0472, 0.0484, 0.0495, 0.0505, 0.0514, 0.0523, 0.0531, 0.0538, 0.0545, 0.0551, 0.0557, 0.0563, 0.0568, 0.0573, 0.0577, 0.0581, 0.0585, 0.0588, 0.0591, 0.0593, 0.0595, 0.0597, 0.0599, 0.06, 0.0601, 0.0602, 0.0602, 0.0602, 0.0602, 0.0602, 0.0601, 0.06, 0.0599, 0.0598, 0.0596, 0.0594, 0.0592, 0.0589, 0.0586, 0.0583, 0.058, 0.0576, 0.0572, 0.0568, 0.0563, 0.0558, 0.0553, 0.0547, 0.0541], dtype="complex128")
41+
lower_y = np.array([-0.0447, -0.046, -0.0473, -0.0485, -0.0496, -0.0506, -0.0515, -0.0524, -0.0532, -0.054, -0.0547, -0.0554, -0.056, -0.0565, -0.057, -0.0575, -0.0579, -0.0583, -0.0586, -0.0589, -0.0592, -0.0594, -0.0595, -0.0596, -0.0597, -0.0598, -0.0598, -0.0598, -0.0598, -0.0597, -0.0596, -0.0594, -0.0592, -0.0589, -0.0586, -0.0582, -0.0578, -0.0573, -0.0567, -0.0561, -0.0554, -0.0546, -0.0538, -0.0529, -0.0519, -0.0509, -0.0497, -0.0485, -0.0472, -0.0458, -0.0444], dtype="complex128")
42+
# fmt: on
26243

26344
# Create a dictionary to store options about the surface
26445
mesh_dict = {

openaerostruct/utils/plot_wing.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,10 @@ def load_db(self):
8282
names = []
8383

8484
# Aero or aerostructural
85-
for key in cr.system_options.keys():
85+
sys_options = cr.list_model_options(out_stream=None)
86+
for key in sys_options.keys():
8687
try:
87-
surfaces = cr.system_options[key]["component_options"]["surfaces"]
88+
surfaces = sys_options[key]["surfaces"]
8889
for surface in surfaces:
8990
names.append(surface["name"])
9091
break
@@ -93,9 +94,9 @@ def load_db(self):
9394

9495
# Structural-only
9596
if not names:
96-
for key in cr.system_options.keys():
97+
for key in sys_options.keys():
9798
try:
98-
surface = cr.system_options[key]["component_options"]["surface"]
99+
surface = sys_options[key]["surface"]
99100
names = [surface["name"]]
100101
except KeyError:
101102
pass
@@ -239,7 +240,7 @@ def load_db(self):
239240

240241
if self.show_tube:
241242
for name in names:
242-
surface = cr.system_options[name]["component_options"]["surface"]
243+
surface = sys_options[name]["surface"]
243244
self.yield_stress_dict[name + "_yield_stress"] = surface["yield"]
244245
self.fem_origin_dict[name + "_fem_origin"] = surface["fem_origin"]
245246

openaerostruct/utils/plot_wingbox.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,10 @@ def load_db(self):
8383
last_case = next(reversed(cr.get_cases("driver")))
8484

8585
names = []
86-
for key in cr.system_options.keys():
86+
sys_options = cr.list_model_options(out_stream=None)
87+
for key in sys_options.keys():
8788
try:
88-
surfaces = cr.system_options[key]["component_options"]["surfaces"]
89+
surfaces = sys_options[key]["surfaces"]
8990
for surface in surfaces:
9091
names.append(surface["name"])
9192
break
@@ -268,7 +269,7 @@ def load_db(self):
268269

269270
if self.show_tube:
270271
for name in names:
271-
surface = cr.system_options[name]["component_options"]["surface"]
272+
surface = sys_options[name]["surface"]
272273
self.yield_stress_dict[name + "_yield_stress"] = surface["yield"]
273274

274275
# self.fem_origin_dict[name + '_fem_origin'] = surface['fem_origin']

0 commit comments

Comments
 (0)