MCPcopy Create free account
hub / github.com/OpenMS/OpenMS / testFloatDataArray

Function testFloatDataArray

src/pyOpenMS/tests/unittests/test000.py:3301–3327  ·  view source on GitHub ↗

@tests: FloatDataArray

()

Source from the content-addressed store, hash-verified

3299
3300@report
3301def testFloatDataArray():
3302 """
3303 @tests: FloatDataArray
3304 """
3305 da = pyopenms.FloatDataArray()
3306 assert da.size() == 0
3307 da.push_back(1.0)
3308 da.push_back(4.0)
3309 assert da.size() == 2
3310 assert da[0] == 1.0
3311 assert da[1] == 4.0
3312 da[1] = 7.0
3313 assert da[1] == 7.0
3314 da.clear()
3315 assert da.size() == 0
3316 da.push_back(1.0)
3317 assert da.size() == 1
3318 da.resize(3)
3319 da[0] = 1.0
3320 da[1] = 2.0
3321 da[2] = 3.0
3322 assert da.size() == 3
3323
3324 q = da.get_data()
3325 q = np.append(q, 4.0).astype(np.float32)
3326 da.set_data(q)
3327 assert da.size() == 4
3328
3329@report
3330def testMSChromatogram():

Callers

nothing calls this directly

Calls 5

sizeMethod · 0.45
push_backMethod · 0.45
clearMethod · 0.45
resizeMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected