def testMakeDescr(self): """Check the generation of a descr from formats and names. """ common.verbosePrint('\nTesting getDescr function') mix = [f for f in nriterators.getDescr(None, self.formats)] self.assertEqual(mix, self.autoNamedDescr) mix = \ [f for f in nriterators.getDescr(self.names, self.formats)] self.assertEqual(mix, self.descr)
def makeDescr(formats, names=None): """ Create a ``descr`` list for the array. If no `names` are passed fields are automatically named as ``c1``, ``c2``... """ return [item for item in nriterators.getDescr(names, formats)]