-
Notifications
You must be signed in to change notification settings - Fork 114
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
Copying parameters results in additional decimals places #235
Comments
@OFR-IIASA thanks for the report.
I think this indicates that, somewhere, floating point numbers are being converted to single-precision (32-bit) format. The smallest number greater than 1 that can be represented in single-precision is To fix this, we should check where along the code path @zikolach can you comment on which float formats are being used in ixmp_source? |
Quickly searching through the code showed that we use float type:
In all other places we use Double. |
@OFR-IIASA can you please describe what exactly is done?
Do you clone scenario? |
@zikolach |
It sounds like easy to write a test. There is a change iiasa/ixmp_source#250 which could fix issue with double-to-float conversion. |
When copying parameters from one scenario to another, without modifications, the amount of decimal places increases dramatically. i.e. a parameter which originally had a value of 1.0, will end up as 1.000000234 (or something similar) when being copied from one scenario to another. This can not only result in troubles solving the model but can also result in problems, for example when defining the fractions of sub-annual timesteps.
The text was updated successfully, but these errors were encountered: