There's a misunderstanding here: the shrink
option flag prevents the compression of the mask in operations, not at creation. To get an explicit mask (as a boolean array full of False
), use the mask=False
flag at creation instead.
Nevertheless, I agree it should be considered a bug. Nice catch.
When no explicit mask is given, the default is nomask
, a special value corresponding to np.bool_(0)
: it's a numpy boolean scalar with a value of False
, and like any numpy scalar, a shape
of ()
and a size of 1.
Note the difference between mask=False
and mask=nomask
: mask=False
will create a mask as a ndarray with the same shape as the data but full of False
(that's a shortcut), while mask=nomask
just tell np.ma
that the mask is not set (which speeds up computations).