You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running the above code I encounter the following error:
File c:\Users\riveros\AppData\Local\miniconda3\envs\hydromt-wflow\Lib\site-packages\xarray\backends\api.py:195, in _validate_attrs..check_attr(name, value, valid_types)
189 raise TypeError(
190 f"Invalid name for attr: {name!r} must be a string for "
191 "serialization to netCDF files"
192 )
194 if not isinstance(value, valid_types):
--> 195 raise TypeError(
196 f"Invalid value for attr {name!r}: {value!r}. For serialization to "
197 "netCDF files, its value must be of one of the following types: "
198 f"{', '.join([vtype.name for vtype in valid_types])}"
199 )
TypeError: Invalid value for attr 'source_temporal_extent': {'start': '1950-01-01', 'end': '2023-03-01'}. For serialization to netCDF files, its value must be of one of the following types: str, Number, ndarray, number, list, tuple
However, this is error does not appear when I specify: source_list = ["era5_hourly[precip]"]
Desired behaviour
I would expect the export_data to work also when not specifying a single variable from the dataset
Additional context
hydromt is version 0.10.0
The data catalog is version 0.7.0
xarray is version 2024.3.0
The text was updated successfully, but these errors were encountered:
HydroMT version checks
Reproducible Example
import hydromt
from hydromt.data_catalog import DataCatalog
from hydromt.log import setuplog
logger = setuplog("export data", log_level=10)
data_catalog = DataCatalog(
logger=logger,
data_libs=["deltares_data"],
)
source_list = ["era5_hourly"]
ds = data_catalog.export_data(
data_root = ('./precipitation'),
source_names=source_list,
bbox=[ 7.49480011, 43.77567187, 10.07152846, 44.67692802],
time_tuple=('2009-01-01T00:00:00','2023-01-01T00:00:00'),
)
Current behaviour
When running the above code I encounter the following error:
File c:\Users\riveros\AppData\Local\miniconda3\envs\hydromt-wflow\Lib\site-packages\xarray\backends\api.py:195, in _validate_attrs..check_attr(name, value, valid_types)
189 raise TypeError(
190 f"Invalid name for attr: {name!r} must be a string for "
191 "serialization to netCDF files"
192 )
194 if not isinstance(value, valid_types):
--> 195 raise TypeError(
196 f"Invalid value for attr {name!r}: {value!r}. For serialization to "
197 "netCDF files, its value must be of one of the following types: "
198 f"{', '.join([vtype.name for vtype in valid_types])}"
199 )
TypeError: Invalid value for attr 'source_temporal_extent': {'start': '1950-01-01', 'end': '2023-03-01'}. For serialization to netCDF files, its value must be of one of the following types: str, Number, ndarray, number, list, tuple
However, this is error does not appear when I specify: source_list = ["era5_hourly[precip]"]
Desired behaviour
I would expect the export_data to work also when not specifying a single variable from the dataset
Additional context
hydromt is version 0.10.0
The data catalog is version 0.7.0
xarray is version 2024.3.0
The text was updated successfully, but these errors were encountered: