Exemplo n.º 1
0
 def __getitem__(self, index):
     """ Searches row data for an array """
     if isinstance(index, str):
         name = index
     elif isinstance(index, int):
         name = self.GetRowData().GetArrayName(index)
     else:
         raise KeyError('Index ({}) not understood. Index must be a string name or a tuple of string name and string preference.'.format(index))
     return row_array(self, name)
Exemplo n.º 2
0
 def format_array(key):
     """Format array information for printing (internal helper)."""
     arr = row_array(self, key)
     dl, dh = self.get_data_range(key)
     dl = pyvista.FLOAT_FORMAT.format(dl)
     dh = pyvista.FLOAT_FORMAT.format(dh)
     if arr.ndim > 1:
         ncomp = arr.shape[1]
     else:
         ncomp = 1
     return row.format(key, arr.dtype, ncomp, dl, dh)