Skip to content

Commit 5c25ab3

Browse files
committed
Fix NotImplementedError from pandas.offsets.MonthOffset().
apply() on object pandas.offsets.MonthOffsets() became obsolete, see pandas-dev/pandas#7707 (comment). Caused NotImplementedErrors with SARAH and ERA5 cutouts.
1 parent 07baba4 commit 5c25ab3

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,7 @@ Getting started
8080
- Install atlite from this repository with all its library
8181
dependencies\
8282
```pip install git+https://github.com/FRESNA/atlite.git```
83-
- Download one of the weather datasets listed above:
84-
* Data from ERA5 is downloaded automatically (TODO unclear: when and where?)
83+
- Download one of the weather datasets, see notes below.
8584
- Adjust the [atlite/config.py](atlite/config.py) directory paths to
8685
point to the directory where you downloaded the dataset
8786
- Create a cutout, i.e. a geographical rectangle and a selection of
@@ -91,6 +90,14 @@ Getting started
9190
you want to aggregate for your time series, and pass it to the
9291
appropriate converter function - see [examples/](examples/)
9392

93+
94+
### Notes on accessing the different data sets
95+
96+
| Data set | Note | Link |
97+
|----------|------|------|
98+
| ERA-5 | Data for this data set is downloaded automatically when creating a cutout. For this to function, the `ecmwfapirc` client has to be installed and a API key set up. See the link for detailed information. | [ECMWF website](https://confluence.ecmwf.int/display/WEBAPI/Access+ECMWF+Public+Datasets) |
99+
100+
94101
Licence
95102
-------
96103

atlite/datasets/era5.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def prepare_meta_era5(xs, ys, year, month, module):
9393
ds = _add_height(ds)
9494

9595
t = pd.Timestamp(year=year, month=month, day=1)
96-
ds['time'] = pd.date_range(t, t + pd.offsets.MonthOffset(),
96+
ds['time'] = pd.date_range(t, t + pd.DateOffset(months=1),
9797
freq='1h', closed='left')
9898

9999
return ds.load()

atlite/datasets/sarah.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def prepare_meta_sarah(xs, ys, year, month, template_sis, template_sid, module,
7474
ds = ds.coords.to_dataset()
7575

7676
t = pd.Timestamp(year=year, month=month, day=1)
77-
ds['time'] = pd.date_range(t, t + pd.offsets.MonthOffset(),
77+
ds['time'] = pd.date_range(t, t + pd.DateOffset(months=1),
7878
freq='1h', closed='left')
7979

8080
if resolution is not None:

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
include_package_data=True,
1919
python_requires='>3.0',
2020
install_requires=['numpy', 'scipy', 'pandas', 'xarray>=0.10.0', 'dask',
21-
'rasterio', 'shapely', 'bottleneck',
21+
'rasterio', 'shapely', 'bottleneck', 'pyproj'
2222
'toolz'],
2323
classifiers=[
2424
'Development Status :: 3 - Alpha',

0 commit comments

Comments
 (0)