Fix bug in cfdm.netcdf_indexer that sometimes caused a failure with a np.newaxis index#400
Conversation
sadielbartholomew
left a comment
There was a problem hiding this comment.
Makes the fix and adds suitable testing. I've also recreated the original issue using the MRE in #395 (comment) and confirmed this PR fixes it.
Some typos (see in-line) but other than that all good, so please merge once those are in.
| self.close(dataset0) | ||
| del dataset, dataset0 |
There was a problem hiding this comment.
Did you intend to remove these cleanup calls? If so what's the justification - were they redundant or made so?
There was a problem hiding this comment.
Ah yes - I did mean to move these :) It was a bug to have them higher because once closed, the self._attributes(variable) call a few lines below wouldn't work.
There was a problem hiding this comment.
Sorry - a bit confused. The correct close is lower down in the code - these deleted lines crept in, somewhere down the line and needed to be booted out.
There was a problem hiding this comment.
OK sure - so it's all good then? I can mark this as resolved or go for it if you want to.
Fixes #395