Package glue :: Package ligolw :: Module array :: Class Array
[hide private]
[frames] | no frames]

Class Array

source code

     object --+            
              |            
 ligolw.Element --+        
                  |        
ligolw.EmptyElement --+    
                      |    
           ligolw.Array --+
                          |
                         Array

High-level Array element.

Nested Classes [hide private]
  ArrayName
Instance Methods [hide private]
 
__init__(self, *args)
Initialize a new Array element.
source code
 
get_shape(self)
Return a tuple of this array's dimensions.
source code
 
unlink(self)
Break internal references within the document tree rooted on this element to promote garbage collection.
source code

Inherited from ligolw.Array (private): _verifyChildren

Inherited from ligolw.EmptyElement: appendData

Inherited from ligolw.Element: appendChild, endElement, end_tag, getAttribute, getChildrenByAttributes, getElements, getElementsByTagName, hasAttribute, insertBefore, removeAttribute, removeChild, replaceChild, setAttribute, start_tag, write

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

Class Methods [hide private]
 
build(cls, name, array, dim_names=None)
Construct a LIGO Light Weight XML Array document subtree from a numpy array object.
source code
 
getArraysByName(cls, elem, name)
Return a list of arrays with name name under elem.
source code

Inherited from ligolw.Element: validattributes

Class Variables [hide private]

Inherited from ligolw.Array: tagName, validchildren

Properties [hide private]
  Name
The "Name" attribute.

Inherited from ligolw.Array: Type, Unit

Inherited from object: __class__

Method Details [hide private]

__init__(self, *args)
(Constructor)

source code 

Initialize a new Array element.

Overrides: object.__init__

build(cls, name, array, dim_names=None)
Class Method

source code 

Construct a LIGO Light Weight XML Array document subtree from a numpy array object.

Example:

>>> import numpy, sys
>>> a = numpy.arange(12, dtype = "double")
>>> a.shape = (4, 3)
>>> Array.build(u"test", a).write(sys.stdout)   # doctest: +NORMALIZE_WHITESPACE
<Array Type="real_8" Name="test:array">
        <Dim>3</Dim>
        <Dim>4</Dim>
        <Stream Delimiter=" " Type="Local">
                0 3 6 9
                1 4 7 10
                2 5 8 11
        </Stream>
</Array>

get_shape(self)

source code 

Return a tuple of this array's dimensions. This is done by querying the Dim children. Note that once it has been created, it is also possible to examine an Array object's .array attribute directly, and doing that is much faster.

unlink(self)

source code 

Break internal references within the document tree rooted on this element to promote garbage collection.

Overrides: ligolw.Element.unlink

Property Details [hide private]

Name

The "Name" attribute.

Get Method:
unreachable.getter(self)
Set Method:
unreachable.setter(self, value)
Delete Method:
unreachable.deleter(self)