qubx :: tree :: Node_numpy_NoMap :: Class Node_numpy_NoMap
[hide private]
[frames] | no frames]

Class Node_numpy_NoMap

source code

object --+
         |
        Node_numpy_NoMap

Represents the (sub-)tree under a particular node in a qub tree. Read-only.

Solves the (mainly 32-bit) problem of opening files that don't fit in address space, by leaving non-preload data on disk until node.data.read_rows().

Instantiated by Open_numpy when memory runs out.

Instance Methods [hide private]
 
__init__(self, storage)
Creates a new node, in memory, with name.
source code
 
__del__(self) source code
 
__repr__(self)
repr(x)
source code
 
__str__(self)
str(x)
source code
 
__re_str(self, fi, indent='') source code
 
__str_data(self, fi, indent) source code
 
__str_datas(self, cf, fi, indent) source code
 
print_summary(self, indent='') source code
 
__nonzero__(self) source code
 
__len__(self)
Returns the number of child nodes.
source code
 
__getitem__(self, key)
Returns a child node, by number or by name.
source code
 
set_name(self, x) source code
 
set_data(self, x) source code
 
get_lineComment(self) source code
 
set_lineComment(self, x) source code
 
get_parent(self) source code
 
get_path(self) source code
 
get_root(self) source code
 
clone(self, deep=True, file=None)
Returns a copy of the (sub-)tree rooted here, copied into file, or else in-memory.
source code
 
get_modified(self)
Returns whether anything's different from on disk.
source code
 
saveAs(self, path, as_copy=False)
Creates a new file at path, moves the (sub-)tree rooted here into the file, and save()s.
source code
 
saveAsText(self, path)
Writes a text representation of the (sub-)tree rooted here, to path on disk.
source code
 
save(self) source code
 
re_read(self)
Recursively reads storage and instantiates child and sibling nodes, during Open.
source code
 
close(self) source code
 
getBytes(self)
Returns the binary representation of the (sub-)tree rooted here, just as it would be on disk, as a string.
source code
 
__re_measure(self)
Returns the number of bytes needed to store the (sub-)tree rooted here.
source code
 
re_map_data(self) source code
 
list(self)
Returns the names of all child Nodes.
source code
 
find(self, name)
Returns the first child with name, or the NullNode.
source code
 
next(self, name)
Returns the next sibling with name, or the NullNode.
source code
 
nextSameName(self)
Returns the next sibling with name == self.name, or the NullNode.
source code
 
append(self, childOrName) source code
 
insert(self, childOrName, after=None) source code
 
appendClone(self, other, deep=True) source code
 
insertClone(self, other, deep=True, after=None) source code
 
remove(self, child, re_store=True) source code
 
setChanged(self)
artifact from when data edits didn't go memmap straight to disk; had to be marked changed; does nothing.
source code
 
lock(self, timeoutMS=None)
the native flavor has a mutex, mainly to protect the ref-count.
source code
 
unlock(self)
the native flavor has a mutex, mainly to protect the ref-count.
source code

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

Properties [hide private]
  name
the label
  data
read: the Data object managing this node's data.
  lineComment
read/write the string data of the child named QTR_LINE_COMMENT
  isNull
  child
first child Node, or the NullNode
  sibling
sibling Node, or the NullNode
  parent
parent Node, or the NullNode
  path
path of the open file containing this node, or ''
  modified
whether this or any child...
  root
the head of the tree, with no parent; possibly self.
  __child
  __data
  __dirtee
  __parent
  __sibling
  storage

Inherited from object: __class__

Method Details [hide private]

__init__(self, storage)
(Constructor)

source code 

Creates a new node, in memory, with name.

Internal use only: Manages existing NodeStorage.

Overrides: object.__init__

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)

__getitem__(self, key)
(Indexing operator)

source code 

Returns a child node, by number or by name. If by name, and None, returns a newly-appended Node.

clone(self, deep=True, file=None)

source code 

Returns a copy of the (sub-)tree rooted here, copied into file, or else in-memory. If not deep, skips the children.

get_modified(self)

source code 

Returns whether anything's different from on disk. Adjusts child and sibling positions first in case anything's moved.

saveAs(self, path, as_copy=False)

source code 

Creates a new file at path, moves the (sub-)tree rooted here into the file, and save()s. This node becomes the root.

Parameters:
  • as_copy - (def False) if True: may save a copy without re-parenting anything (faster) if overall size <= MAX_QUICK_WRITE_BYTES

lock(self, timeoutMS=None)

source code 

the native flavor has a mutex, mainly to protect the ref-count. This flavor does nothing.

unlock(self)

source code 

the native flavor has a mutex, mainly to protect the ref-count. This flavor does nothing.


Property Details [hide private]

name

the label

Get Method:
unreachable(self)
Set Method:
unreachable(self, x)

data

read: the Data object managing this node's data.

Get Method:
unreachable(self)
Set Method:
unreachable(self, x)

lineComment

read/write the string data of the child named QTR_LINE_COMMENT

Get Method:
unreachable(self)
Set Method:
unreachable(self, x)

isNull

Get Method:
unreachable(self)

child

first child Node, or the NullNode

Get Method:
unreachable(self)

sibling

sibling Node, or the NullNode

Get Method:
unreachable(self)

parent

parent Node, or the NullNode

Get Method:
unreachable(self)

path

path of the open file containing this node, or ''

Get Method:
unreachable(self)

modified

whether this or any child... has changed since Open or save(as)

Get Method:
unreachable(self)

root

the head of the tree, with no parent; possibly self.

Get Method:
unreachable(self)