Skip to content

Commit

Permalink
Fixed kwargs preperation for non-indexed parameters.
Browse files Browse the repository at this point in the history
  • Loading branch information
tBuLi committed Jan 8, 2024
1 parent ea86ffe commit c060e80
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion symfit/symmip/mip.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,13 @@ def _make_mip_model(self):

for p in self.dependent_vars:
if not isinstance(p, Indexed):
self.mip_vars[p] = self.backend.add_var(name=p.name, vtype=self.param_vtype(p), lb=p.min, ub=p.max)
kwargs = {'name': p.name}
if p.max is not None:
kwargs['ub'] = p.max
if p.min is not None:
kwargs['lb'] = p.min
kwargs['vtype'] = self.param_vtype(p)
self.mip_vars[p] = self.backend.add_var(**kwargs)
continue

param = p.base.label
Expand Down

0 comments on commit c060e80

Please sign in to comment.