Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update documentation in regrid2.py (#509)
Following the document returns error for `regridder = regrid2.Regrid2Regridder(ds.grid, output_grid)` as below: ```python AttributeError Traceback (most recent call last) Cell In[25], line 1 ----> 1 regridder = regrid2.Regrid2Regridder(ds.grid, output_grid) File ~/mambaforge/envs/pmp_devel_20230223/lib/python3.9/site-packages/xcdat/regridder/regrid2.py:55, in Regrid2Regridder.__init__(self, input_grid, output_grid, **options) 13 """ 14 Pure python implementation of the regrid2 horizontal regridder from 15 CDMS2's regrid2 module. (...) 51 >>> data_new_grid = regridder.horizontal("ts", ds) 52 """ 53 super().__init__(input_grid, output_grid, **options) ---> 55 self._src_lat = self._input_grid.bounds.get_bounds("Y") 56 self._src_lon = self._input_grid.bounds.get_bounds("X") 58 self._dst_lat = self._output_grid.bounds.get_bounds("Y") AttributeError: 'str' object has no attribute 'bounds' ``` Which is because `type(ds.grid)` is `str`, while `type(ds.regridder.grid)` is `xarray.core.dataset.Dataset`. Corrected commend will be ```regridder = regrid2.Regrid2Regridder(ds.regridder.grid, output_grid) ```
- Loading branch information