Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not all alphanumeric variables possible #70

Open
hoonsworld opened this issue Mar 18, 2022 · 0 comments
Open

Not all alphanumeric variables possible #70

hoonsworld opened this issue Mar 18, 2022 · 0 comments

Comments

@hoonsworld
Copy link

Structural engineers use special alphanumeric variables for principal strains. These are called: e1 and e2 (usually an Epsilon, but an "e" is taken instead).
But those alphanumeric variables that start with "e" are not possible with py-expression-eval because it conflicts with the identification of numbers in scientific notation. This is exactly what happens in this line.

There are 2 solutions. The first is quite simple and can be solved with the statement above the line. Here an example:

# Return if Euler's number or if starting with 'e' which could be an alphanumeric variable like e1, e2...
if self.expression[self.pos] == 'E' or self.expression[self.pos] == 'e':
    return False

That would be OK because a scientific number that started with nothing before the "e" wouldn't be a scientific number, and hardly anyone would do that.

The second solution would be to adjust the RE pattern so that at least a single digit number before the "e" is mandatory.

Can you please consider this in the next versions?

Thanks and best regards from Hamburg :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant