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

Show results from RoW separately in results matrix #312

Closed
bl-young opened this issue Aug 15, 2024 · 6 comments · Fixed by #314
Closed

Show results from RoW separately in results matrix #312

bl-young opened this issue Aug 15, 2024 · 6 comments · Fixed by #314
Milestone

Comments

@bl-young
Copy link
Collaborator

No description provided.

@WesIngwersen
Copy link
Collaborator

We might want to make it optional in the result calculation and not the default unless we're sure it won't interfere with pkg functions operating on the result objects

@bl-young
Copy link
Collaborator Author

We might want to make it optional in the result calculation and not the default unless we're sure it won't interfere with pkg functions operating on the result objects

Good plan that will expedite the implementation as well

@WesIngwersen
Copy link
Collaborator

We might want to make it optional in the result calculation and not the default unless we're sure it won't interfere with pkg functions operating on the result objects

Good plan that will expedite the implementation as well

I will add the parameter in

@WesIngwersen
Copy link
Collaborator

WesIngwersen commented Aug 16, 2024

did this in 455b406 and
f9f1ab4

tested with this code

library(devtools)
load_all()

model <- buildModel("USEEIOv2.3-s-GHG-19")

model <- buildModel("MEEEIOv1.1-GHGc-20",configpaths = "../USEEIO-State/model_specs/ME/MEEEIOv1.1-GHGc-20.yml")

loc <- model$specs$ModelRegionAcronyms[1]

r_noRoW_f <- calculateEEIOModel(model, perspective="FINAL", demand = "Consumption", location = loc,
use_domestic_requirements = FALSE, household_emissions = TRUE, show_RoW = FALSE)

r_RoW_f <- calculateEEIOModel(model, perspective="FINAL", demand = "Consumption", location = loc,
                              use_domestic_requirements = FALSE, household_emissions = TRUE, show_RoW = TRUE)


colSums(r_noRoW_f$LCI_f) == colSums(r_RoW_f$LCI_f)

r_noRoW_d <- calculateEEIOModel(model, perspective="DIRECT", demand = "Consumption", location = loc,
                                use_domestic_requirements = FALSE, household_emissions = TRUE, show_RoW = FALSE)

r_RoW_d <- calculateEEIOModel(model, perspective="DIRECT", demand = "Consumption", location = loc,
                              use_domestic_requirements = FALSE, household_emissions = TRUE, show_RoW = TRUE)


all.equal(colSums(r_noRoW_d$LCI_d),colSums(r_RoW_f$LCI_f))
all.equal(colSums(r_RoW_d$LCI_d),colSums(r_RoW_f$LCI_f))
all.equal(colSums(r_noRoW_d$LCI_d),colSums(r_RoW_f$LCI_f))

those statements return TRUE

Also my recommendation is some refactoring..its a very long set of operations with a lot of redundancy in the direct and final IF clauses

@bl-young
Copy link
Collaborator Author

ok are you still working on this now or should I take over?

@WesIngwersen
Copy link
Collaborator

The RoW block does not have an F010 record. This is 0 by definition but I think its better to add it in - otherwise it requires an adjustment to line up results by region

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

Successfully merging a pull request may close this issue.

2 participants