-
Notifications
You must be signed in to change notification settings - Fork 0
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
Percent consumption calculation has many >100 observations #33
Comments
Bug Hunt Update 2024-11-15When adding up back to BACI numbers we are not getting close numbers. This indicates that we may have introduced an error through transferring the product hs6 naming
|
Bug hunt Update 2024-11-18 🐛 🏹
Next Steps @theamarks
Questions for @rahulAgrBej
|
Bug Hunt Meeting 2024-11-26
|
Bug Hunt Meeting 2024-12-04Summary notes generated with Fathom AI note taking and were edited by @theamarks Consumption Calculation Improvement
Data Checks and Debugging
Next Steps
|
Bug Hunt Meeting 2024-12-06
Code Review and Debugging
|
The core issue in calculate_consumption appears to stem from artis_import_props. If the volumes are left on, then when grouped by source_country_iso3c, habitat and method, the volumes exceed production, which makes sense because it is based on ARTIS. But, it therefore makes sense that it is over-allocating volume to certain countries (specifically for products moving through intermediate countries). So the bad news is that it seems we need a more complicated handling of the sourcing proportions for the foreign consumption part. |
Bug hunt 2024-12-20 meeting w/ Rahul, Jessica, AltheaSummary notes generated with Fathom AI note taking and were edited by @theamarks Consumption Calculation Discrepancies
Potential Causes Explored
Debugging Approaches
Next Steps
Git & Code Info
|
2025-01-13 Meeting w/ Rahul, Jessica, AltheaPossible roots of the problems:
What we didConceptual change:
Next steps
Code from meeting:
|
2025-01-24 Meeting Notes w/ Jessica, Rahul, AltheaRethinking the flow of consumption calculations Calculate foreign consumption by source countrysource country = production - domestic consumption
|
2025-02-07 Notes
Two forward paths:
|
2025-02-21 Meeting🥳 Jessica found solution! This meeting we are reviewing changes, cleaning up comments and code, and testing. Notes for cleaning up new script
|
2025-02-28 Notes
Persistent issues
To-do
|
Problem
Observed unusual
percent_export
values over 100%. Likely introduced by recent changes tocalculate_consumption.R
caf3076 or the most recent rerun of consumption.Things to investigate 🔎 🐞
snet
table for values exceeding 100% (Jessica's local pgAdmin) - Not exceedingcreate_snet.R
- Jessica local ARTIS snet tables do not have exceeding valuescalculate_consumption.R
consumption_type == foreign
max_percap_consumption
>100% values present regardless of argument valueNA
or some cap valuegroup_by() has unnecessary
end_use` argument (should not effect results) caf3076#diff-06250da3b3ffc0937c72eab9c5b99cdfa99d82f9c07cd9b6d37d9008f31cb6eaR297consumption_outliers
chunk. caf3076#diff-06250da3b3ffc0937c72eab9c5b99cdfa99d82f9c07cd9b6d37d9008f31cb6eaR313-R333commit/94ade821b5485aea74011044bbf703aaf1f66385#diff-06250da3b3ffc0937c72eab9c5b99cdfa99d82f9c07cd9b6d37d9008f31cb6eaR287
calculate_consumption.R
run with the same data _also produces the >100% values with SAUconsumption_FAO_v2_2024_09_19.R
Relevant test scripts
Script for rerunning consumption:
artis-model/AM_local/consumption_FAO_v2_2024_09_19.R
(lives locally on Althea's machine - not tracked by git)
Percent consumption quick calculation:
The text was updated successfully, but these errors were encountered: