Changeset 3219


Ignore:
Timestamp:
Nov 5, 2010 6:01:23 PM (10 years ago)
Author:
jwatson
Message:

Supressing a validation test with NumericConstant?. If the user specifies a value, we are (now) assuming it is actually a numeric value - otherwise, the domain check significantly inflates the run-time associated with expression tree creation. This needs to be revisited in the Coopr 2.5 re-write.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • coopr.pyomo/trunk/coopr/pyomo/tests/unit/test_expr.py

    r2865 r3219  
    212212
    213213    def test_vals(self):
    214         try:
    215             NumericConstant(value='a')
    216             self.fail("Cannot initialize a constant with a non-numeric value")
    217         except ValueError:
    218             pass
     214        # the following aspect of this test is being removed due to the check seminatics
     215        # of a numeric constant requiring far too much run-time, especially when involved
     216        # in expression tree construction. if the user specifies a constant, we're assuming
     217        # it is correct.
     218#        try:
     219#            NumericConstant(value='a')
     220#            self.fail("Cannot initialize a constant with a non-numeric value")
     221#        except ValueError:
     222#            pass
    219223        a = NumericConstant(value=1.1)
    220224        b = float(a)
Note: See TracChangeset for help on using the changeset viewer.