PSpace Class Reference
[classes for users]

Class to track metadata of SLIMpy objects. More...

Inheritance diagram for PSpace:

voidSpace VectorSpace

List of all members.

Public Member Functions

def __init__
 Constructor, create a space from another space or like a dict object.
def makeContaner
 Make a new container from the current parameters.
def newParameter
 create a new PSpace updated with new keys
def update
 update this PSpace with another
def __len__
 number of elements the space represents
def copy
 shallow copy
def has_key
 returns tr
def get_size
 returns size of field of scalars
def keys
 list of keys
def pop
 pop a key from the dict
Exceptions:
raises a KeyError if k is not a key in self and no default is given

def iteritems
def intersection
 intersection of this space and another
def union
 union of this space with another
def __eq__
def equal_keys
 True if self and other both have key k.
def itervalues
def values
def iterkeys
def setdefault
def has_unknown
def is_subspace
 true if self is a subspace of other.
def is_superspace
 true if self is a superspace of other.
def __contains__
 true if self is a contains k
def __getitem__
def __delitem__
def get
def __setitem__
def __repr__
def __str__

Public Attributes

 plugin

Static Public Attributes

tuple env = InstanceManager( )
 slimpy global variables
tuple plugin = property( _get_plugin ,_set_plugin)
 get and set property for self._plugin
tuple size = property( get_size )
 size property
tuple shape = property( _get_shape, _set_shape )
 shape property
tuple ndim = property( _get_ndim )
tuple params = property( _get_params )


Detailed Description

Class to track metadata of SLIMpy objects.

parameter is a simple tracking method to pass Metadata without being bound to each specific datatype methods are similar to a python dict

Definition at line 37 of file PSpace.py.


Member Function Documentation

def __init__ (   self,
  plugin,
  E,
  D 
)

Constructor, create a space from another space or like a dict object.

Parameters:
plugin a string name or a subclass of DataContainer
create a space from another space

Definition at line 53 of file PSpace.py.

def makeContaner (   self,
  command = None,
  tmp = None 
)

Make a new container from the current parameters.

Parameters:
command may be a string or a slimpy_base.Core.Command.Command.Command if the contaier is a temporary file
makeContaner( self, command=None ,tmp=None) -> Container Make a new container from the current parameters

Definition at line 89 of file PSpace.py.

def newParameter (   self,
  E,
  F 
)

create a new PSpace updated with new keys

Make a new parameter updated with the new keys, 'keys'

Definition at line 97 of file PSpace.py.

def update (   self,
  E,
  F 
)

update this PSpace with another

update this PSpace with another same as a python dict

Definition at line 107 of file PSpace.py.

def __len__ (   self  ) 

number of elements the space represents

Definition at line 123 of file PSpace.py.

def copy (   self  ) 

shallow copy

returns a shallow copy of self

Definition at line 131 of file PSpace.py.

def has_key (   self,
  k 
)

returns tr

Returns:
bool

Definition at line 137 of file PSpace.py.

def get_size (   self  ) 

returns size of field of scalars

Definition at line 187 of file PSpace.py.

def keys (   self  ) 

list of keys

Definition at line 212 of file PSpace.py.

def pop (   self,
  k,
  default 
)

pop a key from the dict

Exceptions:
raises a KeyError if k is not a key in self and no default is given

Definition at line 217 of file PSpace.py.

def iteritems (   self  ) 

See also:
dict
iterates over key value pairs in self

Definition at line 236 of file PSpace.py.

def intersection (   self,
  other 
)

intersection of this space and another

space.intersection( other ) -> Space

returns a Space object that is the Intersection of self and other contains the restrictions of each space the shared restrictions in each must be equal: i.e. if self contains restriction n1=5 and other -> n1=6 intersection method will raise error.

Definition at line 281 of file PSpace.py.

def union (   self,
  other,
  others 
)

union of this space with another

space.union( other, *others ) -> Space

returns the union of this space with another that is only the restrictions that are the same in both spaces

Definition at line 308 of file PSpace.py.

def __eq__ (   self,
  other 
)

Definition at line 321 of file PSpace.py.

def equal_keys (   self,
  other,
  k,
  accept_unknown = True 
)

True if self and other both have key k.

Parameters:
other PSpace object
accept_unknown if the value at key k for either self or other is an slimpy_base.Core.Interface.PSpace.UnknownValue then equal_keys returns accept_unknown
space.equal_keys( space2, key, accept_unknown=True ) -> bool returns true if key is present and equal in both spaces. If one value is UnknownValue then will return accept_unknown.

Definition at line 341 of file PSpace.py.

def itervalues (   self  ) 

Definition at line 351 of file PSpace.py.

def values (   self  ) 

Definition at line 353 of file PSpace.py.

def iterkeys (   self  ) 

Definition at line 355 of file PSpace.py.

def setdefault (   self,
  k,
  D = None 
)

Definition at line 358 of file PSpace.py.

def has_unknown (   self  ) 

Definition at line 361 of file PSpace.py.

def is_subspace (   self,
  other,
  accept_unknown = True 
)

true if self is a subspace of other.

space.is_subspace(other) <--> space in other returns true if self is a subspace of other.

Definition at line 371 of file PSpace.py.

def is_superspace (   self,
  other,
  accept_unknown = True 
)

true if self is a superspace of other.

Definition at line 393 of file PSpace.py.

def __contains__ (   self,
  k 
)

true if self is a contains k

Parameters:
k a PSpace a key in self or a vector
S.__contains__( k ) <-> k in S

Definition at line 402 of file PSpace.py.

def __getitem__ (   self,
  item 
)

Definition at line 410 of file PSpace.py.

def __delitem__ (   self,
  item 
)

Definition at line 413 of file PSpace.py.

def get (   self,
  k,
  default = None 
)

Definition at line 416 of file PSpace.py.

def __setitem__ (   self,
  item,
  val 
)

Definition at line 419 of file PSpace.py.

def __repr__ (   self  ) 

Definition at line 422 of file PSpace.py.

def __str__ (   self  ) 

Definition at line 426 of file PSpace.py.


Member Data Documentation

tuple env = InstanceManager( ) [static]

slimpy global variables

Definition at line 45 of file PSpace.py.

tuple plugin = property( _get_plugin ,_set_plugin) [static]

get and set property for self._plugin

Definition at line 78 of file PSpace.py.

tuple size = property( get_size ) [static]

size property

Definition at line 202 of file PSpace.py.

tuple shape = property( _get_shape, _set_shape ) [static]

shape property

Definition at line 204 of file PSpace.py.

tuple ndim = property( _get_ndim ) [static]

Definition at line 209 of file PSpace.py.

tuple params = property( _get_params ) [static]

Definition at line 229 of file PSpace.py.

Definition at line 57 of file PSpace.py.


The documentation for this class was generated from the following file:

Generated on Sun Aug 10 09:11:11 2008 for SLIMpy by  doxygen 1.5.6