-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: ValueError: Cannot generate bounds for multidimensional coordinates. #278
Comments
The issue seems to be that add_missing_bounds loops over axes, which are statically defined in axis.py (here) as When Perhaps we could simply not return bounds in these cases. |
Or perhaps the coordinate shape validation could be skipped if the axis in question is not a dimension (i.e., is not in |
Hi @pochedls, thanks for reporting this issue. It sounds like you're on the right track with possible solutions. |
* initial solution for #278 * add unit test * add comments for test, cleanup extraneous code
* initial solution for #278 add unit test add comments for test, cleanup extraneous code initial work on #282 Bugfix/278 cannot generate bounds (#281) * initial solution for #278 * add unit test * add comments for test, cleanup extraneous code * PR review refactor - Add `types-python-dateutil` to `mypy` dependencies - Update `ref_date` var to `ref_dt_obj` to avoid mypy error `error: Unsupported operand types for + ("str" and "relativedelta")` - Use dictionary unpacking for units variable - Use `datetime.strptime` instead of `pd.datetime()` which runs into the `pd.Timestamp` limitation - Add logger.warning when non-CF compliant time coords cannot be decoded * Consider calendar type when decoding non-Cf time - Fix tests * Update xcdat/dataset.py Co-authored-by: pochedls <[email protected]> * Update xcdat/dataset.py Co-authored-by: pochedls <[email protected]> * Fix datetime reference * return more specific cftime datetime types * removing extraneous calendar specification * Refactor using xarray methods - Move try and except statements into `decode_non_cf_time()` - Extract function `_get_cftime_coords()` to encapsulate related logic from `decode_non_cf_time()` * Update docstrings and silence logger warnings in tests * Fix Timestamp limitation from dtype - Update logger warning * Add space in logger warning Co-authored-by: tomvothecoder <[email protected]>
What happened?
I'm running into an issue working with a number of relatively basic (seemingly okay) netCDF files. I get the following error:
ValueError: Cannot generate bounds for multidimensional coordinates.
What did you expect to happen?
I don't think that an error should be generated in these cases.
Minimal Complete Verifiable Example
Relevant log output
Anything else we need to know?
No response
Environment
/home/pochedley1/bin/anaconda3/envs/xcdat/lib/python3.10/site-packages/_distutils_hack/init.py:33: UserWarning: Setuptools is replacing distutils.
warnings.warn("Setuptools is replacing distutils.")
INSTALLED VERSIONS
commit: None
python: 3.10.5 | packaged by conda-forge | (main, Jun 14 2022, 07:04:59) [GCC 10.3.0]
python-bits: 64
OS: Linux
OS-release: 3.10.0-1160.62.1.el7.x86_64
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: ('en_US', 'UTF-8')
libhdf5: 1.12.1
libnetcdf: 4.8.1
xarray: 2022.6.0
pandas: 1.4.3
numpy: 1.22.4
scipy: 1.8.1
netCDF4: 1.6.0
pydap: None
h5netcdf: None
h5py: None
Nio: None
zarr: None
cftime: 1.6.1
nc_time_axis: None
PseudoNetCDF: None
rasterio: None
cfgrib: None
iris: None
bottleneck: None
dask: 2022.7.1
distributed: 2022.7.1
matplotlib: 3.5.2
cartopy: None
seaborn: None
numbagg: None
fsspec: 2022.5.0
cupy: None
pint: None
sparse: 0.13.0
flox: None
numpy_groupies: None
setuptools: 63.2.0
pip: 22.2
conda: None
pytest: None
IPython: 8.4.0
sphinx: None
The text was updated successfully, but these errors were encountered: