-
Notifications
You must be signed in to change notification settings - Fork 476
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
Proposal: Allow ureg.wraps to convert string arguments #711
Comments
As far as using the same registry, I usually type |
Can you describe your workflow a little more? If users already understand Pint, can they use Quantity objects? Are you parsing text files? |
Sure. The module I'm talking about is The tutorial is here. The intended audience is fluidic engineers with novice or higher python skill. Anyone interested in performing a fluid flow calculation should be able to import the module and start modeling in a jupyter notebook. This module is a work in progress. It has the functionality that I'm interested in, but through a different mechanism. At the time I started working on it, I wasn't aware of ureg.wraps. Typical code that would use the proposed functionality is below.
This code would also work if the strings were replaced by Quantities. The output of functions are all Quantities. |
Regarding Thanks for taking the time to consider this! ✨ |
I think we can accept that PR that parses strings into quantities within wraps but only if |
962: Improved wraps and check r=hgrecco a=hgrecco - [x] Closes #711, #723 - [x] Executed ``black -t py36 . && isort -rc . && flake8`` with no errors - [x] The change is fully covered by automated unit tests - [x] Documented in docs/ as appropriate - [x] Added an entry to the CHANGES file Co-authored-by: Hernan <[email protected]>
Hi! I really like pint, and I'm designing a package that uses it for scientific computations.
I'd like to propose an extension that I would find useful. This extension would automatically convert strings to Quantities on wrapping functions. Example code is below.
This behavior could be placed behind another keyword argument, for example convert_strings=True.
The use case here is as follows:
If you think this is a good idea, I'd be happy to submit a PR for it.
The text was updated successfully, but these errors were encountered: