From 63aba93f3906a7d875e4558931d95d911555cbe9 Mon Sep 17 00:00:00 2001 From: John Siirola Date: Thu, 12 Oct 2023 14:25:53 -0600 Subject: [PATCH] Apply black --- pyomo/common/numeric_types.py | 39 ++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/pyomo/common/numeric_types.py b/pyomo/common/numeric_types.py index f822275a907..af7eeded3cf 100644 --- a/pyomo/common/numeric_types.py +++ b/pyomo/common/numeric_types.py @@ -148,6 +148,7 @@ def RegisterBooleanType(new_type: type): native_types.add(new_type) nonpyomo_leaf_types.add(new_type) + def RegisterComplexType(new_type: type): """Register the specified type as an "complex type". @@ -243,25 +244,25 @@ def check_if_numeric_type(obj): def value(obj, exception=True): """ - A utility function that returns the value of a Pyomo object or - expression. - - Args: - obj: The argument to evaluate. If it is None, a - string, or any other primitive numeric type, - then this function simply returns the argument. - Otherwise, if the argument is a NumericValue - then the __call__ method is executed. - exception (bool): If :const:`True`, then an exception should - be raised when instances of NumericValue fail to - evaluate due to one or more objects not being - initialized to a numeric value (e.g, one or more - variables in an algebraic expression having the - value None). If :const:`False`, then the function - returns :const:`None` when an exception occurs. - Default is True. - - Returns: A numeric value or None. + A utility function that returns the value of a Pyomo object or + expression. + + Args: + obj: The argument to evaluate. If it is None, a + string, or any other primitive numeric type, + then this function simply returns the argument. + Otherwise, if the argument is a NumericValue + then the __call__ method is executed. + exception (bool): If :const:`True`, then an exception should + be raised when instances of NumericValue fail to + evaluate due to one or more objects not being + initialized to a numeric value (e.g, one or more + variables in an algebraic expression having the + value None). If :const:`False`, then the function + returns :const:`None` when an exception occurs. + Default is True. + + Returns: A numeric value or None. """ if obj.__class__ in native_types: return obj