class documentation

Undocumented

Class Method get_database_name Get database name for given path
Class Method identify Identify the given benchmark by its GBD hash
Method __enter__ Undocumented
Method __exit__ Undocumented
Method __init__ Undocumented
Method copy_feature Copies feature with given name
Method create_feature Creates feature with given name
Method delete_feature Deletes feature with given name
Method delete_hashes Delete all values for given hashes
Method feature_exists Check if feature exists in the database.
Method get_contexts Get list of contexts
Method get_database_path Get path for given database name
Method get_databases Get list of database names
Method get_feature_info Retrieve information about a specific feature
Method get_features Get features from the database.
Method query Query the database
Method rename_feature Renames feature with given name
Method reset_values Reset feature value for given hashes
Method set_values Set feature value for given hashes
Instance Variable database Undocumented
Instance Variable verbose Undocumented
Instance Variable _stack Undocumented
@classmethod
def get_database_name(self, path): (source)

Get database name for given path

Args: path (str): path to database

Returns: name of database

@classmethod
def identify(cls, path): (source)

Identify the given benchmark by its GBD hash

Args: path (str): path to benchmark

Returns: str: GBD hash

def __enter__(self): (source)

Undocumented

def __exit__(self, exc_type, exc, traceback): (source)

Undocumented

def __init__(self, dbs: list, verbose: bool = False): (source)

Undocumented

def copy_feature(self, old_name, new_name, target_db=None, gbd_query=None, hashes=[]): (source)

Copies feature with given name

Args: old_name (str): old feature name new_name (str): new feature name target_db (str): name of database to copy feature to if None, default database (fist in list) is used

Returns: None

def create_feature(self, name: str, default_value: str = None, target_db: str = None): (source)

Creates feature with given name

Args: name (str): feature name default_value (str): default value for 1:1 features if None, a multi-valued (1:n) feature is created target_db (str): database name if None, default database (fist in list) is used

Returns: None

Raises: GBDException, if feature already exists in target_db

def delete_feature(self, name, target_db=None): (source)

Deletes feature with given name

Args: name (str): feature name target_db (str): database name if None, default database (fist in list) is used

Returns: None

Raises: GBDException, if feature does not exist in target_db

def delete_hashes(self, hashes, target_db=None): (source)

Delete all values for given hashes

Args: hashes (list): list of hashes (=benchmark ids) to be deleted target_db (str, optional): name of target database if None, default database (first in list) is used

Raises: GBDException, if feature does not exist

def feature_exists(self, name, dbname=None): (source)

Check if feature exists in the database.

Args: name (str): name of feature dbname (str): name of feature database if None, feature existence is checked for in all databases

Returns: True if feature exists in dbname or any database, False otherwise

def get_contexts(self, dbs=[]): (source)

Get list of contexts

Returns: list of contexts

def get_database_path(self, dbname): (source)

Get path for given database name

Args: dbname (str): name of database

Returns: path to database

def get_databases(self, context=None): (source)

Get list of database names

Returns: list of database names

def get_feature_info(self, fname): (source)

Retrieve information about a specific feature

def get_features(self, dbname: str = None): (source)

Get features from the database.

Args: dbname (str): name of feature database if None, feature list is accumulated over all databases

Returns: list of features names

def query(self, gbd_query=None, hashes=[], resolve=[], collapse='group_concat', group_by=None, join_type='LEFT'): (source)

Query the database

Args: gbd_query (str): GBD query string hashes (list): list of hashes (=benchmark ids), the query is restricted to resolve (list): list of features to be resolved collapse (str): collapse function: min, max, avg, count, sum, group_concat, or none group_by (str): group results by that feature instead of hash (default) join_type (str): join type: left or inner

Returns: pandas.DataFrame: query result

def rename_feature(self, old_name, new_name, target_db=None): (source)

Renames feature with given name

Args: old_name (str): old feature name new_name (str): new feature name target_db (str): database name if None, default database (fist in list) is used

Returns: None

Raises: GBDException, - if feature 'old_name' does not exist in target_db - if feature 'new_name' already exists in target_db

def reset_values(self, feature, values=[], hashes=[], target_db=None): (source)

Reset feature value for given hashes

Args: feature (str): feature name values (list, optional): list of values to be reset hashes (list, optional): list of hashes (=benchmark ids) to be reset target_db (str, optional): name of target database if None, default database (first in list) is used

Raises: GBDException, if feature does not exist

def set_values(self, name, value, hashes, target_db=None): (source)

Set feature value for given hashes

Args: name (str): feature name value (str): value to be set hashes (list): list of hashes (=benchmark ids) target_db (str, optional): name of target database if None, default database (first in list) is used Raises: GBDException, if feature does not exist

database = (source)

Undocumented

Undocumented

Undocumented