-
Notifications
You must be signed in to change notification settings - Fork 11
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
Conversion of monetary units #25
Comments
Good suggestion! Some thoughts:
|
Hi all, luckily enough, I ran into this use case a few years ago (oh jesus, just saw it was 4 years ago in the commit log..) and wrote a small tool to help deal with it. Salamanca treats inflation/deflation for both MER/PPP exchange calculations. It offers both an API and CLI for currency conversions specifically. Because it is based on WB data, only year-granularity is supported. An interface into the WB rest API is also provided (@coroa just helped updating it to v2) as both API and CLI. I've been meaning to at least get the module back on its feet in terms of CI/setuptools-scm, etc. If this would help here, happy to put some time into it. Note in addition to users at CA, I believe Ed and Miguel both use some of salamanca in other use cases. But best to check with them on that. |
To note, I developed this module during the course of working on downscaling and inequality, so there's also some handy tools/conversions there as well (e.g., between Ginis and Theils). |
@gidden thanks for mentioning that! The two packages seem to have slightly different aims, e.g. this one is narrowly aimed at making it possible to do some things via pint-parseable units, with those other (useful) tasks out of scope. So perhaps it would be most straightforward to copy/use part of the Salamanca code as reference (with appropriate credit) when addressing this issue. Whoever tackles this enhancement can decide the best course. |
One use case encountered in openENTRANCE and several IAM projects is to convert combined units, like |
Hi all, fresh new rtd, pypi tag, fully tested on all 3 oses with py
3.7/3.8. To note, currency conversion and wb rest api querying is about 2/3
of total code size (or more) as it was one of the primary purposes of the
library at the time.
…On Sun, Feb 28, 2021, 17:42 Daniel Huppmann ***@***.***> wrote:
One use case encountered in openENTRANCE and several IAM projects is to
convert combined units, like 2010-USD/kW (for investment cost) to
2020-EUR/kW or EJ/2010-USD (for energy per GDP) to GWh/2020-EUR. It would
be super-nice to combine the generality of pint & iam-units with the
currency-specific features of salamanca...
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#25 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAKUAEJZI6MY5XCW645ABOTTBJW6ZANCNFSM4YKAAIAQ>
.
|
In #43:
I see that above I already shared some thoughts. At this point I think I see one of two options:
In the case of (2), the method could be called by default, with a deprecation warning; and then in future releases that default call would disappear. This would avoid downstream code breakage from #43. I'd be able to take this on, but not until middle of next week. |
As discussed in other contexts, it would be highly useful to add a module to convert between different currencies taking into account deflation and the year (or more granular?) of conversion.
I.e., converting from 2010-USD to 2020-EUR would yield different results depending on whether you first deflate from 2010 to 2020 and then convert, or vice versa.
The text was updated successfully, but these errors were encountered: