Skip to content

Commit

Permalink
Suppress a VisibleDepreciationWarning when creating an array of string.
Browse files Browse the repository at this point in the history
  • Loading branch information
cuihantao committed Oct 5, 2023
1 parent 095ae59 commit 334e9b9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion andes/io/matpower.py
Expand Up @@ -151,7 +151,10 @@ def m2mpc(infile: str) -> dict:
elif isinstance(val, list):
if len(val) == 0:
continue
mpc_array[key] = np.array(val)
if "name" in key:
mpc_array[key] = np.array(val, dtype=object)
else:
mpc_array[key] = np.array(val)
else:
raise NotImplementedError("Unkonwn type for mpc, ", type(val))

Expand Down

0 comments on commit 334e9b9

Please sign in to comment.