Browse Source

Code cleanup.

Taddeus Kroes 14 năm trước cách đây
mục cha
commit
3f28fa2165
2 tập tin đã thay đổi với 4 bổ sung4 xóa
  1. 2 2
      src/rules/numerics.py
  2. 2 2
      tests/test_rules_derivatives.py

+ 2 - 2
src/rules/numerics.py

@@ -1,6 +1,6 @@
 from itertools import combinations
 
-from .utils import greatest_common_divisor
+from .utils import greatest_common_divisor, is_numeric_node
 from ..node import ExpressionLeaf as Leaf, Scope, OP_ADD, OP_DIV, OP_MUL, \
         OP_POW
 from ..possibilities import Possibility as P, MESSAGES
@@ -195,7 +195,7 @@ def match_multiply_numerics(node):
 
     p = []
     scope = Scope(node)
-    numerics = filter(lambda n: n.is_numeric(), scope)
+    numerics = filter(is_numeric_node, scope)
 
     for n in numerics:
         if n.negated:

+ 2 - 2
tests/test_rules_derivatives.py

@@ -1,4 +1,4 @@
-from src.rules.derivatives import der, get_derivation_variable, \
+from src.rules.derivatives import get_derivation_variable, \
         match_zero_derivative, match_one_derivative, one_derivative, \
         zero_derivative, match_variable_power, variable_root, \
         variable_exponent, match_const_deriv_multiplication, \
@@ -6,7 +6,7 @@ from src.rules.derivatives import der, get_derivation_variable, \
         logarithmic, match_goniometric, sinus, cosinus, tangens, \
         match_sum_product_rule, sum_rule, product_rule, match_quotient_rule, \
         quotient_rule, power_rule
-from src.node import Scope, sin, cos, ln
+from src.node import Scope, sin, cos, ln, der
 from src.possibilities import Possibility as P
 from tests.rulestestcase import RulesTestCase, tree