Data Model version 2.1.2
Acknowledgements
Diagram | Class Map | Attribute Map | Method Map | Help | License
Home | Package | Class | Attribute | Method: { prev | next }

Method: sizeFirstDim


    Change size in first (slowest) dimension, truncating or padding with self.defaultValue as necessary.

guid: www.ccpn.ac.uk_Fogh_2011-03-30-18:05:06_00012__www.ccpn.ac.uk_Fogh_2011-04-05-18:08:58_00001
OpType: otherModify
OpSubType: None
isQuery: False
isAbstract: False
Scope: instance_level
Code: if value < 0:
  raise ApiError("Dimension size must be non-negative: %s" % value)

shapeList = self.__dict__['shape'] # must bypass API
lendiff = value - shapeList[0]
if lendiff:
  data = self.__dict__['data'] # must bypass API
  if data:
    # if data array is empty we have an all-default matrix
    if lendiff > 0:
      data.extend([self.defaultValue]*self.pointToIndex((lendiff,)))
    else:
      # lendiff < 0
      del data[self.pointToIndex((lendiff,)):]
  shapeList[0] = value
  Data Model Version 2.1.2
Go to Top  
  Autogenerated by  PyApiDocGen  revision 1.3   on  Fri Mar 28 11:18:50 2014    from data model package  ccp.api.nmr.NmrCalc.FloatMatrixData   revision ?  
  Work done by the CCPN team.
www.ccpn.ac.uk