pik-piam / magclass

R package | Data Class and Tools for Handling Spatial-Temporal Data
GNU Lesser General Public License v3.0
4 stars 24 forks source link

have sizeCheck() report dimensions when throwing an error #140

Closed 0UmfHxcvx5J7JoaOhFSs5mncnisTJJ6q closed 1 year ago

0UmfHxcvx5J7JoaOhFSs5mncnisTJJ6q commented 1 year ago

We had the problem lately that REMIND preprocessing OOMclassed on some too-large magpie object. This addition would give us a hint if it was just some incremental change (n more scenarios) or some exponential increase in the "names" , like combining incompatible dimensions and getting all the combinations.

Output looks like:

Error in magclass:::sizeCheck(c(6765L, 10946L, 17711L)) : 
  magclass object size (6765 x 10946 x 17711 = 1311494059590) exceeds limit (getOption("magclass_sizeLimit") = 1e+09).

Also fixes a false-negative test, that would fail because a magpie object got passed, but not the dimension of the magpie object.