def atest_residual_sampling(self): self.set_positions_resampling_set() setNpRandomSeed() indices = [0,0,3,3,1,4] solutions = self.resample(indices) dautils.residualSampling(self.resamplingDrifterSet, self.resamplingVar) assert2DListAlmostEqual(self, self.resamplingDrifterSet.getDrifterPositions().tolist(), solutions, 2, "residual sampling, probabilistic duplicates")
def atest_residual_sampling(self): self.set_positions_resampling_set() setNpRandomSeed() indices = [0,0,3,3,1,4] solutions = self.resample(indices) dautils.residualSampling(self.resamplingDrifterSet, self.resamplingVar) assert2DListAlmostEqual(self, self.resamplingDrifterSet.getDrifterPositions().tolist(), solutions, 2, "residual sampling, probabilistic duplicates")
def atest_residual_sampling_with_duplicates(self): self.set_positions_resampling_set() setNpRandomSeed() indices = [0, 0, 3, 3, 1, 4] solutions = self.resample(indices) dautils.residualSampling(self.resamplingDrifterSet) self.assertEqual(self.resamplingDrifterSet.getDrifterPositions().tolist(), \ solutions)
def atest_residual_sampling_with_duplicates(self): self.set_positions_resampling_set() setNpRandomSeed() indices = [0,0,3,3,1,4] solutions = self.resample(indices) dautils.residualSampling(self.resamplingDrifterSet) self.assertEqual(self.resamplingDrifterSet.getDrifterPositions().tolist(), \ solutions)