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

Rather question as issue #1194

Closed
jkbgbr opened this issue Oct 24, 2020 · 2 comments
Closed

Rather question as issue #1194

jkbgbr opened this issue Oct 24, 2020 · 2 comments

Comments

@jkbgbr
Copy link

jkbgbr commented Oct 24, 2020

Hi,

Not so much of an issue, rather questions.
I stopped following pint's development a few years ago and I'm really pleased to see how much has been done in the last year or so. Kudos for that guys!

My two primary concerns were at that time:

My package implements multiple mechanical / civil engineering design codes across 20+ (and growing) modules. The modules are standalone and essentially dependency-free but in many cases imports are inevitable as the structure of the implemented design codes is also a kind of a spagetti. When run, the program produces some thousands of objects and I plan to implement some kind of an optimization that would require a large number of cases investigated.

I currently do not use anything to work with units, but in the future I'll probably need to implement design codes from the US that use the imperial system and make it work with the SI. For me this is the time of decision whether I should start using pint (or an alternative).

I'd appreciate any comments / insights on the current state of these matters.

Cheers,
Gábor

@hgrecco
Copy link
Owner

hgrecco commented Oct 24, 2020

Glad to have you back! One of pint distinctive features is that the registry can be fully customized. You can expand the default one, take only what you need or even build a new one completely from scratch. All definitions can loaded from text files. Version control is easy, they are easy to compose (both manually, using imports from within the text files or by loading them sequentially into the registry).

  1. Thanks to wraps, performance issues are not a problem if the system is well designed. Additionally, we are now developing a way to have wraps interact with Python Annotations Better annotations support #1166 which will make this easier.
  2. Using set_application_registry and get_application_registry, interaction between different packages is trivial. Briefly, make all packages use get_application_registry and in your main app call set_application_registry(ureg) to set it.

@jkbgbr
Copy link
Author

jkbgbr commented Oct 26, 2020

Hi hgrecco,

this sounds just great, thank you!
I'll check how pint can be best added to my current code - a short search returned som 500+ places to modify, should have started using pint earlier in the development I think :-o - but I integrating it across mdules looks easy enough.

@jkbgbr jkbgbr closed this as completed Oct 26, 2020
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