Skip to content

Commit 2afc56e

Browse files
committed
Update expansion.py to include size in binom calculations
1 parent 3696155 commit 2afc56e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

demeter/change/expansion.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@ def _convert_pft(notdone, exp_target, met_idx, pft_toconv, spat_ludataharm_sub,
101101
# select the grid cells to expand; user defines whether to use stochastic draw or select the grid cells
102102
# with the highest likelihood
103103
if stochastic_expansion == 1:
104-
drawcells = stats.binom.rvs(1, expansion_likelihood / np.nanmax(expansion_likelihood))
104+
drawcells = stats.binom.rvs(1, expansion_likelihood / np.nanmax(expansion_likelihood),
105+
size=expansion_likelihood.shape)
105106
else:
106107
drawcells = expansion_likelihood >= selection_threshold * np.nanmax(expansion_likelihood)
107108

0 commit comments

Comments
 (0)