#NEWLINE# @ classmethod #NEWLINE# def from_sctype( class_ , sctype , shape = ( ) , dflt = None ) : #NEWLINE# #INDENT# "Create an Atom from a NumPy scalar type sctype.\n\n        Optional shape and default value may be specified as the\n        shape and dflt\n        arguments, respectively. Information in the\n        sctype not represented in an Atom is ignored::\n\n            >>> import numpy\n            >>> Atom.from_sctype(numpy.int16, shape=(2, 2))\n            Int16Atom(shape=(2, 2), dflt=0)\n            >>> Atom.from_sctype('S5', dflt='hello')\n            Traceback (most recent call last):\n            ...\n            ValueError: unknown NumPy scalar type: 'S5'\n            >>> Atom.from_sctype('Float64')\n            Float64Atom(shape=(), dflt=0.0)\n\n        " #NEWLINE# if ( ( not isinstance ( sctype , type ) ) or ( not issubclass ( sctype , numpy . generic ) ) ) : #NEWLINE# #INDENT# if ( sctype not in numpy . sctypeDict ) : #NEWLINE# #INDENT# raise ValueError ( ( 'unknown NumPy scalar type: %r' % ( sctype , ) ) ) #NEWLINE# #UNINDENT# sctype = numpy . sctypeDict [ sctype ] #NEWLINE# #UNINDENT# return class_ . from_dtype ( numpy . dtype ( ( sctype , shape ) ) , dflt )