aesthete-team team mailing list archive
-
aesthete-team team
-
Mailing list archive
-
Message #00031
Re: mpmath related diffs
>
>
> The mpmath library should never be preferred if functions are available
> for both - it should be called as a matter of last resort. That was the aim
> of the try-except - to convert to numbers any symbol that mpmath didn't
> like, to allow the calculation to continue. It's a bit of a blunderbuss
> right now, in that if there's only one bit out of many that mpmath doesn't
> like, the whole thing is converted. Ideally we should be converting only
> the symbols that mpmath functions are accessing.
>
> I've just moved the sympy globals in reorder_globals to the end of the
globals dictionary update loop, so they'll overwrite any functions they
come across. That seems to fix it for me and, in theory, any mpmath
function that is not in sympy will appear as normal, trigger an exception,
and get handed the mpmathified version of the arguments. As you say,
ideally we could pick out the bits that need converted, though I suspect
anything that doesn't need converted will pass through unchanged anyhow
(e.g. acceptable python and sympy types)
In short, give it a whirl!
P
Follow ups
References