Skip to content

Commit

Permalink
use deepcopy on constructors in runner to allow for pop to be used
Browse files Browse the repository at this point in the history
  • Loading branch information
gidden committed Sep 6, 2017
1 parent 34a598e commit 503ce72
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions salamanca/models/project.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import division

import copy
import itertools
import math

Expand Down Expand Up @@ -350,8 +351,11 @@ def _update(self, t, df):
def make_model(self, t1, t2):
self.solve_t = t2
ndf, sdf = self._data(t1, t2)
self.model = self.Model(ndf, sdf, **self.constructor_kwargs)
self.model.construct(**self.model_kwargs)
# explicitly copies so pop can be used
kwargs = copy.deepcopy(self.constructor_kwargs)
self.model = self.Model(ndf, sdf, **kwargs)
kwargs = copy.deepcopy(self.model_kwargs)
self.model.construct(**kwargs)
return self

def solve(self, *args, **kwargs):
Expand Down

0 comments on commit 503ce72

Please sign in to comment.