I know next to nothing about python. But I see the challenge here.
We'd need to separate the expression into 3 parts, 1) numeric value, 2)
symbol (i.e. pi, e) 3) and unit.  The numeric approximation function needs
to be applied to the numeric value multiplied by the symbol value (if any)
and rounded to specified digits, but the unit needs to remain unchanged and
attached.   But I can also see a case where the numeric value needs rounded
to digits, but the symbol and unit need to remain unchanged.  This is
tricky to accommodate all cases and user requirements.  And there would be
restrictions, more than I can think of now.

Sorry I can't be more helpful.  Thank you for your efforts!


On Sat, May 19, 2018 at 2:32 AM, Ralf Stephan <[email protected]> wrote:

> There is a function is_unit() in symbolic/units.py, so you just need to
> walk the expression tree using the ExpressionTreeWalker class in
> symbolic/expression_conversions.py.  I would first check for symbol with
> ex.is_symbol() which is very fast. See DefiniteSumExpander for example.
>
> Regards,
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "sage-support" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/sage-support/3eCHzmJ1MXY/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/sage-support.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to