DatabaseManager

Database management

Class which represents all common features in DMT that are used to search, organize and filter data. Features:

  • Can read all relevant file formats produced by simulators used at CEDIC.

  • Uses pandas to manage the data internally.

  • Allows to “search” and “filter” existing data.

class DMT.core.database_manager.DatabaseManager(*args, **kwargs)[source]

Bases: object

Class responsible for data management in DMT.

Methods

load_db(db_dir):

Load a full db from the given path.

save_db(db_dir, data):

Save a full db to the given path.

del_db(db_dir)

Delete the hole database.

save_df(df, file_name):

Save a dataframe as file_name, where file_name is the direct path to the desired file.

load_df(file_name):

Loads a DMT dataframe from the file.

del_db(db_dir)[source]

Delete the database file for a dut.

Parameters:
db_dirstr or os.Pathlike

Full path to the database.

load_db(db_dir)[source]

Loads all DMT.DataFrames from the database at db_dir using implicit casting.

Parameters:
db_dirstr or os.Pathlike

Path to the database that shall be used to load df.

Returns:
data{key: DataFrame}

Loaded dataframes

Raises:
load_df(file_name: str | PathLike, to_specifier=True)[source]

Load the data stored in file_name, where file_name is the direct path to the file.

Parameters:
file_namestr

Direct path to the file

to_specifierbool

If True, the column names are cast to specifiers. Only neeeded for feather files. Default is True.

Returns:
dfDMT.core.DataFrame

Loaded dataframe object.

save_db(db_dir, data)[source]

Save the complete data into the database of dut. The old database is overwritten!

Parameters:
db_dirstr or os.Pathlike

Path to the database that shall be used to save the data.

data{key: DataFrame}

Dataframes to save

save_df(df: DataFrame | DataFrame, file_name: str | PathLike, version=2, compression='lz4', **kwargs)[source]

Save the data stored in df as file_name, where file_name is the direct path to the file.

Parameters:
dfDMT.core.DataFrame

A dataframe object that shall be saved.

file_namestr or os.Pathlike

Direct path to the file