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

calcOutput('FEdemand') fails where calcFEdemand() succeeds #200

Open
0UmfHxcvx5J7JoaOhFSs5mncnisTJJ6q opened this issue Jan 18, 2024 · 5 comments
Assignees
Labels

Comments

@0UmfHxcvx5J7JoaOhFSs5mncnisTJJ6q
Copy link
Member

Using this mrremind branch,

  • running readSource('EDGE', 'FE_stationary') directly succeeds,
  • running mrremind:::calcFEdemand('FE') directly succeeds,
  • but running calcOutput('FEdemand', subtype = 'FE') fails with
    Error in sizeCheck(tmpdim) : 
    magclass object size (249 x 47 x 93744 = 1097086032) exceeds limit (getOption("magclass_sizeLimit") = 1e+09).
    

So there is some magic sauce inside calcOutput() that is breaking mrremind.

@tscheypidi
Copy link
Member

what is in there is the aggregation. What happens if you run calcOutput("FEdemand", subtype = "FE", aggregate = FALSE)?

@0UmfHxcvx5J7JoaOhFSs5mncnisTJJ6q
Copy link
Member Author

Forgot the backtrace:

Backtrace:
     ▆
  1. ├─utils::str(mrremind:::calcFEdemand("FE"))
  2. ├─mrremind:::calcFEdemand("FE")
  3. │ └─madrat::readSource("EDGE", subtype = "FE_buildings")
  4. │   └─madrat (local) .getData(type, subtype, subset, args, prefix)
  5. │     ├─withr::with_dir(...)
  6. │     │ └─base::force(code)
  7. │     ├─madrat:::withMadratLogging(eval(parse(text = functionname)))
  8. │     │ └─base::withCallingHandlers(...)
  9. │     ├─base::eval(parse(text = functionname))
 10. │     │ └─base::eval(parse(text = functionname))
 11. │     └─mrremind:::convertEDGE(x = x, subtype = subtype)
 12. │       └─madrat::toolAggregate(...)
 13. │         ├─... * weight
 14. │         └─... * weight
 15. │           └─magclass::magpie_expand(e2, e1)
 16. │             └─magclass:::magpie_expand_dim(x, ref, dim = i)
 17. │               └─magclass:::sizeCheck(tmpdim)
 18. │                 └─base::stop(...)
 19. └─base::.handleSimpleError(...)
 20.   └─h(simpleError(msg, call))
 21.     └─rlang::entrace(cnd)
 22.       └─rlang::cnd_signal(entraced)

@0UmfHxcvx5J7JoaOhFSs5mncnisTJJ6q
Copy link
Member Author

what is in there is the aggregation. What happens if you run calcOutput("FEdemand", subtype = "FE", aggregate = FALSE)?

Same thing.

Error in `sizeCheck()`:
! magclass object size (249 x 47 x 93744 = 1097086032) exceeds limit (getOption("magclass_sizeLimit") = 1e+09).
Backtrace:
     ▆
  1. ├─utils::str(calcOutput("FEdemand", subtype = "FE", aggregate = FALSE))
  2. ├─madrat::calcOutput("FEdemand", subtype = "FE", aggregate = FALSE)
  3. │ ├─madrat:::withMadratLogging(eval(parse(text = functionname)))
  4. │ │ └─base::withCallingHandlers(...)
  5. │ ├─base::eval(parse(text = functionname))
  6. │ │ └─base::eval(parse(text = functionname))
  7. │ └─mrremind:::calcFEdemand(...)
  8. │   └─madrat::readSource("EDGE", subtype = "FE_buildings")
  9. │     └─madrat (local) .getData(type, subtype, subset, args, prefix)
 10. │       ├─withr::with_dir(...)
 11. │       │ └─base::force(code)
 12. │       ├─madrat:::withMadratLogging(eval(parse(text = functionname)))
 13. │       ├─base::eval(parse(text = functionname))
 14. │       │ └─base::eval(parse(text = functionname))
 15. │       └─mrremind:::convertEDGE(x = x, subtype = subtype)
 16. │         └─madrat::toolAggregate(...)
 17. │           ├─... * weight
 18. │           └─... * weight
 19. │             └─magclass::magpie_expand(e2, e1)
 20. │               └─magclass:::magpie_expand_dim(x, ref, dim = i)
 21. │                 └─magclass:::sizeCheck(tmpdim)
 22. │                   └─base::stop(...)
 23. └─base::.handleSimpleError(...)
 24.   └─h(simpleError(msg, call))
 25.     └─rlang::entrace(cnd)
 26.       └─rlang::cnd_signal(entraced)

@tscheypidi
Copy link
Member

based on the traceback the error is in convertEDGE

@0UmfHxcvx5J7JoaOhFSs5mncnisTJJ6q
Copy link
Member Author

But only if run through calcOutput().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants