def __init__(self, categories=array([ 1, ]), resources=None, what=None, attribute_name=None, data=None, names=None, in_storage=None, out_storage=None, in_table_name=None, attributes=None, out_table_name=None, id_name=None, nchunks=None, debuglevel=0): """ 'what' must be a string, such as 'residential' or 'commercial'. """ debug = DebugPrinter(debuglevel) debug.print_debug( "Creating DevelopmentProjectDataset object for %s projects." % what, 2) self.categories = categories self.what = what self.attribute_name = attribute_name attributes_default = AttributeType.PRIMARY dataset_name = "development_project" nchunks_default = 1 if data <> None: in_storage = StorageFactory().get_storage('dict_storage') in_storage.write_table(table_name='development_projects', table_data=data) in_table_name = 'development_projects' resources = ResourceFactory().get_resources_for_dataset( dataset_name, resources=resources, in_storage=in_storage, out_storage=out_storage, in_table_name_pair=(in_table_name, None), out_table_name_pair=(out_table_name, None), attributes_pair=(attributes, attributes_default), id_name_pair=(id_name, self.id_name_default), nchunks_pair=(nchunks, nchunks_default), debug_pair=(debug, None)) self.category_variable_name = resources.get( "category_variable_name", self.category_variable_name_default) Dataset.__init__(self, resources=resources)
def __init__( self, categories=array([1]), resources=None, what=None, attribute_name=None, data=None, names=None, in_storage=None, out_storage=None, in_table_name=None, attributes=None, out_table_name=None, id_name=None, nchunks=None, debuglevel=0, ): """ 'what' must be a string, such as 'residential' or 'commercial'. """ debug = DebugPrinter(debuglevel) debug.print_debug("Creating DevelopmentProjectDataset object for %s projects." % what, 2) self.categories = categories self.what = what self.attribute_name = attribute_name attributes_default = AttributeType.PRIMARY dataset_name = "development_project" nchunks_default = 1 if data <> None: in_storage = StorageFactory().get_storage("dict_storage") in_storage.write_table(table_name="development_projects", table_data=data) in_table_name = "development_projects" resources = ResourceFactory().get_resources_for_dataset( dataset_name, resources=resources, in_storage=in_storage, out_storage=out_storage, in_table_name_pair=(in_table_name, None), out_table_name_pair=(out_table_name, None), attributes_pair=(attributes, attributes_default), id_name_pair=(id_name, self.id_name_default), nchunks_pair=(nchunks, nchunks_default), debug_pair=(debug, None), ) self.category_variable_name = resources.get("category_variable_name", self.category_variable_name_default) Dataset.__init__(self, resources=resources)