quantulum3 icon indicating copy to clipboard operation
quantulum3 copied to clipboard

Operator x is parsed as a unit

Open s2u7 opened this issue 2 years ago • 1 comments

Describe the bug Noticed that x operator in area dimension is parsed as a unit. Is there a way to exclude certain characters from being parsed as units.

To Reproduce Steps to reproduce the behavior:

import quantulum3
from quantumlum3 import parser
quants = parser.parse('18 1/4 x 4 1/4  Floor Edge')
quants[0].surface

Expected behavior '18 1/4' ** Actual behavior** '18 1/4 x'

Screenshots If applicable, add screenshots to help explain your problem.

Additional information:

  • Python Version: [3.8]
  • Classifier activated/ sklearn installed: [yes?]
  • OS: [Linus]
  • Version [20.0.4]

Additional context Add any other context about the problem here.

s2u7 avatar Jun 29 '22 16:06 s2u7

Is there a way to exclude certain characters from being parsed as units.

No unfortunately there is currently no way to do this.

When trying to run this, I get the following output:

[Quantity(18.25, "Unit(name="dimensionless", entity=Entity("dimensionless"), uri=Dimensionless_quantity)"), Quantity(4.25, "Unit(name="dimensionless", entity=Entity("dimensionless"), uri=Dimensionless_quantity)")]

which seems right to me?

nielstron avatar Dec 31 '22 18:12 nielstron