ProjectDrawdown / solutions

The mission of Project Drawdown is to help the world reach “Drawdown”— the point in the future when levels of greenhouse gases in the atmosphere stop climbing and start to steadily decline, thereby stopping catastrophic climate change — as quickly, safely, and equitably as possible.
https://www.drawdown.org/
Other
216 stars 91 forks source link

Figure out quirks setting replacement_period_offset #507

Open denised opened 2 years ago

denised commented 2 years ago

The Unit Adoption quirks setting replacement_period_offset is very strange --- I introduced it, but I don't understand it. The observed affect in the test results is an off-by-one error in what year replacement units get put in. Different models need this parameter set to either zero or one to get the right results. I don't know if this is because the models actually have different calculations, or if there is some more other bug in the python code that this somehow compensates for.
If there is a difference in the models, then it would be nice if the extractor could test for it somehow --- it is the most mysterious quriks setting.

DentonGentry commented 2 years ago

One thing which springs to mind is hitting an edge case in ROUND(). Excel's rounding behavior differs significantly from Python 3. There is an implementation which matches Excel's behavior: https://github.com/ProjectDrawdown/solutions/blob/develop/model/excel_math.py

denised commented 2 years ago

Yes, I thought that was the issue as well. Though the details escape me now, I convinced myself at the time I introduced the quirk that this was not the cause of the behavior. Of course, I may have been wrong :-)

-- Denise Draper @.***

On Thu, Oct 28, 2021, at 4:30 PM, Denton Gentry wrote:

One thing which springs to mind is hitting an edge case in ROUND(). Excel's rounding behavior differs significantly from Python 3. There is an implementation which matches Excel's behavior: https://github.com/ProjectDrawdown/solutions/blob/develop/model/excel_math.py

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ProjectDrawdown/solutions/issues/507#issuecomment-954297605, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKAMTTVRMEEZCN7SDLXWLLUJHMIXANCNFSM5G53UF3A.