Skip to content

Commit

Permalink
Types: Convert array to np.array
Browse files Browse the repository at this point in the history
  • Loading branch information
simmsa committed Jan 31, 2025
1 parent 7c34043 commit 2b99ede
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion mhkit_python_utils/type_conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,11 @@ def convert_numpy_array(data: Union[np.ndarray, array.array]) -> ConversionResul
- Arrays are converted to column-major order for MATLAB compatibility
- Complex arrays are preserved
"""
return ConversionResult(type=str(type(data)), data=np.array(data), index=None)

# Cast array.array to numpy array
data = np.array(data)

return ConversionResult(type=str(type(data)), data=data, index=None)


def convert_index(index: pd.Index) -> np.ndarray:
Expand Down

0 comments on commit 2b99ede

Please sign in to comment.