Module EDUtilsArray :: Class EDUtilsArray
[hide private]
[frames] | no frames]

Class EDUtilsArray

source code

object --+
         |
        EDUtilsArray

This is a static utility class for handling numpy like arrays in XML.

Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Methods [hide private]
 
arrayToXSData(cls, _array, _bIncludeMd5sum=True, _bForceNoNumpy=False, _bUseAsserts=False)
convert a numpy array or a list of list into an XSDataArray object
source code
 
xsDataToArray(cls, _xsdata, _bCheckMd5sum=True, _bForceNoNumpy=False, _bUseAsserts=False)
convert a XSDataArray into either a numpy array or a list of list
source code
 
getArray(cls, _inputObject)
Tries to retrieve a numpy array from an Image or from a shared array or an XSD object
source code
Class Variables [hide private]
  dTypeSize = {'float32': 4, 'float64': 8, 'int16': 2, 'int32': ...
  dTypeFormat = {'float32': 'f', 'float64': 'd', 'int16': 'h', '...
  semArrayToXSData = Semaphore()
  semXsDataToArray = Semaphore()
  semGetArray = Semaphore()
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

arrayToXSData(cls, _array, _bIncludeMd5sum=True, _bForceNoNumpy=False, _bUseAsserts=False)
Class Method

source code 

convert a numpy array or a list of list into an XSDataArray object

Parameters:
  • _array - numpy array or array-like list
  • _bIncludeMd5sum - should the md5sum be added to the XSDataArray instance. It is useful when sending object through the network It is a problem for testing
  • _bForceNoNumpy - enables tests without numpy
  • includeMd5sum (boolean)
Returns:
XSDataArray instance

xsDataToArray(cls, _xsdata, _bCheckMd5sum=True, _bForceNoNumpy=False, _bUseAsserts=False)
Class Method

source code 

convert a XSDataArray into either a numpy array or a list of list

Parameters:
  • _xsdata - XSDataArray instance
  • checkMd5sum - Check if the data are correct based on the checksum It is useful when sending object through the network It is a problem for testing
  • _bForceNoNumpy (boolean) - enables tests without numpy
  • _bCheckMd5sum (boolean)
Returns:
numpy array or array-like list depending on what is available on the computer

getArray(cls, _inputObject)
Class Method

source code 

Tries to retrieve a numpy array from an Image or from a shared array or an XSD object

As this method returns a numpy array, this method works only on plateform where numpy is available.

Parameters:
  • _inputObject - XSDataArray or XSDataImageExt or XSDataFile
Returns:
numpy ndarray

Class Variable Details [hide private]

dTypeSize

Value:
{'float32': 4,
 'float64': 8,
 'int16': 2,
 'int32': 4,
 'int64': 8,
 'int8': 1,
 'uint16': 2,
 'uint32': 4,
...

dTypeFormat

Value:
{'float32': 'f',
 'float64': 'd',
 'int16': 'h',
 'int32': 'l',
 'int64': 'q',
 'int8': 'b',
 'uint16': 'H',
 'uint32': 'L',
...