Created
August 7, 2015 04:48
-
-
Save shivamvats/67b6af6ee18506a7ef3c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--------------------------------------------------------------------------- | |
TypeError Traceback (most recent call last) | |
<ipython-input-156-4180082d09fd> in <module>() | |
----> 1 sin(1/a).is_constant() | |
/home/aries/foss/sympy/sympy/core/expr.pyc in is_constant(self, *wrt, **flags) | |
548 except ZeroDivisionError: | |
549 b = None | |
--> 550 if b is not None and b is not S.NaN and b.equals(a) is False: | |
551 return False | |
552 # try random real | |
/home/aries/foss/sympy/sympy/core/expr.pyc in equals(self, other, failing_expression) | |
608 # because if the expression ever goes to 0 then the subsequent | |
609 # simplification steps that are done will be very fast. | |
--> 610 diff = factor_terms((self - other).simplify(), radical=True) | |
611 | |
612 if not diff: | |
/home/aries/foss/sympy/sympy/core/expr.pyc in simplify(self, ratio, measure) | |
2969 from sympy.core.function import count_ops | |
2970 measure = measure or count_ops | |
-> 2971 return simplify(self, ratio, measure) | |
2972 | |
2973 def nsimplify(self, constants=[], tolerance=None, full=False): | |
/home/aries/foss/sympy/sympy/simplify/simplify.pyc in simplify(expr, ratio, measure, fu) | |
554 if expr.has(TrigonometricFunction) and not fu or expr.has( | |
555 HyperbolicFunction): | |
--> 556 expr = trigsimp(expr, deep=True) | |
557 | |
558 if expr.has(log): | |
/home/aries/foss/sympy/sympy/simplify/trigsimp.pyc in trigsimp(expr, **opts) | |
511 }[method] | |
512 | |
--> 513 return trigsimpfunc(expr) | |
514 | |
515 | |
/home/aries/foss/sympy/sympy/simplify/trigsimp.pyc in <lambda>(x) | |
504 trigsimpfunc = { | |
505 'fu': (lambda x: fu(x, **opts)), | |
--> 506 'matching': (lambda x: futrig(x)), | |
507 'groebner': (lambda x: groebnersimp(x, **opts)), | |
508 'combined': (lambda x: futrig(groebnersimp(x, | |
/home/aries/foss/sympy/sympy/simplify/trigsimp.pyc in futrig(e, **kwargs) | |
1081 | |
1082 old = e | |
-> 1083 e = bottom_up(e, lambda x: _futrig(x, **kwargs)) | |
1084 | |
1085 if kwargs.pop('hyper', True) and e.has(HyperbolicFunction): | |
/home/aries/foss/sympy/sympy/simplify/simplify.pyc in bottom_up(rv, F, atoms, nonbasic) | |
916 if args != rv.args: | |
917 rv = rv.func(*args) | |
--> 918 rv = F(rv) | |
919 elif atoms: | |
920 rv = F(rv) | |
/home/aries/foss/sympy/sympy/simplify/trigsimp.pyc in <lambda>(x) | |
1081 | |
1082 old = e | |
-> 1083 e = bottom_up(e, lambda x: _futrig(x, **kwargs)) | |
1084 | |
1085 if kwargs.pop('hyper', True) and e.has(HyperbolicFunction): | |
/home/aries/foss/sympy/sympy/simplify/trigsimp.pyc in _futrig(e, **kwargs) | |
1149 factor_terms, TR12(x), trigs)], # expand tan of sum | |
1150 )] | |
-> 1151 e = greedy(tree, objective=Lops)(e) | |
1152 | |
1153 return coeff*e | |
/home/aries/foss/sympy/sympy/strategies/core.pyc in minrule(expr) | |
115 objective = kwargs.get('objective', identity) | |
116 def minrule(expr): | |
--> 117 return min([rule(expr) for rule in rules], key=objective) | |
118 return minrule | |
/home/aries/foss/sympy/sympy/strategies/core.pyc in chain_rl(expr) | |
42 def chain_rl(expr): | |
43 for rule in rules: | |
---> 44 expr = rule(expr) | |
45 return expr | |
46 return chain_rl | |
/home/aries/foss/sympy/sympy/simplify/fu.pyc in TR10i(rv) | |
937 return rv | |
938 | |
--> 939 return bottom_up(rv, f) | |
940 | |
941 | |
/home/aries/foss/sympy/sympy/simplify/simplify.pyc in bottom_up(rv, F, atoms, nonbasic) | |
916 if args != rv.args: | |
917 rv = rv.func(*args) | |
--> 918 rv = F(rv) | |
919 elif atoms: | |
920 rv = F(rv) | |
/home/aries/foss/sympy/sympy/simplify/fu.pyc in f(rv) | |
891 | |
892 rv = process_common_addends( | |
--> 893 rv, do, lambda x: tuple(ordered(x.free_symbols))) | |
894 | |
895 # need to check for inducible pairs in ratio of sqrt(3):1 that | |
/home/aries/foss/sympy/sympy/simplify/fu.pyc in process_common_addends(rv, do, key2, key1) | |
1757 if len(v) > 1: | |
1758 e = Add(*v, evaluate=False) | |
-> 1759 new = do(e) | |
1760 if new != e: | |
1761 e = new | |
/home/aries/foss/sympy/sympy/simplify/fu.pyc in do(rv, first) | |
873 | |
874 # two-arg Add | |
--> 875 split = trig_split(*args, two=True) | |
876 if not split: | |
877 return rv | |
/home/aries/foss/sympy/sympy/simplify/fu.pyc in trig_split(a, b, two) | |
1838 _roots() | |
1839 | |
-> 1840 a, b = [Factors(i) for i in (a, b)] | |
1841 ua, ub = a.normal(b) | |
1842 gcd = a.gcd(b).as_expr() | |
/home/aries/foss/sympy/sympy/core/exprtools.py in __init__(self, factors) | |
362 raise ValueError('unexpected factor in i1: %s' % a) | |
363 | |
--> 364 self.factors = factors | |
365 try: | |
366 self.gens = frozenset(factors.keys()) | |
TypeError: descriptor 'factors' for 'Factors' objects doesn't apply to 'Factors' object |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment