@@ -16,7 +16,8 @@ def write_gi_db_to_gpkg(
1616 separate table named by the keys of the dictionary.
1717
1818 Args:
19- brgi_db (dict): A dictionary where keys are brgi table names and values are DataFrames
19+ brgi_db (Dict[str, Union[pd.DataFrame, gpd.GeoDataFrame]]): A dictionary where
20+ keys are brgi table names and values are pandas DataFrames or GeoDataFrames
2021 with brgi data.
2122 gpkg_path (str): The name of the output GeoPackage file.
2223
@@ -39,7 +40,7 @@ def write_gi_db_to_gpkg(
3940
4041
4142def write_gi_db_to_excel (
42- gi_db : Dict [str , Union [pd .DataFrame , gpd .GeoDataFrame ]],
43+ gi_dfs : Dict [str , Union [pd .DataFrame , gpd .GeoDataFrame ]],
4344 excel_path : Union [str , Path ],
4445) -> None :
4546 """Writes a database with Ground Investigation data to an Excel file.
@@ -49,15 +50,17 @@ def write_gi_db_to_excel(
4950 AGS, Bedrock, or another format.
5051
5152 Args:
52- gi_dfs (dict): A dictionary where keys are GI table names and values are DataFrames with GI data.
53- excel_path (str): The name of the output Excel file.
53+ gi_dfs (Dict[str, Union[pd.DataFrame, gpd.GeoDataFrame]]): A dictionary where
54+ keys are GI table names and values are DataFrames with GI data.
55+ excel_path (Union[str, Path]): Path to the output Excel file. Can be provided as a
56+ string or Path object.
5457
5558 Returns:
5659 None
5760 """
5861 # Create an Excel writer object
5962 with pd .ExcelWriter (excel_path , engine = "openpyxl" ) as writer :
60- for sheet_name , df in gi_db .items ():
63+ for sheet_name , df in gi_dfs .items ():
6164 sanitized_sheet_name = sanitize_table_name (sheet_name )
6265 if isinstance (df , pd .DataFrame ) or isinstance (df , gpd .GeoDataFrame ):
6366 df .to_excel (writer , sheet_name = sanitized_sheet_name , index = False )
@@ -76,7 +79,7 @@ def sanitize_table_name(sheet_name):
7679 sheet_name (str): The original sheet name.
7780
7881 Returns:
79- sanitized_name: A sanitized sheet name with invalid characters and spaces replaced.
82+ sanitized_name (str) : A sanitized sheet name with invalid characters and spaces replaced.
8083 """
8184 # Trim to a maximum length of 31 characters
8285 trimmed_name = sheet_name .strip ()[:31 ]
0 commit comments