Package MDSplus :: Module connection :: Class Connection :: Class GetMany
[frames] | no frames]

Class GetMany

source code

  object --+        
           |        
        list --+    
               |    
  object --+   |    
           |   |    
mdsdata.Data --+    
               |    
        apd.List --+
                   |
                  Connection.GetMany

Build a list of expressions to evaluate

To reduce the number of network transactions between you and the remote system you can use the GetMany class to specify a list of expressions to be evaluated and then send that list to the remote system in one network transation. The remote system will then evaluate all of the expressions and return the answer in one response.

To use the GetMany class you can create an instance using the getMany() method of a Connection instance. You then use the GetMany.append(name,expression[,args]) method to add expressions to the list. Once the list is complete you then use the GetMany.execute() method to execute the expressions on the remote host and retrieve the answers. This will return a dictionary instance with the names assigned to the expressions as the key. Each name will have a dictionary instance containing the result of the execution of the expression. If this dictionary has an 'error' key then its value will be an error string, otherwise the dictionary should have a 'value' key containing the result.

The GetMany instance can be executed multiple times. For instance, if you want to get the same information from many different trees you could use the Connection.openTeee(tree,shot) method between executions of the same GetMany instance.

NOTE: MDSplus can currently only address objects less than 4 gigabytes. Therefore the maximum size of the expression list with arguments and the result dictionary is approximately 4 gigatypes.

Instance Methods
new list
__init__(self, value=None, connection=None)
GetMany instance initialization.
source code
None
append(self, name, exp, *args)
Append expression to the list.
source code
Data
execute(self)
Execute the list.
source code
Scalar or Array
get(self, name)
Get the result of an expression identified by name from the last invokation of the execute() method.
source code
None
insert(self, beforename, name, exp, *args)
Insert an expression in the list before the one named in the beforename argument.
source code
None
remove(self, name)
Remove first occurrence of expression identified by its name from the list.
source code

Inherited from apd.List: __str__, toApd

Inherited from list: __add__, __contains__, __delitem__, __delslice__, __eq__, __ge__, __getattribute__, __getitem__, __getslice__, __gt__, __hash__, __iadd__, __imul__, __iter__, __le__, __len__, __lt__, __mul__, __ne__, __new__, __repr__, __reversed__, __rmul__, __setitem__, __setslice__, count, extend, index, pop, reverse, sort

Inherited from mdsdata.Data: __abs__, __and__, __div__, __float__, __floordiv__, __int__, __invert__, __long__, __lshift__, __mod__, __neg__, __nonzero__, __or__, __pos__, __radd__, __rdiv__, __rfloordiv__, __rlshift__, __rmod__, __ror__, __rrshift__, __rshift__, __rsub__, __rxor__, __sub__, __xor__, bool, data, decompile, dim_of, evaluate, getByte, getByteArray, getDimensionAt, getDouble, getError, getFloat, getHelp, getInt, getIntArray, getLong, getLongArray, getShape, getShort, getShortArray, getString, getUnits, mayHaveChanged, pop_dollar_value, push_dollar_value, raw_of, serialize, setError, setHelp, setTdiVar, setUnits, sind, units_of, value_of

Inherited from object: __delattr__, __reduce__, __reduce_ex__, __setattr__

Static Methods

Inherited from mdsdata.Data: compile, deserialize, getTdiVar

Properties

Inherited from mdsdata.Data: descriptor, error, help, units, validation

Inherited from object: __class__

Method Details

__init__(self, value=None, connection=None)
(Constructor)

source code 

GetMany instance initialization.

Returns: new list
Raises:
  • TypeError - Raised if attempting to create an instance of Data
Overrides: object.__init__

append(self, name, exp, *args)

source code 

Append expression to the list.

Parameters:
  • name (str) - name to assign to the expression for identifying it in the result dictionary.
  • exp (str) - expression to be evaluated with placeholders for optional arguments
  • args (Data) - optional arguments to replace placeholders in the expression
Returns: None
Overrides: list.append

execute(self)

source code 

Execute the list. Send the list to the remote server for evaluation and return the answer as a dict instance.

Returns: Data
Overrides: mdsdata.Data.execute

get(self, name)

source code 

Get the result of an expression identified by name from the last invokation of the execute() method.

Parameters:
  • name (str) - name associated with an expression.
Returns: Scalar or Array
result of the expression evaluation.

insert(self, beforename, name, exp, *args)

source code 

Insert an expression in the list before the one named in the beforename argument.

Parameters:
  • beforename (str) - Insert the expression before this one
  • name (str) - Name to associate with the result of this expression
  • exp - TDI expression to be evaluated with optional placeholders for the arguments
  • args (Data) - Optional arguments to replace placeholders in the expression
  • expression (str)
Returns: None
Overrides: list.insert

remove(self, name)

source code 

Remove first occurrence of expression identified by its name from the list.

Parameters:
  • name (str) - Name of expression to be removed.
Returns: None
Overrides: list.remove