Are these lines (in particular the assignment of the `mask`) absolutely needed?  My recollection was that when you assign a field for a masked array that the mask comes along automatically.  You can just comment out one or both lines and see if tests pass. I started playing with this earlier today but then got sidetracked by other pressing matters.