Skip to content

Commit

Permalink
Fix Docs (#995)
Browse files Browse the repository at this point in the history
  • Loading branch information
fmaussion committed Mar 31, 2020
1 parent 5457cb2 commit 961098c
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 3 deletions.
6 changes: 5 additions & 1 deletion docs/_code/prepare_climate.py
Expand Up @@ -82,7 +82,11 @@
def example_plot_temp_ts():
d = xr.open_dataset(gdir.get_filepath('climate_monthly'))
temp = d.temp.resample(time='12MS').mean('time').to_series()
del temp.index.name
temp.index = temp.index.year
try:
temp = temp.rename_axis(None)
except AttributeError:
del temp.index.name
temp.plot(figsize=(8, 4), label='Annual temp')
tsm = temp.rolling(31, center=True, min_periods=15).mean()
tsm.plot(label='31-yr avg')
Expand Down
10 changes: 10 additions & 0 deletions docs/conf.py
Expand Up @@ -79,11 +79,21 @@
print("netCDF4: %s, %s" % (netCDF4.__version__, netCDF4.__file__))
except ImportError:
print("no netCDF4")
try:
import cftime
print("cftime: %s, %s" % (cftime.__version__, cftime.__file__))
except ImportError:
print("no netCDF4")
try:
import skimage
print("skimage: %s, %s" % (skimage.__version__, skimage.__file__))
except ImportError:
print("no skimage")
try:
import salem
print("salem: %s, %s" % (salem.__version__, salem.__file__))
except ImportError:
print("no salem")

# Remove some warnings
try:
Expand Down
5 changes: 3 additions & 2 deletions docs/requirements.txt
Expand Up @@ -3,23 +3,24 @@ scipy
pandas
shapely
matplotlib
pyproj
pyproj==2.5.0
rasterio
Pillow
geopandas
netcdf4==1.3.1
cftime
scikit-image
configobj
joblib
xarray
progressbar2
pytest
tables
motionless
dask
bottleneck
descartes
toolz
ipython
numpydoc
tables
git+https://github.com/fmaussion/salem.git
3 changes: 3 additions & 0 deletions oggm/utils/_workflow.py
Expand Up @@ -40,6 +40,9 @@
pass
try:
import salem
except ImportError:
pass
try:
from salem import wgs84
from salem.gis import transform_proj
except ImportError:
Expand Down

0 comments on commit 961098c

Please sign in to comment.