Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Better variable name.

  • Loading branch information...
commit ec1eef489ab63447b14e1a14a59b061de9a0bf2a 1 parent 7db8de4
@lebigot authored
View
4 uncertainties/test_umath.py
@@ -29,7 +29,7 @@ def test_fixed_derivatives_math_funcs():
This comparison is useful for derivatives that are analytical.
"""
- for name in umath.many_scalar_to_scalar_funcs:
+ for name in umath.many_scalars_to_scalar_funcs:
# print "Checking %s..." % name
func = getattr(umath, name)
# Numerical derivatives of func: the nominal value of func() results
@@ -38,7 +38,7 @@ def test_fixed_derivatives_math_funcs():
lambda *args: func(*args))
test_uncertainties._compare_derivatives(func, numerical_derivatives)
- # Functions that are not in umath.many_scalar_to_scalar_funcs:
+ # Functions that are not in umath.many_scalars_to_scalar_funcs:
##
# modf(): returns a tuple:
View
12 uncertainties/umath.py
@@ -77,7 +77,7 @@
# Math functions that have a standard interface: they take
# one or more float arguments, and return a scalar:
-many_scalar_to_scalar_funcs = []
+many_scalars_to_scalar_funcs = []
# Some functions require a specific treatment and must therefore be
# excluded from standard wrapping. Functions
@@ -87,7 +87,7 @@
num_deriv_funcs = ['fmod', 'gamma', 'isinf', 'isnan',
'lgamma', 'trunc']
-# Functions that do not belong in many_scalar_to_scalar_funcs, but
+# Functions that do not belong in many_scalars_to_scalar_funcs, but
# that have a version that handles uncertainties:
non_std_wrapped_funcs = []
@@ -202,7 +202,7 @@ def log_der0(*args):
setattr(this_module, name,
wraps(uncertainties.wrap(func, derivatives), func))
- many_scalar_to_scalar_funcs.append(name)
+ many_scalars_to_scalar_funcs.append(name)
###############################################################################
@@ -279,7 +279,7 @@ def modf(x):
# argument: there is no need to return numbers with uncertainties:
return (frac_part, int_part)
-many_scalar_to_scalar_funcs.append('modf')
+many_scalars_to_scalar_funcs.append('modf')
@uncertainties.set_doc(math.ldexp.__doc__)
def ldexp(x, y):
@@ -310,7 +310,7 @@ def ldexp(x, y):
# value of x coerced to a difference type [int->float, for
# instance]):
return math.ldexp(x, y)
-many_scalar_to_scalar_funcs.append('ldexp')
+many_scalars_to_scalar_funcs.append('ldexp')
@uncertainties.set_doc(math.frexp.__doc__)
def frexp(x):
@@ -347,5 +347,5 @@ def frexp(x):
###############################################################################
# Exported functions:
-__all__ = many_scalar_to_scalar_funcs + non_std_wrapped_funcs
+__all__ = many_scalars_to_scalar_funcs + non_std_wrapped_funcs
View
4 uncertainties/unumpy/core.py
@@ -581,10 +581,10 @@ def define_vectorized_funcs():
for f_name in ['acos', 'acosh', 'asin', 'atan', 'atan2', 'atanh'])
new_func_names = [func_name_translations.get(function_name, function_name)
- for function_name in umath.many_scalar_to_scalar_funcs]
+ for function_name in umath.many_scalars_to_scalar_funcs]
for (function_name, unumpy_name) in \
- zip(umath.many_scalar_to_scalar_funcs, new_func_names):
+ zip(umath.many_scalars_to_scalar_funcs, new_func_names):
# ! The newly defined functions (uncertainties.unumpy.cos, etc.)
# do not behave exactly like their NumPy equivalent (numpy.cos,
Please sign in to comment.
Something went wrong with that request. Please try again.