Skip to content

combine_by_coords() unexpectedly fails due to non-monotonic global indexes #5722

Answered by TomNicholas
jrmagers asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @jrmagers - thanks for this clear and reproducible bug report.

Whilst the coordinates are monotonic (the easiest way to check is to extract the underlying pandas index via ds.ref_level.to_index().is_monotonic), I think the problem is caused by the fact that your datasets do not have consistent lengths along ref_level. In fact

file 0B.nc has length 33 along 'ref_level'
file 1A.nc has length 48 along 'ref_level'
file 1B.nc has length 39 along 'ref_level'
file 0A.nc has length 50 along 'ref_level'

The combining is failing when it tries to decide how to align each tile, because the tiles are of different sizes, so they can't simply be lined up next to one another like you probably expecte…

Replies: 4 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@jrmagers
Comment options

@max-sixty
Comment options

@jrmagers
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by jrmagers
Comment options

You must be logged in to vote
1 reply
@TomNicholas
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants