issues: 1421718311
This data as json
id | node_id | number | title | user | state | locked | assignee | milestone | comments | created_at | updated_at | closed_at | author_association | active_lock_reason | draft | pull_request | body | reactions | performed_via_github_app | state_reason | repo | type |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1421718311 | I_kwDOAMm_X85UvbMn | 7210 | Unable to convert times to datetime when first and last value are masked | 11022336 | open | 0 | 2 | 2022-10-25T01:57:04Z | 2022-10-27T15:30:57Z | NONE | What happened?In the following conditions, I am unable to open a NetCDF file in xarray with
The following changes to the NetCDF file allows me to open the file in xarray:
OR
What did you expect to happen?I should be able to open the NetCDF file with Minimal Complete Verifiable Example```Python import xarray as xr import numpy as np fill_val = -99999.0 time_vals = np.random.rand(10) time_vals[0] = fill_val time_vals[-1] = fill_val data_vars = { 'foo': (['x'], np.random.rand(10)), 'time': ( ['x'], time_vals, { 'units': 'seconds since 2000-1-1 0:0:0 0', '_FillValue': fill_val, 'standard_name': 'time', 'calendar': 'standard' } ), } ds = xr.Dataset( data_vars=data_vars, coords={'x': (['x'], np.arange(10))} ) nc_out_location = '/path/to/example.nc' ds.to_netcdf(nc_out_location) ds = xr.open_dataset(nc_out_location) # This line results in an error ``` MVCE confirmation
Relevant log output
Anything else we need to know?Looking at the code, it seems like this is happening because Environment
INSTALLED VERSIONS
------------------
commit: None
python: 3.9.1 (default, Jan 8 2021, 17:17:17)
[Clang 12.0.0 (clang-1200.0.32.28)]
python-bits: 64
OS: Darwin
OS-release: 21.6.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: None
LOCALE: ('en_US', 'UTF-8')
libhdf5: 1.12.0
libnetcdf: 4.7.4
xarray: 2022.10.0
pandas: 1.4.1
numpy: 1.22.3
scipy: 1.8.0
netCDF4: 1.5.7
pydap: None
h5netcdf: None
h5py: None
Nio: None
zarr: None
cftime: 1.5.1
nc_time_axis: None
PseudoNetCDF: None
rasterio: 1.2.10
cfgrib: None
iris: None
bottleneck: None
dask: 2022.02.0
distributed: 2022.02.0
matplotlib: 3.5.1
cartopy: None
seaborn: None
numbagg: None
fsspec: 2022.01.0
cupy: None
pint: None
sparse: None
flox: None
numpy_groupies: None
setuptools: 60.10.0
pip: 21.1.1
conda: None
pytest: None
IPython: None
sphinx: None
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/7210/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
13221727 | issue |