def test06(self): """Try just saving bounds""" model = self.setup_model02() model.x[1].value = 1 wts = StoreSpec.bound() to_json(model, fname=self.fname, human_read=True, wts=wts) model.g.deactivate() model.x[1].setlb(-4) model.x[1].value = 3 model.x[2].value = 6 from_json(model, fname=self.fname, wts=wts) assert (abs(value(model.x[1]) - 3) < 1e-5) assert (abs(model.x[1].lb + 10) < 1e-5) assert (abs(value(model.x[2]) - 6) < 1e-5) assert (not model.g.active)
def test06(self): """Try just saving bounds""" model = self.setup_model02() model.x[1].value = 1 wts = StoreSpec.bound() to_json(model, fname=self.fname, human_read=True, wts=wts) model.g.deactivate() model.x[1].setlb(-4) model.x[1].value = 3 model.x[2].value = 6 from_json(model, fname=self.fname, wts=wts) assert value(model.x[1]) == 3 assert model.x[1].lb == -10 assert value(model.x[2]) == 6 assert not model.g.active