Thursday, August 25, 2011

CDMS inconsistency

Not sure this counts as a bug, but it is a weird inconsistency.

>>> import cdms
>>> s1 ="")
>>> s2 ="")
>>> s3 ="")
>>> s4 ="")

>>> d1 = s1['FLNSOI']
>>> d2 = s2['FLNSOI']
>>> d3 = s3['FLNSOI']
>>> d4 = s4['FLNSOI']

>>> dd1 = d1 - d3
>>> dd2 = d2 - d4

>>> d1.getAxis(0).id
>>> d2.getAxis(0).id
>>> d3.getAxis(0).id
>>> d4.getAxis(0).id

>>> dd1.getAxis(0).id
>>> dd2.getAxis(0).id

The second behavior occurs repeatably on three out of 180 file pairs, was hard to track down, and prevented the NCO ncrcat command from working. Fortunately the workaround is easy.

>>> dd2.setAxisList(d2.getAxisList())

But it's baffling how this even happens. All of the files were created by the NCO ncra command. Probably it is correct to do this and there is no guarantee that an axis list will be inherited after a calculation. But why does it USUALLY happen? These files are all produced by the same processes!

I'd prefer to have my mind read every time or never, not 59 times out of 60.

This wasted three hours of my life.

No comments:

Post a Comment