Skip to content

Commit

Permalink
Add back in fix for str in netcdf
Browse files Browse the repository at this point in the history
  • Loading branch information
tbody-cfs committed Nov 29, 2023
1 parent 719419e commit 03854c4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cfspopcon/file_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from pathlib import Path
from typing import Any

import numpy as np
import xarray as xr

from .helpers import convert_named_options
Expand Down Expand Up @@ -47,7 +48,7 @@ def promote_variable(val: xr.DataArray, key: str) -> Any:
except KeyError:
pass

if val.dtype == object:
if val.dtype == object or val.dtype.type == np.str_:
if val.size == 1:
return convert_named_options(key, val.item())
else:
Expand Down
Binary file modified tests/regression_results/SPARC_PRD_result.nc
Binary file not shown.

0 comments on commit 03854c4

Please sign in to comment.