gcubed.data.database_comparator

class DatabaseComparator(gcubed.base.Base):

A class to compare two databases and identify differences.

DatabaseComparator( model_a_configuration: gcubed.model_configuration.ModelConfiguration, model_b_configuration: gcubed.model_configuration.ModelConfiguration)

Overview

This class is designed to compare the databases from two G-Cubed models and document the differences between them.

Initialize the DatabaseComparator with two G-Cubed models.

Arguments

Get the first model configuration.

Get the second model configuration.

variables_in_a_not_b: pandas.Index

Get the variables in model a but not in model b.

:return: The variables in model a but not in model b.

variables_in_b_not_a: pandas.Index

Get the variables in model b but not in model a.

:return: The variables in model b but not in model a.

variables_with_different_values: pandas.Index

Get the variables in both models that are not close in value.

Return

The variables in both models that are not close in value.

data_a: pandas.DataFrame

Get the data for model a.

data_b: pandas.DataFrame

Get the data for model b.

def save_comparison_results(self, output_directory_path: pathlib.Path):

Save the comparison results to CSV files.

Arguments

  • output_directory: The directory to save the CSV files.