[yt-svn] commit/yt: chummels: Merged in ngoldbaum/yt (pull request #1750)

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Mon Sep 21 11:31:16 PDT 2015


1 new commit in yt:

https://bitbucket.org/yt_analysis/yt/commits/9b76efa712c6/
Changeset:   9b76efa712c6
Branch:      yt
User:        chummels
Date:        2015-09-21 18:31:04+00:00
Summary:     Merged in ngoldbaum/yt (pull request #1750)

Linting yt.units
Affected #:  4 files

diff -r b4d62bbacfe3393c5e19543d77f60e1573130c47 -r 9b76efa712c65a3118ef2c6fb8e97defae53fc7e yt/units/setup.py
--- a/yt/units/setup.py
+++ b/yt/units/setup.py
@@ -1,8 +1,4 @@
 #!/usr/bin/env python
-import setuptools
-import os
-import sys
-import os.path
 
 
 def configuration(parent_package='', top_path=None):

diff -r b4d62bbacfe3393c5e19543d77f60e1573130c47 -r 9b76efa712c65a3118ef2c6fb8e97defae53fc7e yt/units/tests/test_units.py
--- a/yt/units/tests/test_units.py
+++ b/yt/units/tests/test_units.py
@@ -225,7 +225,7 @@
 
     """
     try:
-        u1 = Unit(Symbol("jigawatts"))
+        Unit(Symbol("jigawatts"))
     except UnitParseError:
         yield assert_true, True
     else:
@@ -237,7 +237,7 @@
 
     """
     try:
-        u1 = Unit([1])  # something other than Expr and str
+        Unit([1])  # something other than Expr and str
     except UnitParseError:
         yield assert_true, True
     else:
@@ -249,7 +249,7 @@
 
     """
     try:
-        u1 = Unit("a", base_value=1, dimensions="(mass)")
+        Unit("a", base_value=1, dimensions="(mass)")
     except UnitParseError:
         yield assert_true, True
     else:
@@ -264,7 +264,7 @@
     a = Symbol("a")
 
     try:
-        u1 = Unit("a", base_value=1, dimensions=a)
+        Unit("a", base_value=1, dimensions=a)
     except UnitParseError:
         pass
     else:
@@ -277,7 +277,7 @@
 
     """
     try:
-        u1 = Unit("a", base_value="a", dimensions=(mass/time))
+        Unit("a", base_value="a", dimensions=(mass/time))
     except UnitParseError:
         yield assert_true, True
     else:

diff -r b4d62bbacfe3393c5e19543d77f60e1573130c47 -r 9b76efa712c65a3118ef2c6fb8e97defae53fc7e yt/units/unit_object.py
--- a/yt/units/unit_object.py
+++ b/yt/units/unit_object.py
@@ -18,7 +18,7 @@
     Pow, Symbol, Integer, \
     Float, Basic, Rational, sqrt
 from sympy.core.numbers import One
-from sympy import sympify, latex, symbols
+from sympy import sympify, latex
 from sympy.parsing.sympy_parser import \
     parse_expr, auto_number, rationalize
 from keyword import iskeyword
@@ -32,7 +32,6 @@
 from yt.utilities.exceptions import YTUnitsNotReducible
 
 import copy
-import string
 import token
 
 class UnitParseError(Exception):

diff -r b4d62bbacfe3393c5e19543d77f60e1573130c47 -r 9b76efa712c65a3118ef2c6fb8e97defae53fc7e yt/units/yt_array.py
--- a/yt/units/yt_array.py
+++ b/yt/units/yt_array.py
@@ -40,7 +40,6 @@
 from yt.utilities.on_demand_imports import _astropy
 from sympy import Rational
 from yt.units.unit_lookup_table import \
-    unit_prefixes, prefixable_units, \
     default_unit_symbol_lut
 from yt.units.equivalencies import equivalence_registry
 from yt.utilities.logger import ytLogger as mylog
@@ -630,12 +629,12 @@
         # Converting from AstroPy Quantity
         u = arr.unit
         ap_units = []
-        for base, power in zip(u.bases, u.powers):
+        for base, exponent in zip(u.bases, u.powers):
             unit_str = base.to_string()
             # we have to do this because AstroPy is silly and defines
             # hour as "h"
             if unit_str == "h": unit_str = "hr"
-            ap_units.append("%s**(%s)" % (unit_str, Rational(power)))
+            ap_units.append("%s**(%s)" % (unit_str, Rational(exponent)))
         ap_units = "*".join(ap_units)
         if isinstance(arr.value, np.ndarray):
             return YTArray(arr.value, ap_units, registry=unit_registry)
@@ -675,9 +674,9 @@
         >>> c = yt.YTArray.from_pint(b)
         """
         p_units = []
-        for base, power in arr.units.items():
+        for base, exponent in arr.units.items():
             bs = convert_pint_units(base)
-            p_units.append("%s**(%s)" % (bs, Rational(power)))
+            p_units.append("%s**(%s)" % (bs, Rational(exponent)))
         p_units = "*".join(p_units)
         if isinstance(arr.magnitude, np.ndarray):
             return YTArray(arr.magnitude, p_units, registry=unit_registry)

Repository URL: https://bitbucket.org/yt_analysis/yt/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.



More information about the yt-svn mailing list