From b735b96c5f98d0be50b0909a53e4a9c0e214ac7e Mon Sep 17 00:00:00 2001 From: Andrew Simms Date: Fri, 31 Jan 2025 06:37:26 -0700 Subject: [PATCH] Fix: Unnecessary accessor on scalar --- mhkit_python_utils/type_conversion.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mhkit_python_utils/type_conversion.py b/mhkit_python_utils/type_conversion.py index 3a6b1869..a3c1582c 100644 --- a/mhkit_python_utils/type_conversion.py +++ b/mhkit_python_utils/type_conversion.py @@ -178,6 +178,7 @@ def convert_series(data: pd.Series) -> ConversionResult: values = np.array(data.values) series_name = data.name + this_type = get_numeric_type(values[0]) # Handle single value series if values.size == 1: @@ -186,13 +187,14 @@ def convert_series(data: pd.Series) -> ConversionResult: if isinstance(values[0], (float, np.floating)) else int(values[0]) ) + this_type = get_numeric_type(values) # Always include index information index_name = data.index.name if data.index.name is not None else "index" index_data = convert_index(data.index) return ConversionResult( - type=f"array_{get_numeric_type(values[0])}", + type=f"array_{this_type}", data={series_name: values}, index={ "name": index_name,