gi.validate.check_brgi_database

gi.validate.check_brgi_database(brgi_db)

Validates the structure and relationships of a ‘Bedrock Ground Investigation’ (BRGI) database (which is a dictionary of DataFrames).

This function checks that all tables in the BRGI database conform to their respective schemas and that all foreign key relationships are properly maintained. It validates the following tables: - Project - Location - Sample - InSitu_TESTX - Lab_TESTY (not yet implemented)

Parameters

Name Type Description Default
brgi_db Dict[str, Union[pd.DataFrame, gpd.GeoDataFrame]] A dictionary containing the BRGI database tables, where keys are table names and values are the corresponding data tables (DataFrame or GeoDataFrame). required

Returns

Name Type Description
bool True if all tables are valid and relationships are properly maintained.

Example

brgi_db = {
    "Project": project_df,
    "Location": location_gdf,
    "Sample": sample_gdf,
    "InSitu_ISPT": in_situ_ispt_gdf,
}
check_brgi_database(brgi_db)