def test_eval(self): npv = EclNPV(self.case) npv.compile("[FOPT]") npv1 = npv.evalNPV() npv2 = 0 sum = EclSum(self.case) trange = sum.timeRange() fopr = sum.blockedProduction("FOPT" , trange) for v in fopr: npv2 += v self.assertAlmostEqual( npv1 , npv2 ) npv.compile("[FOPT] - 0.5*[FOPT] - 0.5*[FOPT]") npv1 = npv.evalNPV() self.assertTrue( abs(npv1) < 1e-2 ) npv.compile("[WOPT:OP_1] - 0.5*[WOPT:OP_1] - 0.5*[WOPT:OP_1]") npv1 = npv.evalNPV() self.assertTrue( abs(npv1) < 1e-2 )