def testWrite(self): dcd = DCDFile(self.dcd, 'w') dcd.write(ENSEMBLE.getCoordsets()) dcd.close() e = parseDCD(self.dcd) assert_allclose(e._getCoordsets(), ENSEMBLE._getCoordsets(), rtol=RTOL, atol=ATOL, err_msg='failed to parse DCD file correctly')
def testWriteModeAppend(self): dcd = DCDFile(writeDCD(self.dcd, ENSEMBLE), 'a') dcd.write(ENSEMBLE.getCoordsets()) dcd.close() e = parseDCD(self.dcd) n_csets = len(ENSEMBLE) coordsets = e._getCoordsets() assert_equal(coordsets, coordsets, 'failed to parse DCD file correctly') assert_allclose(coordsets[:n_csets], ENSEMBLE._getCoordsets(), rtol=RTOL, atol=ATOL, err_msg='failed to parse DCD file correctly')