mgreminger / EngineeringPaper.xyz

EngineeringPaper.xyz is a web app that makes it easy to create, save, and share engineering calculations.
https://EngineeringPaper.xyz
MIT License
130 stars 11 forks source link

Allow more common physics/engineering characters #285

Open MisterE123 opened 1 month ago

MisterE123 commented 1 month ago

I've been unable to use characters such as ṁ for mass flow rate, or vdot for volumetric flow rate, or DeltaV for change in velocity, or t_1/2 for the halflife. It would be nice to be able to use these characters as variables.

MisterE123 commented 1 month ago

image

In this table, alot of room would have been saved by using ΔT for image

and ΔVol for image

and image for image

but as you can see it gives a syntax error.

mgreminger commented 1 month ago

Thanks for the suggestion. This is related to #283. Variable names need to be able to map one-to-one to Python variable names and Python doesn't support the dotted letter names. However, Python does support international unicode alphabets, so that would address the missing delta symbol since it's part of the Greek alphabet. I eventually plan to support the same international characters that Python supports in variable names.

MisterE123 commented 1 month ago

could there be a single special character sequence, legal in python, which is invalid input syntax for EPxyz, which denotes a "spelled-out" special character?

Then, if we say the special character sequence is 00___xx___00_ then M-dot will be displayed properly in EPxyz, and in python map to the var 00___xx___00_m_dot. The sequence would have to be long enough to never be desired for a variable name by itself, but short enough to produce readable python code

mgreminger commented 1 month ago

It's technically possible to do, it just introduces quite a bit of complexity and overhead for the conversion to and from Python.