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

Parsing Quantity from string representation #181

Open
JuliaSprenger opened this issue Nov 18, 2020 · 1 comment
Open

Parsing Quantity from string representation #181

JuliaSprenger opened this issue Nov 18, 2020 · 1 comment

Comments

@JuliaSprenger
Copy link

Sometimes it is necessary to create a Quantity objects from a plain string representation, e.g. like 3.0 ms or [3 4 5] ms. Parsing these strings in each use case is error prone and it would be nice to have a more generic function provided, e.g. like the one provided by the R quantities package, see https://www.r-spatial.org/r/2018/05/07/parsing-quantities.html#a-flexible-errors-parser.

A first step towards a generic parsing would be the capability of parsing the string representation of a quantity to have a closed loop between the quantity object and it's string representation. Potentially some code used by the R quantities package could be used as inspiration here, like script1 and script2.

@torokati44
Copy link

torokati44 commented Dec 17, 2021

+1
EDIT: A really basic version could be something like this: https://gist.github.com/torokati44/5866f6e9b27190dc219e29fdc71d8a0e

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

2 participants