Skip to content

Commit

Permalink
bugfix for direction rules
Browse files Browse the repository at this point in the history
  • Loading branch information
gidden committed Sep 6, 2017
1 parent 10371ee commit 58649e0
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions salamanca/models/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,20 +307,16 @@ def construct(self, diffusion={}, direction={}):
rule=lambda m, idx: theil_diff_lo_rule(m, idx, b),
doc='income share within 20% from past',
)
b = direction.pop('income', False)
if b:
b = 0.2 if b is True else b
if direction.pop('income', False):
m.i_dir = mo.Constraint(
m.idxs,
rule=lambda m: income_direction_rule(m, b),
rule=income_direction_rule,
doc='income must track with national values',
)
b = direction.pop('theil', False)
if b:
b = 0.2 if b is True else b
if direction.pop('theil', False):
m.t_dir = mo.Constraint(
m.idxs,
rule=lambda m: theil_direction_rule(m, b),
rule=theil_direction_rule,
doc='theil must track with national values',
)
# Objective
Expand Down

0 comments on commit 58649e0

Please sign in to comment.