Skip to content

Commit b3ed552

Browse files
committed
[#116] Added unit tests
1 parent 3bca5b8 commit b3ed552

File tree

2 files changed

+122
-59
lines changed

2 files changed

+122
-59
lines changed

bsplines2d/tests/test_01_Mesh2D.py

Lines changed: 69 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -93,214 +93,224 @@ def test01_mesh1d_from_knots_uniform(self):
9393
def test02_mesh1d_from_knots_variable(self):
9494
test_input._add_1d_knots_variable(self.bs)
9595

96+
def test03_mesh1d_from_knots_angle(self):
97+
test_input._add_1d_knots_angle(self.bs)
98+
9699
# ##############
97100
# mesh 2d rect
98101
# ##############
99102

100-
def test03_add_mesh_rect_uniform(self):
103+
def test04_add_mesh_rect_uniform(self):
101104
test_input._add_rect_uniform(self.bs)
102105

103-
def test04_add_mesh_rect_variable(self):
106+
def test05_add_mesh_rect_variable(self):
104107
test_input._add_rect_variable(self.bs)
105108

106-
def test05_add_mesh_rect_variable_crop(self):
109+
def test06_add_mesh_rect_variable_crop(self):
107110
test_input._add_rect_variable_crop(self.bs)
108111

109-
def test06_add_mesh_rect_crop_from_knots(self):
112+
def test07_add_mesh_rect_crop_from_knots(self):
110113
test_input._add_rect_crop_from_knots(self.bs)
111114

112-
def test07_add_mesh_rect_variable_crop_from_knots(self):
115+
def test08_add_mesh_rect_variable_crop_from_knots(self):
113116
test_input._add_rect_variable_crop_from_knots(self.bs)
114117

115118
# ##############
116119
# mesh 2d tri
117120
# ##############
118121

119-
def test08_add_mesh_tri_ntri1(self):
122+
def test09_add_mesh_tri_ntri1(self):
120123
test_input._add_tri_ntri1(self.bs)
121124

122-
def test09_add_mesh_tri_ntri2(self):
125+
def test10_add_mesh_tri_ntri2(self):
123126
test_input._add_tri_ntri2(self.bs)
124127

125-
def test10_add_mesh_tri_delaunay(self):
128+
def test11_add_mesh_tri_delaunay(self):
126129
test_input._add_tri_delaunay(self.bs)
127130

131+
# ##############
132+
# mesh 3d cyl
133+
# ##############
134+
135+
def test12_add_mesh_3d_cyl(self):
136+
test_input._add_3d_cyl(self.bs)
137+
128138
# ##############
129139
# select
130140
# ##############
131141

132-
def test11_select_mesh_element_1d(self):
142+
def test13_select_mesh_element_1d(self):
133143
test_input._select_mesh_elements(self.bs, nd='1d', kind=None)
134144

135-
def test12_select_mesh_element_rect(self):
145+
def test14_select_mesh_element_rect(self):
136146
test_input._select_mesh_elements(self.bs, nd='2d', kind='rect')
137147

138-
def test13_select_mesh_element_tri(self):
148+
def test15_select_mesh_element_tri(self):
139149
test_input._select_mesh_elements(self.bs, nd='2d', kind='tri')
140150

141151
# ##############
142152
# mesh outline
143153
# ##############
144154

145-
def test14_get_mesh_outline_rect(self):
155+
def test16_get_mesh_outline_rect(self):
146156
test_input._get_mesh_outline_rect(self.bs)
147157

148-
def test15_get_mesh_outline_tri(self):
158+
def test17_get_mesh_outline_tri(self):
149159
test_input._get_mesh_outline_tri(self.bs)
150160

151161
# ##############
152162
# sample
153163
# ##############
154164

155-
def test16_sample_mesh_1d(self):
165+
def test18_sample_mesh_1d(self):
156166
test_input._sample_mesh(self.bs, nd='1d', kind=None)
157167

158-
def test17_sample_mesh_rect(self):
168+
def test19_sample_mesh_rect(self):
159169
test_input._sample_mesh(self.bs, nd='2d', kind='rect')
160170

161-
def test18_sample_mesh_tri(self):
171+
def test20_sample_mesh_tri(self):
162172
test_input._sample_mesh(self.bs, nd='2d', kind='tri')
163173

164174
# ##############
165175
# plot
166176
# ##############
167177

168-
def test19_plot_mesh_1d(self):
178+
def test21_plot_mesh_1d(self):
169179
test_input._plot_mesh(self.bs, nd='1d', kind=None)
170180

171-
def test20_plot_mesh_rect(self):
181+
def test22_plot_mesh_rect(self):
172182
test_input._plot_mesh(self.bs, nd='2d', kind='rect')
173183

174-
def test21_plot_mesh_tri(self):
184+
def test23_plot_mesh_tri(self):
175185
test_input._plot_mesh(self.bs, nd='2d', kind='tri')
176186

177187
# ##############
178188
# add bsplines
179189
# ##############
180190

181-
def test22_add_bsplines_1d(self):
191+
def test24_add_bsplines_1d(self):
182192
test_input._add_bsplines(self.bs, nd='1d')
183193

184-
def test23_add_bsplines_2d_rect(self):
194+
def test25_add_bsplines_2d_rect(self):
185195
test_input._add_bsplines(self.bs, kind='rect')
186196

187-
def test24_add_bsplines_2d_tri(self):
197+
def test26_add_bsplines_2d_tri(self):
188198
test_input._add_bsplines(self.bs, kind='tri')
189199

190200
# ##############
191201
# select bsplines
192202
# ##############
193203

194-
def test25_select_bsplines_1d(self):
204+
def test27_select_bsplines_1d(self):
195205
test_input._select_bsplines(self.bs, nd='1d', kind=None)
196206

197-
def test26_select_bsplines_2d_rect(self):
207+
def test28_select_bsplines_2d_rect(self):
198208
test_input._select_bsplines(self.bs, nd='2d', kind='rect')
199209

200-
def test27_select_bsplines_2d_tri(self):
210+
def test29_select_bsplines_2d_tri(self):
201211
test_input._select_bsplines(self.bs, nd='2d', kind='tri')
202212

203213
# ###############
204214
# add data vs bs
205215
# ###############
206216

207-
def test28_add_data_1bs_fix_1d(self, remove=True):
217+
def test30_add_data_1bs_fix_1d(self, remove=True):
208218
test_input._add_data_1bs_fix(self.bs, nd='1d', kind=None, remove=remove)
209219

210-
def test29_add_data_1bs_fix_2d_rect(self, remove=True):
220+
def test31_add_data_1bs_fix_2d_rect(self, remove=True):
211221
test_input._add_data_1bs_fix(self.bs, nd='2d', kind='rect', remove=remove)
212222

213-
def test30_add_data_1bs_fix_2d_tri(self, remove=True):
223+
def test32_add_data_1bs_fix_2d_tri(self, remove=True):
214224
test_input._add_data_1bs_fix(self.bs, nd='2d', kind='tri', remove=remove)
215225

216-
def test31_add_data_1bs_arrays_1d(self, remove=False):
226+
def test33_add_data_1bs_arrays_1d(self, remove=False):
217227
test_input._add_data_1bs_arrays(self.bs, nd='1d', kind=None, remove=remove)
218228

219-
def test32_add_data_1bs_arrays_2d_rect(self, remove=False):
229+
def test34_add_data_1bs_arrays_2d_rect(self, remove=False):
220230
test_input._add_data_1bs_arrays(self.bs, nd='2d', kind='rect', remove=remove)
221231

222-
def test33_add_data_1bs_arrays_2d_tri(self, remove=False):
232+
def test35_add_data_1bs_arrays_2d_tri(self, remove=False):
223233
test_input._add_data_1bs_arrays(self.bs, nd='2d', kind='tri', remove=remove)
224234

225-
def test34_add_data_multibs_arrays(self, remove=False):
235+
def test36_add_data_multibs_arrays(self, remove=False):
226236
test_input._add_data_multibs_arrays(self.bs, remove=remove)
227237

228238
# ##############
229239
# interp bs
230240
# ##############
231241

232-
def test35_interpolate_bsplines_1d(self):
242+
def test37_interpolate_bsplines_1d(self):
233243
test_input._interpolate(self.bs, nd='1d', kind=None, details=False)
234244

235-
def test36_interpolate_bsplines_1d_details(self):
245+
def test38_interpolate_bsplines_1d_details(self):
236246
test_input._interpolate(self.bs, nd='1d', kind=None, details=True)
237247

238-
def test37_interpolate_bsplines_2d_rect(self):
248+
def test39_interpolate_bsplines_2d_rect(self):
239249
test_input._interpolate(self.bs, nd='2d', kind='rect', details=False)
240250

241-
def test38_interpolate_bsplines_2d_rect_details(self):
251+
def test40_interpolate_bsplines_2d_rect_details(self):
242252
test_input._interpolate(self.bs, nd='2d', kind='rect', details=True)
243253

244-
def test39_interpolate_bsplines_2d_tri(self):
254+
def test41_interpolate_bsplines_2d_tri(self):
245255
test_input._interpolate(self.bs, nd='2d', kind='tri', details=False)
246256

247-
def test40_interpolate_bsplines_2d_tri_details(self):
257+
def test42_interpolate_bsplines_2d_tri_details(self):
248258
test_input._interpolate(self.bs, nd='2d', kind='tri', details=True)
249259

250260
# ##############
251261
# binning 1d
252262
# ##############
253263

254-
def test41_binning_1d(self):
264+
def test43_binning_1d(self):
255265
test_input._bin_bs(self.bs, nd='1d', kind=None)
256266

257267
# ##############
258268
# plot bsplines
259269
# ##############
260270

261-
def test42_plot_bsplines_1d(self):
271+
def test44_plot_bsplines_1d(self):
262272
pass
263273

264-
def test43_plot_bsplines_2d_rect(self):
274+
def test45_plot_bsplines_2d_rect(self):
265275
pass
266276

267-
def test44_plot_bsplines_2d_tri(self):
277+
def test46_plot_bsplines_2d_tri(self):
268278
pass
269279

270280
# ####################
271281
# add mesh with subkey
272282
# ####################
273283

274-
def test45_add_mesh_1d_subkey_1d(self):
284+
def test47_add_mesh_1d_subkey_1d(self):
275285
test_input._add_mesh_1d_subkey(self.bs, nd='1d', kind=None)
276286

277-
def test46_add_mesh_1d_subkey_rect(self):
287+
def test48_add_mesh_1d_subkey_rect(self):
278288
test_input._add_mesh_1d_subkey(self.bs, nd='2d', kind='rect')
279289

280-
def test47_add_mesh_1d_subkey_tri(self):
290+
def test49_add_mesh_1d_subkey_tri(self):
281291
test_input._add_mesh_1d_subkey(self.bs, nd='2d', kind='tri')
282292

283-
def test48_add_mesh_2d_rect_subkey_rect(self):
293+
def test50_add_mesh_2d_rect_subkey_rect(self):
284294
test_input._add_mesh_2d_rect_subkey(self.bs, nd='2d', kind='rect')
285295

286-
def test49_add_mesh_2d_rect_subkey_tri(self):
296+
def test51_add_mesh_2d_rect_subkey_tri(self):
287297
test_input._add_mesh_2d_rect_subkey(self.bs, nd='2d', kind='tri')
288298

289-
def test50_add_mesh_2d_rect_var_subkey_rect(self):
299+
def test52_add_mesh_2d_rect_var_subkey_rect(self):
290300
test_input._add_mesh_2d_rect_subkey(self.bs, nd='2d', kind='rect')
291301

292302
# ################################
293303
# add bsplines on mesh with subkey
294304
# ################################
295305

296-
def test51_add_bsplines_subkey(self):
306+
def test53_add_bsplines_subkey(self):
297307
test_input._add_bsplines(self.bs, subkey=True)
298308

299309
# ################################
300310
# add data on bsplines with subkey
301311
# ################################
302312

303-
def test52_add_data_subkey(self):
313+
def test54_add_data_subkey(self):
304314
test_input._add_data_multibs_arrays(
305315
self.bs,
306316
nd=None,
@@ -313,7 +323,7 @@ def test52_add_data_subkey(self):
313323
# interpolate data with subkey
314324
# ################################
315325

316-
def test53_interpolate_subkey_1d(self):
326+
def test55_interpolate_subkey_1d(self):
317327
test_input._interpolate(
318328
self.bs,
319329
nd='1d',
@@ -330,14 +340,14 @@ def test53_interpolate_subkey_1d(self):
330340
# interpolate data with subkey
331341
# ################################
332342

333-
def test54_plot_as_profile2d(self):
343+
def test56_plot_as_profile2d(self):
334344
test_input._plot_as_profile2d(
335345
self.bs,
336346
nd='2d',
337347
kind=None,
338348
)
339349

340-
def test55_plot_as_profile2d_compare(self):
350+
def test57_plot_as_profile2d_compare(self):
341351
test_input._plot_as_profile2d_compare(
342352
self.bs,
343353
nd='2d',
@@ -348,31 +358,31 @@ def test55_plot_as_profile2d_compare(self):
348358
# operators
349359
# ################################
350360

351-
def test56_operators_1d(self):
361+
def test58_operators_1d(self):
352362
test_input._get_operators(
353363
self.bs,
354364
nd='1d',
355365
kind=None,
356366
)
357367

358-
def test57_operators_2d_rect(self):
368+
def test59_operators_2d_rect(self):
359369
test_input._get_operators(
360370
self.bs,
361371
nd='2d',
362372
kind='rect',
363373
)
364374

365-
def test58_operators_2d_tri(self):
375+
def test60_operators_2d_tri(self):
366376
pass
367377

368-
def test59_operators_1d_subkey(self):
378+
def test61_operators_1d_subkey(self):
369379
pass
370380

371381
# ################################
372382
# saving / loading
373383
# ################################
374384

375-
def test60_saveload_equal(self):
385+
def test62_saveload_equal(self):
376386

377387
# save
378388
pfe = self.bs.save(return_pfe=True)
@@ -386,7 +396,7 @@ def test60_saveload_equal(self):
386396
# equal
387397
assert self.bs == out
388398

389-
def test61_saveload_coll(self):
399+
def test63_saveload_coll(self):
390400

391401
# save
392402
pfe = self.bs.save(return_pfe=True)

0 commit comments

Comments
 (0)