Skip to content

Percent symbol not parsed in symbol #11

@mocquin

Description

@mocquin

The % symbol seems to be not parsed corerctly by sympy

from physipy import K
import sympy as sp
pc = 1/K
pc.symbol = "%/K"

q = 2*pc
q.favunit = pc
print(pc.symbol) # '%/K'
q
ValueError: Error from parse_expr with transformed code: "%/Symbol ('K' )"


The above exception was the direct cause of the following exception:

  File "", line 1
    %/Symbol ('K' )
    ^
SyntaxError: invalid syntax
<Quantity : 2.0 1/K, symbol=%/K*UndefinedSymbol>

Metadata

Metadata

Assignees

No one assigned

    Labels

    sympyRelated to sympy

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions