def test_create(self): key = "OBS" ens_size = 100 obs_size = 77 ens_mask = BoolVector(default_value=True, initial_size=ens_size) ens_mask[67] = False block = MeasBlock(key, obs_size, ens_mask) self.assertEqual(block.getObsSize(), obs_size) self.assertEqual(block.getActiveEnsSize(), ens_size - 1) self.assertEqual(block.getTotalEnsSize(), ens_size) self.assertTrue(block.iensActive(66)) self.assertFalse(block.iensActive(67))
def test_create(self): key = "OBS" ens_size = 100 obs_size = 77 ens_mask = BoolVector( default_value = True , initial_size = ens_size ) ens_mask[67] = False block = MeasBlock( key , obs_size , ens_mask) self.assertEqual( block.getObsSize() , obs_size ) self.assertEqual( block.getActiveEnsSize() , ens_size - 1) self.assertEqual( block.getTotalEnsSize() , ens_size ) self.assertTrue( block.iensActive( 66 ) ) self.assertFalse( block.iensActive( 67 ) )
def test_inactive(self): key = "OBS" obs_size = 2 ens_size = 10 ens_mask = BoolVector( default_value = True , initial_size = ens_size ) ens_mask[5] = False block = MeasBlock( key , obs_size , ens_mask) self.assertFalse( block.iensActive( 5 )) with self.assertRaises(ValueError): block[0,5] = 10
def test_inactive(self): key = "OBS" obs_size = 2 ens_size = 10 ens_mask = BoolVector(default_value=True, initial_size=ens_size) ens_mask[5] = False block = MeasBlock(key, obs_size, ens_mask) self.assertFalse(block.iensActive(5)) with self.assertRaises(ValueError): block[0, 5] = 10