Skip to content

Commit

Permalink
Fix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
fmaussion committed Aug 12, 2019
1 parent 8365786 commit 5273514
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 2 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@
numpydoc_class_members_toctree = True
numpydoc_show_class_members = False

ipython_warning_is_error = False

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

Expand Down
8 changes: 5 additions & 3 deletions oggmcontrib/mbmod.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
import numpy as np
import netCDF4
from oggm.core.massbalance import MassBalanceModel
from oggm.cfg import SEC_IN_YEAR, RHO
from oggm import cfg
from oggm.cfg import SEC_IN_YEAR


class RandomLinearMassBalance(MassBalanceModel):
Expand Down Expand Up @@ -41,6 +42,7 @@ def __init__(self, gdir, grad=3., sigma_ela=100., seed=None):
self.valid_bounds = [-1e4, 2e4] # in m
self.grad = grad
self.sigma_ela = sigma_ela
self.hemisphere = 'nh'
self.rng = np.random.RandomState(seed)

# Decide on a reference ELA
Expand Down Expand Up @@ -69,11 +71,11 @@ def get_random_ela_h(self, year):
self.ela_h_per_year[year] = ela_h
return ela_h

def get_annual_mb(self, heights, year=None):
def get_annual_mb(self, heights, year=None, fl_id=None):

# Compute the mass-balance gradient
ela_h = self.get_random_ela_h(year)
mb = (np.asarray(heights) - ela_h) * self.grad

# Convert to units of [m s-1] (meters of ice per second)
return mb / SEC_IN_YEAR / RHO
return mb / SEC_IN_YEAR / cfg.PARAMS['ice_density']
2 changes: 1 addition & 1 deletion oggmcontrib/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def distance_from_border(gdir, sqrt=False):
gdfi = gpd.GeoDataFrame(columns=['geometry'])
if gdir.has_file('intersects'):
# read and transform to grid
gdf = gpd.read_file(gdir.get_filepath('intersects'))
gdf = gdir.read_shapefile('intersects')
salem.transform_geopandas(gdf, gdir.grid, inplace=True)
gdfi = pd.concat([gdfi, gdf[['geometry']]])

Expand Down
2 changes: 1 addition & 1 deletion readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
python:
version: 3.7
version: 3.5
install:
- requirements: docs/requirements.txt
system_packages: true

0 comments on commit 5273514

Please sign in to comment.