Unidata/netcdf4-python — pull request #224 by shoyer (2014-03-06 07:04:21+00:00)
Title: Allow creating and setting variables with numpy string arrays

This patch automatically converts numpy string datatypes of length > 1 into
`str` when used as arguments to `createVariable`, and allows for setting
arrays with numpy string datatypes (they are converted internally into arrays
with dtype=object, but the user doesn't need to know that detail).

The reason for this patch is for consistency: I expected that if `array.dtype`
is not a valid argument argument to `createVariable`, then it isn't possible
to create (or fill) a Variable with the values of the `numpy.ndarray` `array`.
Strings are the exception to this rule. This patch eliminates this quirk in a
manner that I believe will be backwards compatible, since only strings of
length 1 (character arrays) are a supported primitive datatype.

If this looks good to you, I will add this feature to the Change Log and the
documentation in my next commit.