Parameters and Results

Parameter

class pypet.parameter.Parameter(full_name, data=None, comment='')

The standard container that handles access to simulation parameters.

Parameters are simple container objects for data values. They handle single values as well as the so called exploration array. An array containing multiple values which is accessed one after the other in individual simulation runs.

Parameter exploration is usually initiated through the trajectory see :func:~pypet.trajectory.Trajectory.explore and :func:~pypet.trajectory.Trajectory.expand.

To access the parameter’s data value one can call the f_get() method.

Parameters support the concept of locking. Once a value of the parameter has been accessed, the parameter cannot be changed anymore unless it is explicitly unlocked using f_unlock(). Locking prevents parameters from being changed during runtime of a simulation.

Supported data values for the parameter are

  • python natives (int, long, str, bool, float, complex),
  • numpy natives, arrays and matrices of type np.int8-64, np.uint8-64, np.float32-64, np.complex, np.str
  • python homogeneous non-nested tuples

Note that for larger numpy arrays it is recommended to use the ArrayParameter.

Example usage:

>>> param = Parameter('traffic.mobiles.ncars',data=42, comment='I am a neat example')
Parameters:
  • full_name – The full name of the parameter. Grouping can be achieved by using colons.
  • data

    A data value that is handled by the parameter. It is checked whether the parameter f_supports() the data. If not an TypeError is thrown. If the parameter becomes explored, the data value is kept as a default. After simulation the default value will be restored.

    The data can be accessed as follows:

    >>> param.f_get()
    42
    

    To change the data after parameter creation one can call f_set():

    >>> param.f_set(43)
    >>> print param.f_get()
    43
    
  • comment

    A useful comment describing the parameter. The comment can be changed later on using the ‘v_comment’ variable.

    >>> print param.v_comment
    >>> 'I am a neat example'
    
Raises:

AttributeError: If data is not supported by the parameter.

f_ann_to_string()

Returns annotations as string.

Equivalent to v_annotations.f_ann_to_str()

f_empty()

Erases all data in the parameter.

Does not erase data from disk. So if the parameter has been stored with a service to disk and is emptied, it can be restored by loading from disk.

Raises:ParameterLockedException: If the parameter is locked.
f_get()

Returns the current data value of the parameter and locks the parameter.

Example usage:

>>> param = Parameter('groupA.groupB.myparam', comment='I am a neat example')
>>> param.f_set(44.0)
>>> print parm.f_get()
>>> 44.0:
f_get_annotations(*args)

Returns annotations

Equivalent to v_annotations.f_get(*args)

f_get_array()

Returns an iterable to iterate over the values of the exploration array.

Note that the returned values should be either a copy of the exploration array or the array must be immutable, for example a python tuple.

return:immutable sequence

Example usage:

>>> param = Parameter('groupA.groupB.myparam',data=22, comment='I am a neat example')
>>> param._explore([42,43,43])
>>> print param.f_get_array()
>>> (42,43,44)

Returns an python tuple of the exploration array.

Example usage:

>>> param = Parameter('groupA.groupB.myparam',data=22, comment='I am a neat example')
>>> param._explore([42,43,43])
>>> print param.f_get_array()
>>> (42,43,44)
raises:TypeError: If parameter is not explored.
f_get_class_name()

Returns the name of the class i.e. return self.__class__.__name__

f_is_array()

Returns true if the parameter is explored and contains an exploration array.

f_is_empty()

True if no data has been assigned to the parameter.

>>> param = Parameter('myname.is.example', comment='I am _empty!')
>>> param.f_is_empty()
>>> True
>>> param.f_set(444)
>>> param.f_is_empty()
>>> False
f_is_root()

Returns whether the group is root (True for the trajectory and a single run object)

f_lock()

Locks the parameter and forbids further manipulation.

Changing the data value or exploration array of the parameter are no longer allowed.

f_set(data)

Sets specific values for a parameter.

Example usage:

>>> param = Parameter('groupA.groupB.myparam', comment='I am a neat example')
>>> param.f_set(44.0)
>>> print parm.f_get()
>>> 44.0
Raises:

ParameterLockedException: If parameter is locked.

TypeError:

If the parameter is an array or if the type of the data value is not supported by the parameter.

f_set_annotations(*args, **kwargs)

Sets Annotations

Equivalent to calling v_annotations.f_set(*args,**kwargs)

f_supports(data)

Checks if input data is supported by the parameter.

f_unlock()

Unlocks the locked parameter.

Please use it very carefully, or best do not use this function at all. There should better be no reason to unlock a locked parameter!

f_val_to_str()

String summary of the value handled by the parameter.

Note that representing the parameter as a string accesses its value, but for simpler debugging, this does not lock the parameter or counts as usage!

String is truncated if it is longer or equal to the value specified in :const:`~pypetconstants.HDF5_STRCOL_MAX_COMMENT_LENGTH

v_annotations

Annotation feature of a trajectory node.

Store some short additional information about your nodes here. If you use the standard HDF5 storage service, they will be stored as hdf5 node attributes.

v_comment

Should be a nice descriptive comment

v_creator_name

The name of the creator of the node, either the name of a single run (e.g. ‘run_00000009’) or ‘trajectory’.

Returns:String
v_depth

Depth of the node in the trajectory tree.

v_fast_accessible

A parameter is fast accessible if it is NOT empty!

v_full_copy

Whether or not the full parameter including the exploration array or only the current data is copied during pickling.

If you run your simulations in multiprocessing mode, the whole trajectory and all parameters need to be pickled and are sent to the individual processes. Each process than runs an individual point in the parameter space trajectory. As a consequence, you do not need the exploration array during these calculations. Thus, if the full copy mode is set to False the parameter is pickled without the exploration array and you can save memory.

If you want to access the full exploration array during individual runs, you need to set v_full_copy to True.

It is recommended NOT to do that in order to save memory and also do obey the philosophy that individual simulations are independent.

Example usage:

>>> import pickle
>>> param = Parameter('examples.fullcopy', data=333, comment='I show you how the copy mode works!')
>>> param._explore([1,2,3,4])
>>> dump=pickle.dumps(param)
>>> newparam = pickle.loads(dump)
>>> print newparam.f_get_array()
TypeError
>>> param.v_full_copy=True
>>> dump = pickle.dumps(param)
>>> newparam=pickle.loads(dump)
>>> print newparam.f_get_array()
(1,2,3,4)
v_full_name

The full name, relative to the root node.

The full name of a trajectory or single run is the empty string since it is root.

v_leaf

Whether node is a leaf or not (i.e. it is a group node)

v_location

Location relative to the root node.

The location of a trajectory or single run is the empty string since it is root.

v_locked

Whether or not the parameter is locked and prevents further modification

v_name

Name of the node

v_parameter

Whether the node is a parameter or not (i.e. a result)

ArrayParameter

class pypet.parameter.ArrayParameter(full_name, data=None, comment='')

Similar to the :func:`~pypet.parameter.Parameter, but recommended for large numpy arrays and python tuples.

The array parameter is a bit smarter in memory management than the parameter. If a numpy array is used several times within an exploration, only one numpy array is stored by the default HDF5 storage service. For each individual run references to the corresponding numpy array are stored.

Since the ArrayParameter inherits from Parameter it also supports all other native python types.

SparseParameter

class pypet.parameter.SparseParameter(full_name, data=None, comment='')

Parameter that handles scipy csr, csc, bsr and dia sparse matrices.

Sparse Parameter inherits from pypet.parameter.ArrayParameter and supports arrays and native python data as well.

f_supports(data)

Sparse matrices support scipy csr, csc, bsr and dia matrices and everything their parent class the ArrayParameter supports.

PickleParameter

class pypet.parameter.PickleParameter(full_name, data=None, comment='')

A parameter class that supports all picklable objects, and pickles everything!

If you use the default HDF5 storage service, the pickle dumps are stored on disk. Works similar to the array parameter regarding memory management.

f_supports(data)

There is no straightforward check if an object can be pickled and this function will always return True.

So you have to take care in advance that the item can be pickled.

Result

class pypet.parameter.Result(full_name, *args, **kwargs)

Light Container that stores tables and arrays.

Note that no sanity checks on individual data is made and you have to take care, that your data is understood by the storage service. It is assumed that results tend to be large and therefore sanity checks would be too expensive.

Data that can safely be stored into a Result are:

  • python natives (int, long, str, bool, float, complex),
  • numpy natives, arrays and matrices of type np.int8-64, np.uint8-64, np.float32-64, np.complex, np.str
  • python lists and tuples of the previous types (python natives + numpy natives and arrays) Lists and tuples are not allowed to be nested and must be homogeneous, i.e. only contain data of one particular type. Only integers, or only floats, etc.
  • python dictionaries of the previous types (not nested!), data can be heterogeneous, keys must be strings. For example, one key-value pair of string and int and one key-value pair of string and float, and so on.
  • pandas DataFrames
  • ObjectTable

Such values are either set on initialisation or with f_set()

Example usage:

>>> res = Result('supergroup.subgroup.myresult', comment='I am a neat example!'         [1000,2000], {'a':'b','c':'d'}, hitchhiker='Arthur Dent')
Parameters:
  • fullanme – The fullname of the result, grouping can be achieved by colons,
  • comment

    A useful comment describing the parameter. The comment can later on be changed using the v_comment variable

    >>> param.v_comment
    'I am a neat example!'
    
  • args – Data that is handled by the result. The first positional argument is stored with the name of the result. Following arguments are stored with name_X where X is the position of the argument.
  • kwargs

    Data that is handled by the result, it is kept by the result under the names specified by the keys of kwargs. Can be changed or more can be added via f_set()

    >>> print res.f_get(0)
    [1000,2000]
    >>> print res.f_get(1)
    {'a':'b','c':'d'}
    >>> print res.f_get('myresult')
    [1000,2000]
    >>> print res.f_get('hitchhiker')
    'ArthurDent'
    >>> print res.f_get('myresult','hitchhiker')
    ([1000,2000], 'ArthurDent')
    

Alternatively one can also use f_set()

>>> result.f_set('Uno',x='y')
>>> print result.f_get(0)
'Uno'
>>> print result.f_get('x')
'y'

Alternative method to put and retrieve data from the result container is via __getattr__ and __setattr__

>>> res.ford = 'prefect'
>>> res.ford
'prefect'
Raises:

AttributeError:

If the data format in args or kwargs is not known to the result. Checks type of outer data structure, i.e. checks if you have a list or dictionary. But it does not check on individual values within dicts or lists.

f_ann_to_string()

Returns annotations as string.

Equivalent to v_annotations.f_ann_to_str()

f_empty()

Removes all data from the result.

If the result has already been stored to disk via a trajectory and a storage service, the data on disk is not affected by f_empty.

Yet, this function is particularly useful if you have stored very large data to disk and you want to free some memory on RAM but still keep the skeleton of the result.

f_get(*args)

Returns items handled by the result.

If only a single name is given a single data item is returned, if several names are given, a list is returned. For integer inputs the result returns resultname_X.

If the result contains only a single entry you can call f_get() without arguments. If you call f_get() and the result contains more than one element a ValueError is thrown.

Parameters:args – strings-names or integers
Returns:Single data item or tuple of data

Example:

>>> res = Result('supergroup.subgroup.myresult', comment='I am a neat example!'         [1000,2000], {'a':'b','c':'d'}, hitchhiker='Arthur Dent')
>>> res.f_get('hitchhiker')
'Arthur Dent'
>>> res.f_get(0)
[1000,2000]
>>> res.f_get('hitchhiker', 'myresult')
('Arthur Dent', [1000,2000])
f_get_annotations(*args)

Returns annotations

Equivalent to v_annotations.f_get(*args)

f_get_class_name()

Returns the class name of the parameter or result or group, equivalent to return self.__class__.__name__

f_is_empty()

True if no data has been put into the result.

Also True if all data has been erased via f_empty().

f_is_root()

Returns whether the group is root (True for the trajectory and a single run object)

f_set(*args, **kwargs)

Method to put data into the result.

Parameters:
  • args – The first positional argument is stored with the name of the result. Following arguments are stored with name_X where X is the position of the argument.
  • kwargs – Arguments are stored with the key as name.
>>> res = Result('supergroup.subgroup.myresult', comment='I am a neat example!')
>>> res.f_set(333,42.0mystring='String!')
>>> res.f_get('myresult')
333
>>> res.f_get('myresult_1')
42.0
>>> res.f_get(1)
42.0
>>> res.f_get('mystring')
'String!'
f_set_annotations(*args, **kwargs)

Sets Annotations

Equivalent to calling v_annotations.f_set(*args,**kwargs)

f_set_single(name, item)

Sets a single data item to the result.

Raises AttributeError if the type of the data is not understood. Note that the type check is shallow. For example, if the data item is a list, the individual list elements are NOT checked whether their types are appropriate.

Parameters:
  • name – The name of the data item
  • item – The data item
Raises:

AttributeError

Example usage:

>>> res.f_set_single('answer', 42)
>>> res.f_get('answer')
>>> 42
f_to_dict(copy=True)

Returns all handled data as a dictionary

Parameters:copy – Whether the original dictionary or a shallow copy is returned. If you get the real thing, please do not modify it!
Returns:Data dictionary
f_val_to_str()

Summarizes data handled by the result as a string. Calls __str__ on all handled data if v_no_data_string=False, else only the name/key of the handled data is printed.

Returns:string
v_annotations

Annotation feature of a trajectory node.

Store some short additional information about your nodes here. If you use the standard HDF5 storage service, they will be stored as hdf5 node attributes.

v_comment

Should be a nice descriptive comment

v_creator_name

The name of the creator of the node, either the name of a single run (e.g. ‘run_00000009’) or ‘trajectory’.

Returns:String
v_depth

Depth of the node in the trajectory tree.

v_fast_accessible

A result is fast accessible if it contains exactly one item!

v_full_name

The full name, relative to the root node.

The full name of a trajectory or single run is the empty string since it is root.

v_leaf

Whether node is a leaf or not (i.e. it is a group node)

v_location

Location relative to the root node.

The location of a trajectory or single run is the empty string since it is root.

v_name

Name of the node

v_no_data_string
Whether or not to give a short summarizing string when calling
f_val_to_str().

Can be set to False if the evaluation of stored data into string is too costly.

v_parameter

Whether the node is a parameter or not (i.e. a result)

SparseResult

class pypet.parameter.SparseResult(full_name, *args, **kwargs)

Adds the support of scipy sparse matrices to the result.

Supported Formats are csr, csc, bsr, and dia. Supports also all data, handled by the standard result.

f_ann_to_string()

Returns annotations as string.

Equivalent to v_annotations.f_ann_to_str()

f_empty()

Removes all data from the result.

If the result has already been stored to disk via a trajectory and a storage service, the data on disk is not affected by f_empty.

Yet, this function is particularly useful if you have stored very large data to disk and you want to free some memory on RAM but still keep the skeleton of the result.

f_get(*args)

Returns items handled by the result.

If only a single name is given a single data item is returned, if several names are given, a list is returned. For integer inputs the result returns resultname_X.

If the result contains only a single entry you can call f_get() without arguments. If you call f_get() and the result contains more than one element a ValueError is thrown.

Parameters:args – strings-names or integers
Returns:Single data item or tuple of data

Example:

>>> res = Result('supergroup.subgroup.myresult', comment='I am a neat example!'         [1000,2000], {'a':'b','c':'d'}, hitchhiker='Arthur Dent')
>>> res.f_get('hitchhiker')
'Arthur Dent'
>>> res.f_get(0)
[1000,2000]
>>> res.f_get('hitchhiker', 'myresult')
('Arthur Dent', [1000,2000])
f_get_annotations(*args)

Returns annotations

Equivalent to v_annotations.f_get(*args)

f_get_class_name()

Returns the class name of the parameter or result or group, equivalent to return self.__class__.__name__

f_is_empty()

True if no data has been put into the result.

Also True if all data has been erased via f_empty().

f_is_root()

Returns whether the group is root (True for the trajectory and a single run object)

f_set(*args, **kwargs)

Method to put data into the result.

Parameters:
  • args – The first positional argument is stored with the name of the result. Following arguments are stored with name_X where X is the position of the argument.
  • kwargs – Arguments are stored with the key as name.
>>> res = Result('supergroup.subgroup.myresult', comment='I am a neat example!')
>>> res.f_set(333,42.0mystring='String!')
>>> res.f_get('myresult')
333
>>> res.f_get('myresult_1')
42.0
>>> res.f_get(1)
42.0
>>> res.f_get('mystring')
'String!'
f_set_annotations(*args, **kwargs)

Sets Annotations

Equivalent to calling v_annotations.f_set(*args,**kwargs)

f_set_single(name, item)

Sets a single data item to the result.

Raises AttributeError if the type of the data is not understood. Note that the type check is shallow. For example, if the data item is a list, the individual list elements are NOT checked whether their types are appropriate.

Parameters:
  • name – The name of the data item
  • item – The data item
Raises:

AttributeError

Example usage:

>>> res.f_set_single('answer', 42)
>>> res.f_get('answer')
>>> 42
f_to_dict(copy=True)

Returns all handled data as a dictionary

Parameters:copy – Whether the original dictionary or a shallow copy is returned. If you get the real thing, please do not modify it!
Returns:Data dictionary
f_val_to_str()

Summarizes data handled by the result as a string. Calls __str__ on all handled data if v_no_data_string=False, else only the name/key of the handled data is printed.

Returns:string
v_annotations

Annotation feature of a trajectory node.

Store some short additional information about your nodes here. If you use the standard HDF5 storage service, they will be stored as hdf5 node attributes.

v_comment

Should be a nice descriptive comment

v_creator_name

The name of the creator of the node, either the name of a single run (e.g. ‘run_00000009’) or ‘trajectory’.

Returns:String
v_depth

Depth of the node in the trajectory tree.

v_fast_accessible

A result is fast accessible if it contains exactly one item!

v_full_name

The full name, relative to the root node.

The full name of a trajectory or single run is the empty string since it is root.

v_leaf

Whether node is a leaf or not (i.e. it is a group node)

v_location

Location relative to the root node.

The location of a trajectory or single run is the empty string since it is root.

v_name

Name of the node

v_no_data_string
Whether or not to give a short summarizing string when calling
f_val_to_str().

Can be set to False if the evaluation of stored data into string is too costly.

v_parameter

Whether the node is a parameter or not (i.e. a result)

PickleResult

class pypet.parameter.PickleResult(full_name, *args, **kwargs)

Result that digest everything and simply pickles it!

Note that it is not checked whether data can be pickled, so take care that it works!

f_set_single(name, item)

Adds a single data item to the pickle result.

Note that it is NOT checked if the item can be pickled!

For Completeness: The Abstract Base Classes

class pypet.parameter.BaseParameter(full_name, comment='')

Abstract class that specifies the methods that need to be implemented for a trajectory parameter.

Parameters are simple container objects for data values. They handle single values as well as the so called exploration array. An array containing multiple values which are accessed one after the other in individual simulation runs.

Parameter exploration is usually initiated through the trajectory see :func:~pypet.trajectory.Trajectory.explore and expand().

To access the parameter’s data value one can call the f_get() method.

Parameters support the concept of locking. Once a value of the parameter has been accessed, the parameter cannot be changed anymore unless it is explicitly unlocked using f_unlock(). This prevents parameters from being changed during runtime of a simulation.

If multiprocessing is desired the parameter must be picklable!

Parameters:
  • fullname – The fullname of the parameter in the trajectory tree, groupings are separated by a colon: fullname = ‘supergroup.subgroup.paramname’
  • comment – A useful comment describing the parameter: comment = ‘Some useful text, dude!’
f_ann_to_string()

Returns annotations as string.

Equivalent to v_annotations.f_ann_to_str()

f_empty()

Erases all data in the parameter.

Does not erase data from disk. So if the parameter has been stored with a service to disk and is emptied, it can be restored by loading from disk.

Raises:ParameterLockedException: If the parameter is locked.
f_get()

Returns the current data value of the parameter and locks the parameter.

Example usage:

>>> param = Parameter('groupA.groupB.myparam', comment='I am a neat example')
>>> param.f_set(44.0)
>>> print parm.f_get()
>>> 44.0:
f_get_annotations(*args)

Returns annotations

Equivalent to v_annotations.f_get(*args)

f_get_array()

Returns an iterable to iterate over the values of the exploration array.

Note that the returned values should be either a copy of the exploration array or the array must be immutable, for example a python tuple.

Returns:immutable sequence

Example usage:

>>> param = Parameter('groupA.groupB.myparam',data=22, comment='I am a neat example')
>>> param._explore([42,43,43])
>>> print param.f_get_array()
>>> (42,43,44)
f_get_class_name()

Returns the name of the class i.e. return self.__class__.__name__

f_is_array()

Returns true if the parameter is explored and contains an exploration array.

f_is_empty()

True if no data has been assigned to the parameter.

>>> param = Parameter('myname.is.example', comment='I am _empty!')
>>> param.f_is_empty()
>>> True
>>> param.f_set(444)
>>> param.f_is_empty()
>>> False
f_is_root()

Returns whether the group is root (True for the trajectory and a single run object)

f_lock()

Locks the parameter and forbids further manipulation.

Changing the data value or exploration array of the parameter are no longer allowed.

f_set(data)

Sets specific values for a parameter.

Example usage:

>>> param = Parameter('groupA.groupB.myparam', comment='I am a neat example')
>>> param.f_set(44.0)
>>> print parm.f_get()
>>> 44.0
Raises:

ParameterLockedException: If parameter is locked.

TypeError:

If the parameter is an array or if the type of the data value is not supported by the parameter.

f_set_annotations(*args, **kwargs)

Sets Annotations

Equivalent to calling v_annotations.f_set(*args,**kwargs)

f_supports(data)

Checks whether the data is supported by the parameter.

f_unlock()

Unlocks the locked parameter.

Please use it very carefully, or best do not use this function at all. There should better be no reason to unlock a locked parameter!

f_val_to_str()

String summary of the value handled by the parameter.

Note that representing the parameter as a string accesses its value, but for simpler debugging, this does not lock the parameter or counts as usage!

String is truncated if it is longer or equal to the value specified in :const:`~pypetconstants.HDF5_STRCOL_MAX_COMMENT_LENGTH

v_annotations

Annotation feature of a trajectory node.

Store some short additional information about your nodes here. If you use the standard HDF5 storage service, they will be stored as hdf5 node attributes.

v_comment

Should be a nice descriptive comment

v_creator_name

The name of the creator of the node, either the name of a single run (e.g. ‘run_00000009’) or ‘trajectory’.

Returns:String
v_depth

Depth of the node in the trajectory tree.

v_fast_accessible

A parameter is fast accessible if it is NOT empty!

v_full_copy

Whether or not the full parameter including the exploration array or only the current data is copied during pickling.

If you run your simulations in multiprocessing mode, the whole trajectory and all parameters need to be pickled and are sent to the individual processes. Each process than runs an individual point in the parameter space trajectory. As a consequence, you do not need the exploration array during these calculations. Thus, if the full copy mode is set to False the parameter is pickled without the exploration array and you can save memory.

If you want to access the full exploration array during individual runs, you need to set v_full_copy to True.

It is recommended NOT to do that in order to save memory and also do obey the philosophy that individual simulations are independent.

Example usage:

>>> import pickle
>>> param = Parameter('examples.fullcopy', data=333, comment='I show you how the copy mode works!')
>>> param._explore([1,2,3,4])
>>> dump=pickle.dumps(param)
>>> newparam = pickle.loads(dump)
>>> print newparam.f_get_array()
TypeError
>>> param.v_full_copy=True
>>> dump = pickle.dumps(param)
>>> newparam=pickle.loads(dump)
>>> print newparam.f_get_array()
(1,2,3,4)
v_full_name

The full name, relative to the root node.

The full name of a trajectory or single run is the empty string since it is root.

v_leaf

Whether node is a leaf or not (i.e. it is a group node)

v_location

Location relative to the root node.

The location of a trajectory or single run is the empty string since it is root.

v_locked

Whether or not the parameter is locked and prevents further modification

v_name

Name of the node

v_parameter

Whether the node is a parameter or not (i.e. a result)

class pypet.parameter.BaseResult(full_name, comment='')

The basic api to store results.

Compared to parameters (see BaseParameter) results are also initialised with a fullname and a comment. As before grouping is achieved by colons in the name.

Example usage:

>>> result = Result(fullname='very.important.result',comment='I am important but empty :('
f_ann_to_string()

Returns annotations as string.

Equivalent to v_annotations.f_ann_to_str()

f_empty()

Removes all data from the result.

If the result has already been stored to disk via a trajectory and a storage service, the data on disk is not affected by f_empty.

Yet, this function is particularly useful if you have stored very large data to disk and you want to free some memory on RAM but still keep the skeleton of the result.

f_get_annotations(*args)

Returns annotations

Equivalent to v_annotations.f_get(*args)

f_get_class_name()

Returns the class name of the parameter or result or group, equivalent to return self.__class__.__name__

f_is_empty()

Returns true if no data is handled by a result or parameter

f_is_root()

Returns whether the group is root (True for the trajectory and a single run object)

f_set_annotations(*args, **kwargs)

Sets Annotations

Equivalent to calling v_annotations.f_set(*args,**kwargs)

f_val_to_str()

Returns a string summarizing the data handled by the parameter or result

v_annotations

Annotation feature of a trajectory node.

Store some short additional information about your nodes here. If you use the standard HDF5 storage service, they will be stored as hdf5 node attributes.

v_comment

Should be a nice descriptive comment

v_creator_name

The name of the creator of the node, either the name of a single run (e.g. ‘run_00000009’) or ‘trajectory’.

Returns:String
v_depth

Depth of the node in the trajectory tree.

v_fast_accessible

Whether or not fast access can be supported by the Parameter or Result

v_full_name

The full name, relative to the root node.

The full name of a trajectory or single run is the empty string since it is root.

v_leaf

Whether node is a leaf or not (i.e. it is a group node)

v_location

Location relative to the root node.

The location of a trajectory or single run is the empty string since it is root.

v_name

Name of the node

v_parameter

Whether the node is a parameter or not (i.e. a result)

Object Table

class pypet.parameter.ObjectTable(data=None, index=None, columns=None, copy=False)

Wrapper class for pandas data frames. It creates data frames with dtype=object.

Data stored into an object table preserves its original type when stored to disk. For instance, a python int is not automatically converted to a numpy 64 bit integer (np.int64).

The object table serves as a standard data structure to hand data to a storage service.