def LocalDataset( self, local_config ): # Creating dataset data_scale = local_config.createDataset("DATA_SCALE") self.assertTrue(isinstance(data_scale, LocalDataset)) # Try to add existing dataset with self.assertRaises(ValueError): local_config.createDataset("DATA_SCALE") with self.assertRaises(KeyError): data_scale.addNode("MISSING") data_scale.addNode("PERLIN_PARAM") active_list = data_scale.getActiveList("PERLIN_PARAM") self.assertTrue(isinstance(active_list, ActiveList)) active_list.addActiveIndex(0) self.assertTrue("PERLIN_PARAM" in data_scale) self.assertFalse("MISSING" in data_scale) ministep = local_config.createMinistep("MINISTEP") ministep.attachDataset( data_scale ) self.assertTrue( "DATA_SCALE" in ministep ) data_scale_get = ministep["DATA_SCALE"] self.assertTrue( "PERLIN_PARAM" in data_scale_get ) # Error when adding existing data node with self.assertRaises(KeyError): data_scale.addNode("PERLIN_PARAM")
def LocalDataset(self, local_config): # Creating dataset data_scale = local_config.createDataset("DATA_SCALE") self.assertTrue(isinstance(data_scale, LocalDataset)) # Try to add existing dataset with self.assertRaises(ValueError): local_config.createDataset("DATA_SCALE") with self.assertRaises(KeyError): data_scale.addNode("MISSING") data_scale.addNode("PERLIN_PARAM") active_list = data_scale.getActiveList("PERLIN_PARAM") self.assertTrue(isinstance(active_list, ActiveList)) active_list.addActiveIndex(0) self.assertTrue("PERLIN_PARAM" in data_scale) self.assertFalse("MISSING" in data_scale) ministep = local_config.createMinistep("MINISTEP") ministep.attachDataset(data_scale) self.assertTrue("DATA_SCALE" in ministep) data_scale_get = ministep["DATA_SCALE"] self.assertTrue("PERLIN_PARAM" in data_scale_get) # Error when adding existing data node with self.assertRaises(KeyError): data_scale.addNode("PERLIN_PARAM")
def LocalDataset( self, local_config ): # Data data_scale = local_config.createDataset("DATA_SCALE") with self.assertRaises(KeyError): data_scale.addNode("MISSING") data_scale.addNode("PERLIN_PARAM") active_list = data_scale.getActiveList("PERLIN_PARAM") self.assertTrue(isinstance(active_list, ActiveList)) active_list.addActiveIndex(0)