Closed moble closed 1 year ago
@shashi @YingboMa Given that https://github.com/JuliaSymbolics/Symbolics.jl/pull/638 has been merged, I think this is more relevant now. Any thoughts?
Ahh. Well I don't know how I feel about this haha. Can we take this branch only if args[1]
is not issym(..)
or istree(..)
that way it should only do it for constants. At the very least I agree we should do it for Irrationals. @YingboMa
Yeah, I agree. We should check that args[1]
is not symbolic.
@shashi Tests pass locally. I added the new test at the bottom of test/code.jl
; let me know if you want it somewhere else.
You can just use repr
to get a string... but looks good.
It can be helpful to encode a quantity
q
that should not be evaluated asTerm(identity, q)
. This is the idea behind JuliaSymbolics/Symbolics.jl#638, which allows irrationals likeπ
to be treated symbolically, rather than (typically) asFloat64
in symbolic expressions. But that means thatidentity(π)
appears everywhere we would normally just writeπ
. This PR simply adds another case toshow_term
, to check if the function isidentity
, and just shows the argument instead.