Skip to content
This repository was archived by the owner on Nov 26, 2025. It is now read-only.
This repository was archived by the owner on Nov 26, 2025. It is now read-only.

Not all alphanumeric variables possible #70

@hoonsworld

Description

@hoonsworld

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 :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions