Skip to content

Commit 589c843

Browse files
committed
allow for schema override
1 parent e990696 commit 589c843

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

flasc/analysis/analysis_input.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ def __init__(
5353
df_list_in: List[pd.DataFrame | FlascDataFrame],
5454
df_names: List[str],
5555
num_blocks: int = 10,
56+
schema_overrides: dict = None,
5657
) -> None:
5758
"""Initialize the AnalysisInput class.
5859
@@ -62,10 +63,15 @@ def __init__(
6263
df_names (List[str]): A list of names for the dataframes
6364
num_blocks (int): The number of blocks to use for the energy ratio calculation.
6465
Defaults to 10.
66+
schema_overrides (dict): A dictionary of schema overrides to use when converting
67+
the dataframes to polars. Defaults to None.
6568
"""
6669
# Reduce precision if needed and convert to polars
6770
df_list = [
68-
pl.from_pandas(df_reduce_precision(df, allow_convert_to_integer=False))
71+
pl.from_pandas(
72+
df_reduce_precision(df, allow_convert_to_integer=False),
73+
schema_overrides=schema_overrides,
74+
)
6975
for df in df_list_in
7076
]
7177

0 commit comments

Comments
 (0)