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

Verbose mbind() Error Message on Multiple Differing Dimensions #173

Conversation

0UmfHxcvx5J7JoaOhFSs5mncnisTJJ6q
Copy link
Member

Originates from pik-piam/remind2#604, discussed with @orichters and @fbenke-pik.
The idea is to have more information available in the error message for debugging. To that end, mbind() does something like a three-way-diff, noting for all dimensions that differ (relative to the first input) which elements are missing, which are identical, and which are added.

A <- maxample('pop')[c('AFR', 'CPA', 'EUR', 'FSU', 'LAM', 'MEA', 'NAM'),,'A2']
B <- maxample('pop')[c('MEA', 'NAM', 'PAO', 'PAS'),,'B1']

mbind(A, B)

# Error in mbind(A, B) : 
#   Cannot handle objects! Spatial as well as data dimensions differ!
#   Differences from first mbind() input:
#   spatial:
#       missing: `AFR`, `CPA`, `EUR`, `FSU`, ...
#        having: `MEA`, `NAM`
#        adding: `PAO`, `PAS`
#   data:
#       missing: `A2`
#        adding: `B1`

The change only affects the "Cannot handle objects!" error, so no external code that actually works.

Copy link
Member

@tscheypidi tscheypidi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice improvement

@0UmfHxcvx5J7JoaOhFSs5mncnisTJJ6q 0UmfHxcvx5J7JoaOhFSs5mncnisTJJ6q merged commit 58f500a into pik-piam:master May 28, 2024
2 checks passed
@0UmfHxcvx5J7JoaOhFSs5mncnisTJJ6q 0UmfHxcvx5J7JoaOhFSs5mncnisTJJ6q deleted the dev/verbose_mbind branch May 28, 2024 11:30
@fbenke-pik
Copy link
Contributor

Could you increment the version number to a non-dev number?

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 this pull request may close these issues.

3 participants