Commit 3f28fa21 authored by Taddeus Kroes's avatar Taddeus Kroes

Code cleanup.

parent 19282d20
from itertools import combinations 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, \ from ..node import ExpressionLeaf as Leaf, Scope, OP_ADD, OP_DIV, OP_MUL, \
OP_POW OP_POW
from ..possibilities import Possibility as P, MESSAGES from ..possibilities import Possibility as P, MESSAGES
...@@ -195,7 +195,7 @@ def match_multiply_numerics(node): ...@@ -195,7 +195,7 @@ def match_multiply_numerics(node):
p = [] p = []
scope = Scope(node) scope = Scope(node)
numerics = filter(lambda n: n.is_numeric(), scope) numerics = filter(is_numeric_node, scope)
for n in numerics: for n in numerics:
if n.negated: if n.negated:
......
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, \ match_zero_derivative, match_one_derivative, one_derivative, \
zero_derivative, match_variable_power, variable_root, \ zero_derivative, match_variable_power, variable_root, \
variable_exponent, match_const_deriv_multiplication, \ variable_exponent, match_const_deriv_multiplication, \
...@@ -6,7 +6,7 @@ from src.rules.derivatives import der, get_derivation_variable, \ ...@@ -6,7 +6,7 @@ from src.rules.derivatives import der, get_derivation_variable, \
logarithmic, match_goniometric, sinus, cosinus, tangens, \ logarithmic, match_goniometric, sinus, cosinus, tangens, \
match_sum_product_rule, sum_rule, product_rule, match_quotient_rule, \ match_sum_product_rule, sum_rule, product_rule, match_quotient_rule, \
quotient_rule, power_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 src.possibilities import Possibility as P
from tests.rulestestcase import RulesTestCase, tree from tests.rulestestcase import RulesTestCase, tree
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment