Changes between Initial Version and Version 2 of Ticket #24425


Ignore:
Timestamp:
Dec 24, 2017, 8:29:13 AM (5 years ago)
Author:
rws
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #24425

    • Property Summary changed from random_expr changes behaviour when unrelated code is changed to Minimize random_expr's raising exceptions
  • Ticket #24425 – Description

    initial v2  
    4646The reason why the doctest fails is that, despite fixing the random seed, the functions and symbols picked by `random_expr` are different. This, at some point in the buildup of the expression, leads to the sub-expression `kronecker_delta(-0.6165326641917295 + 0.15117833554974136*I, e)` which immediately evaluates to `0`. The `0` progresses eventually into a denominator, causing the error. `random_expr` is not written to avoid such errors if they happen, nor does it avoid other exceptions thrown. The author of the doctest apparently just chose a random seed that happens to not throw errors.
    4747
    48 Of course the actual bug is that `random_expr` changes behaviour when unrelated code is changed.
     48A fix that filters out zero divisions and intended exceptions thrown from code in `functions` before returning the expression would be the  best solution (but it doesn't handle runtime errors from Pynac).