3.1.5.4. c3po.multi1D.Multi1DAPI module

Inheritance diagram of c3po.multi1D.Multi1DAPI

Contain the classes Multi1DAPI and Multi1DWithObjectsAPI.

class c3po.multi1D.Multi1DAPI.Multi1DAPI

Bases: ABC

Multi1DAPI is an abstract class handling a set of 1D object.

abstractmethod getCellSizes(index)

Return the list of the sizes of the cells of the 1D object with the required index.

Note

The length of the returned list should be equal to getNumberOfCells().

Parameters:

index – Index of the queried 1D object.

Returns:

List with the sizes of the cells of the required 1D object.

Return type:

list

abstractmethod getNature(fieldName)

Return the nature of the field fieldName, which mush be available for getValues(), using MEDCoupling enum.

Parameters:

fieldName – Name of the field.

Return type:

Nature of the field.

abstractmethod getNumberOfCells(index)

Return the number of cells of the 1D object with the required index.

Parameters:

index – Index of the queried 1D object .

Return type:

The number of cells in the required 1D object.

abstractmethod getSize()

Return the number of 1D objects handled by self.

Return type:

The number of 1D objects.

abstractmethod getValues(index, fieldName)

Return the values of the field fieldName for the 1D object with the required index.

Note

The length of the returned list should be equal to getNumberOfCells().

Parameters:
  • index – Index of the queried 1D object.

  • fieldName – Name of the field.

Returns:

List of values.

Return type:

list

abstractmethod setValues(index, fieldName, values)

Set the values of the field fieldName to the 1D object with the required index.

Note

The length of values should be equal to getNumberOfCells().

Parameters:
  • index – Index of the queried 1D object.

  • fieldName – Name of the field.

  • values (list) – List of values to set.

class c3po.multi1D.Multi1DAPI.Multi1DWithObjectsAPI

Bases: Multi1DAPI

Multi1DWithObjectsAPI is an abstract class that extends Multi1DAPI with the possibility for each 1D object to hold internal objects.

These internal objects are named. They can differ from one 1D object to another. Values may be written and read from (or on) these internal objects. They may not be all involved in every set or get.

abstractmethod getObjectNames(index)

Return the list of list of the names of the internal objects hold by the 1D object with the required index at each cell.

Note

The length of the returned list should be equal to getNumberOfCells().

Parameters:

index – Index of the queried 1D object.

Returns:

List (for each cell) of list of internal object names.

Return type:

list

abstractmethod getObjectNamesInField(fieldName)

Return the list of the names of the internal objects that are involved in get / set methods for the field fieldName.

Note

The names of all involved internal object should be listed, even if they appear in only one cell of one 1D object.

The ordering of the names must be coherent with getObjectValues() and setObjectValues() behavior.

Note

This method returns an empty list if the field is known but does not involve any internal object. It means that the field should be handled using Multi1DAPI methods. If the field is totally unknown, an exception is raised.

Parameters:

fieldName – Name of the field.

Returns:

List of internal object names involved in the required field.

Return type:

list

abstractmethod getObjectValues(index, fieldName)

Return the list of list of the values for the field fieldName for the 1D object with the required index (for each object and for each cell).

Note

The length of the returned list should be equal to the lenght of the list returned by getObjectNamesInField(fieldName).

For every i, the length of the i-th components of the return list should be equal to getNumberOfCells(index).

Parameters:
  • index – Index of the queried 1D object.

  • fieldName – Name of the field.

Returns:

List of list of values.

Return type:

list

abstractmethod setObjectValues(index, fieldName, values)

Set the values for the field fieldName to the 1D object with the required index (for each object and for each cell).

Note

The length of values should be equal to the lenght of the list returned by getObjectNamesInField(fieldName).

For every i, the length of values[i] should be equal to getNumberOfCells(index).

Parameters:
  • index – Index of the queried 1D object.

  • fieldName – Name of the field.

  • values (list) – List of list of values to set.