CUDS

Abstract CUDS interfaces

Engine and Containers

ABCModelingEngine(*args, **kwargs) Abstract base class for modeling engines in SimPhoNy.
ABCMesh Abstract base class for mesh.
ABCParticles Abstract base class for a container of particles items.
ABCLattice Abstract base class for a lattice.

Description

class simphony.cuds.abc_mesh.ABCMesh[source]

Abstract base class for mesh.

name

str

name of mesh

__len__()[source]

Returns the total number of items in the container.

Returns:count – The number of items of item_type in the dataset.
Return type:int
add(items)[source]

Adds a set of objects from the provided iterable to the dataset.

If any object has no uids, the dataset will generate a new uid for it. If the object has already an uid, it won’t add the object if an object with the same type uid already exists. If the user wants to replace an existing object in the container there is an ‘update’ method for that purpose.

Parameters:iterable (iterable of objects) – the new set of objects that will be included in the container.
Returns:uids – The uids of the added objects.
Return type:list of uuid.UUID
Raises:ValueError : – when there is an object with an uids that already exists in the dataset.
get(uid)[source]

Returns a copy of the object with the ‘uid’ id.

Parameters:uid (uuid.UUID) – the uid of the object
Raises:KeyError : – when the object is not in the container.
Returns:A copy of the internally stored info.
Return type:object
has(uid)[source]

Checks if an object with the given uid already exists in the dataset.

Parameters:uid (uuid.UUID) – the uid of the object
Returns:
Return type:True if the uid is found, False otherwise.
has_type(item_type)[source]

Checks if the specified CUDSItem type is present in the dataset.

Parameters:item_type (CUDSItem) – The CUDSItem enum of the type.
Returns:
Return type:True if the type is present, False otherwise.
iter(uids=None, item_type=None)[source]

Generator method for iterating over the objects of the container.

It can receive any kind of sequence of uids to iterate over those concrete objects. If nothing is passed as parameter, it will iterate over all the objects.

Parameters:
  • uids (iterable of uuid.UUID, optional) – sequence containing the uids of the objects that will be iterated. When the uids are provided, then the objects are returned in the same order the uids are returned by the iterable. If uids is None, then all objects are returned by the iterable and there is no restriction on the order that they are returned.
  • item_type (CUDSItem) – Restricts the iteration to the specified type
Yields:

object (Particle) – The object item.

Raises:

KeyError : – if any of the ids passed as parameters are not in the dataset.

remove(uids)[source]

Remove the object with the provided uids from the container.

The uids inside the iterable should exists in the container. Otherwise an exception will be raised.

Parameters:uids (iterable of uuid.UUID) – the uids of the objects to be removed.
Raises:KeyError : – If any object doesn’t exist.
update(items)[source]

Updates a set of objects from the provided iterable.

Takes the uids of the objects and searches inside the dataset for those objects. If the object exists, they are replaced in the dataset. If any object doesn’t exist, it will raise an exception.

Parameters:iterable (iterable of objects) – the objects that will be replaced.
Raises:ValueError : – If any object inside the iterable does not exist.
class simphony.cuds.abc_particles.ABCParticles[source]

Abstract base class for a container of particles items.

name

str

name of particles item.

data

DataContainer

The data associated with the container

__len__()[source]

Returns the total number of items in the container.

Returns:count – The number of items in the dataset.
Return type:int
add(iterable)[source]

Adds a set of objects from the provided iterable to the dataset.

If any object has no uids, the dataset will generate a new uid for it. If the object has already an uid, it won’t add the object if an object with the same type uid already exists. If the user wants to replace an existing object in the container there is an ‘update’ method for that purpose.

Parameters:iterable (iterable of objects) – the new set of objects that will be included in the container.
Returns:uids – The uids of the added objects.
Return type:list of uuid.UUID
Raises:ValueError : – when there is an object with an uids that already exists in the dataset.
get(uid)[source]

Returns a copy of the object with the specified uid

Parameters:uid (uuid.UUID) – the uid of the bond
Raises:KeyError : – when the object is not in the container.
Returns:object – A copy of the internally stored object.
Return type:Particle or Bond
has(uid)[source]

Checks if an object with the given uid already exists in the dataset.

Parameters:uid (uuid.UUID) – the uid of the object
Returns:
Return type:True if the uid is found, False otherwise.
has_type(item_type)[source]

Checks if the specified CUDSItem type is present in the dataset.

Parameters:item_type (CUDSItem) – The CUDSItem enum of the type of the items to return the count of.
Returns:
Return type:True if the type is present, False otherwise.
iter(uids=None, item_type=None)[source]

Generator method for iterating over the objects of the container.

It can receive any kind of sequence of uids to iterate over those concrete objects. If nothing is passed as parameter, it will iterate over all the objects in undefined order.

Parameters:
  • uids (iterable of uuid.UUID, optional) – sequence containing the uids of the objects that will be iterated. When the uids are provided, then the objects are returned in the same order the uids are returned by the iterable. If uids is None, then all particles are returned by the iterable and there is no restriction on the order that they are returned.
  • item_type (CUDSItem enum) – Restricts iteration only to the specified item type. e.g. CUDSItem.PARTICLE will only iterate over particles.
Yields:

object (Particle or Bond) – The Particle or Bond item.

Raises:

KeyError : – if any of the ids passed as parameters are not in the container.

Examples

It can be used with a sequence as parameter or without it:

>>> part_container = Particles(name="foo")
>>> ...
>>> for particle in part_container.iter([uid1, uid2, uid3]):
        ...  #do stuff
        #take the particle back to the container so it will be updated
        #in case we need it
        part_container.update([particle])
>>> for particle in part_container.iter():
        ...  #do stuff; it will iterate over all the particles
        #take the particle back to the container so it will be updated
        #in case we need it
        part_container.update([particle])
remove(uids)[source]

Remove the object with the provided uids from the container.

The uids inside the iterable should exists in the container. Otherwise an exception will be raised.

Parameters:uids (iterable of uuid.UUID) – the uids of the objects to be removed.
Raises:KeyError : – If any object doesn’t exist.

Examples

Having a set of uids of existing objects, pass it to the method.

>>> particles = Particles(name="foo")
>>> ...
>>> particle1 = particles.get(uid1)
>>> particle2 = particles.get(uid2)
>>> ...
>>> particles.remove([part1.uid, part2.uid)
or directly
>>> particles.remove([uid1, uid2])
update(iterable)[source]

Updates objects from the provided iterable.

Takes the uids of the objects and searches inside the container for those objects. If they exists, they are replaced in the container. If any object doesn’t exist, it will raise an exception.

Parameters:iterable (iterable) – the objects (Particle or Bond) that will be replaced.
Raises:ValueError : – If any object inside the iterable does not exist.

Examples

Given a set of objects that already exists in the container (taken with the ‘get_particle’ method for example), just call the function passing the Particle items as parameter.

>>> part_container = Particles(name="foo")
>>> ...
>>> part1 = part_container.get(uid1)
>>> part2 = part_container.get(uid2)
>>> ... #do whatever you want with the particles
>>> part_container.update([part1, part2])
class simphony.cuds.abc_lattice.ABCLattice[source]

Abstract base class for a lattice.

name

str

name of lattice

primitive_cell

PrimitiveCell

primitive cell specifying the 3D Bravais lattice

size

int[3]

lattice dimensions

origin

float[3]

lattice origin

data

DataContainer

high level CUBA data assigned to lattice

__len__()[source]

Returns the total number of items in the container.

Returns:count – The number of items of item_type in the dataset.
Return type:int
add(iterable)[source]

Adds a set of objects from the provided iterable to the dataset.

Currently not implemented.

get(index)[source]

Returns a copy of the node with the given index

Parameters:index (int[3]) – node index coordinate
Raises:KeyError : – when the node is not in the container.
Returns:A copy of the internally stored info.
Return type:object
get_coordinate(ind)[source]

Get coordinate of the given index coordinate.

Parameters:ind (int[3]) – node index coordinate
Returns:coordinates
Return type:float[3]
has(index)[source]

iChecks if an object with the given index already exists in the dataset.

Not implemented.

has_type(item_type)[source]

Checks if the specified CUDSItem type is present in the dataset.

Not implemented

iter(indices=None, item_type=None)[source]

Generator method for iterating over the objects of the container.

It can receive any kind of sequence of indices to iterate over those concrete objects. If nothing is passed as parameter, it will iterate over all the objects.

Parameters:indices (list of int[3] or None) – sequence containing the indices of the objects that will be iterated. When the indices are provided, then the objects are returned in the same order the indices are returned by the iterable. If indices is None, then all objects are returned by the iterable and there is no restriction on the order that they are returned.
Yields:object (Node) – The Node item.
Raises:KeyError : – if any of the indices passed as parameters are not in the dataset.
primitive_cell
remove(index)[source]

Removes a set of nodes with the provided indexes from the dataset.

Currently not implemented.

update(iterable)[source]

Updates a set of nodes from the provided iterable.

Takes the indexes of the nodes and searches inside the dataset for those nodes objects. If the node exists, they are replaced in the dataset. If any node doesn’t exist, it will raise an exception.

Parameters:iterable (iterable of nodes) – the nodes that will be replaced.
Raises:ValueError : – If any node inside the iterable does not exist.

This module is part of simphony-common package. It contains wrappers base class.

class simphony.cuds.abc_modeling_engine.ABCModelingEngine(*args, **kwargs)[source]

Abstract base class for modeling engines in SimPhoNy.

Through this interface, the user controls and interacts with the simulation/calculation (which is being performed by the modeling engine).

BC

DataContainer

container of attributes related to the boundary conditions

CM

DataContainer

container of attributes related to the computational method

SP

DataContainer

container of attributes related to the system parameters/conditions

materials

Materials

materials related to state data

add_dataset(container)[source]

Add a CUDS container

Parameters:

container ({ABCMesh, ABCParticles, ABCLattice}) – The CUDS container to add to the engine.

Raises:
  • TypeError: – If the container type is not supported by the engine.
  • ValueError: – If there is already a dataset with the given name.
get_cuds()[source]

Get current CUDS instance.

get_dataset(name)[source]

Get the dataset

Parameters:name (str) – name of CUDS container to be retrieved.
Returns:A proxy of the dataset named name that is stored internally in the Engine.
Return type:container
Raises:ValueError: – If there is no dataset with the given name
get_dataset_names()[source]

Returns a list of the datasets’ names in the engine workspace.

iter_datasets(names=None)[source]

Returns an iterator over a subset or all of the containers.

Parameters:names (sequence of str, optional) – names of specific containers to be iterated over. If names is not given, then all containers will be iterated over.
remove_dataset(name)[source]

Remove a dataset from the engine

Parameters:name (str) – name of CUDS container to be deleted
Raises:ValueError: – If there is no dataset with the given name
run()[source]

Run the modeling engine

Run the modeling engine using the configured settings (e.g. CM, BC, and SP) and the configured state data (e.g. particle, mesh and lattice data).

CUDS Computational Model

Container and Simulation

CUDS([name, description]) Common Universal Data Structure, i.e.
Simulation(cuds, engine_name[, ...]) A CUDS computational model simulation.

Description

CUDS computational model implementation.

This module contains the classes used to represent a computational model, based on SimPhoNy metadata.

class simphony.cuds.model.CUDS(name=None, description=None)[source]

Common Universal Data Structure, i.e. CUDS computational model.

This is the main data structure to hold all the information regarding a computational model. Having the data provided by this class, one should be able to start a new computational model based on that with no extra information.

Parameters:
  • name (str) – Name of this CUDS
  • description (str) – More information about this CUDS
add(component)[source]

Add a component to the CUDS computational model.

This will replace any existing value with the same uid.

Parameters:

component (CUDSComponent) – a CUDS component according to the SimPhoNy metadata

Raises:
  • TypeError – if the component is not a CUDS component
  • ValueError – if a component with the same name already exists
data

Data container for CUDS items.

get(name)[source]

Get the corresponding component from the CUDS computational model.

Parameters:name (str) – name of the component
Returns:component – the corresponding CUDS component or None
Return type:CUDSComponent
Raises:TypeError – if the name is not a non empty string
get_by_uid(uid)[source]

Get the corresponding component from the CUDS computational model.

Parameters:uid (uuid.UUID) – uid of the component
Returns:component – the corresponding CUDS component
Return type:CUDSComponent
get_names(component_type)[source]

Get names of the components of the given type.

Parameters:component_type (CUDSComponent class) – a component of CUDS, reflecting SimPhoNy metadata
Returns:names – names of the items of the given type
Return type:list
iter(component_type)[source]

Returns an iterator for the components of the given type.

Parameters:component_type (CUDSComponent class) – a component of CUDS, reflecting SimPhoNy metadata
Yields:iterator over the components of the given type
remove(name)[source]

Remove the corresponding component from the CUDS computational model.

Parameters:

name (str) – name of the component to be removed

Raises:
  • KeyError – if no component exists of the given name
  • TypeError – if the name is not a non empty string
remove_by_uid(uid)[source]

Remove the corresponding component from the CUDS computational model.

Parameters:uid (uuid.UUID) – uid of the component to be removed
Raises:KeyError – if no component exists of the given uid
uid

Contains simulation controllers.

class simphony.cuds.simulation.Simulation(cuds, engine_name, engine_interface=None, name=None, description=None)[source]

A CUDS computational model simulation.

Parameters:
  • cuds (CUDS) – Model information.
  • engine_name (str) – Name of the underlying engine.
  • engine_interface (engine.EngineInterface) – The interface to the engine, internal or fileio.
  • name (str) – A custom name for this simulation
  • description (str) – More information about this simulation
get_cuds()[source]

Return the latest CUDS from the engine.

Returns:cuds – the most recent CUDS.
Return type:CUDS
run(*args, **kwargs)[source]

Run the simulation.

Pure Python implementation

Classes

PrimitiveCell(p1, p2, p3, bravais_lattice) A primitive cell of a Bravais lattice.
BravaisLattice The 3D Bravais lattices
Lattice(name, primitive_cell, size, origin) A Bravais lattice.
LatticeNode(index[, data]) A single node of a lattice.
Particles(name) Class that represents a container of particles and bonds.
Bond(particles[, uid, data]) Class representing a bond.
Particle([coordinates, uid, data]) Class representing a particle.
Mesh(name) Mesh object to store points and elements.
Point(coordinates[, uid, data]) Coordinates describing a point in the space
Edge(points[, uid, data]) Edge element
Face(points[, uid, data]) Face element
Cell(points[, uid, data]) Cell element

Functions

make_cubic_lattice(name, h, size[, origin]) Create and return a 3D cubic lattice.
make_body_centered_cubic_lattice(name, h, size) Create and return a 3D body-centered cubic lattice.
make_face_centered_cubic_lattice(name, h, size) Create and return a 3D face-centered cubic lattice.
make_rhombohedral_lattice(name, h, angle, size) Create and return a 3D rhombohedral lattice.
make_tetragonal_lattice(name, hxy, hz, size) Create and return a 3D tetragonal lattice.
make_body_centered_tetragonal_lattice(name, ...) Create and return a 3D body-centered tetragonal lattice.
make_hexagonal_lattice(name, hxy, hz, size) Create and return a 3D hexagonal lattice.
make_orthorhombic_lattice(name, hs, size[, ...]) Create and return a 3D orthorhombic lattice.
make_body_centered_orthorhombic_lattice(...) Create and return a 3D body-centered orthorhombic lattice.
make_face_centered_orthorhombic_lattice(...) Create and return a 3D face-centered orthorhombic lattice.
make_base_centered_orthorhombic_lattice(...) Create and return a 3D base-centered orthorhombic lattice.
make_monoclinic_lattice(name, hs, beta, size) Create and return a 3D monoclinic lattice.
make_base_centered_monoclinic_lattice(name, ...) Create and return a 3D base-centered monoclinic lattice.
make_triclinic_lattice(name, hs, angles, size) Create and return a 3D triclinic lattice.

Implementation

class simphony.cuds.lattice.Lattice(name, primitive_cell, size, origin)[source]

A Bravais lattice. Stores references to data containers (node related data).

name

str

name of lattice

primitive_cell

PrimitiveCell

primitive cell specifying the 3D Bravais lattice

size

int[3]

lattice dimensions

origin

float[3]

lattice origin

data

DataContainer

high level CUBA data assigned to lattice

count_of(item_type)[source]

Return the count of item_type in the container.

Parameters:item_type (CUBA) – The CUBA enum of the type of the items to return the count of.
Returns:count – The number of items of item_type in the container.
Return type:int
Raises:ValueError : – If the type of the item is not supported in the current container.
data
origin
size
simphony.cuds.lattice.make_base_centered_monoclinic_lattice(name, hs, beta, size, origin=(0, 0, 0))[source]

Create and return a 3D base-centered monoclinic lattice.

Parameters:
  • name (str) –
  • hs (float) – lattice spacing in each axis direction
  • beta (float) – angle between the (conventional) unit cell edges (in radians),
  • size (int[3]) – Number of lattice nodes in each axis direction.
  • origin (float[3], default value = (0, 0, 0)) – lattice origin
Returns:

lattice – A reference to a Lattice object.

Return type:

Lattice

simphony.cuds.lattice.make_base_centered_orthorhombic_lattice(name, hs, size, origin=(0, 0, 0))[source]

Create and return a 3D base-centered orthorhombic lattice.

Parameters:
  • name (str) –
  • hs (float[3]) – lattice spacings in each axis direction
  • size (int[3]) – Number of lattice nodes in each axis direction.
  • origin (float[3], default value = (0, 0, 0)) – lattice origin
Returns:

lattice – A reference to a Lattice object.

Return type:

Lattice

simphony.cuds.lattice.make_body_centered_cubic_lattice(name, h, size, origin=(0, 0, 0))[source]

Create and return a 3D body-centered cubic lattice.

Parameters:
  • name (str) –
  • h (float) – lattice spacing
  • size (int[3]) – Number of lattice nodes in each axis direction.
  • origin (float[3], default value = (0, 0, 0)) – lattice origin
Returns:

lattice – A reference to a Lattice object.

Return type:

Lattice

simphony.cuds.lattice.make_body_centered_orthorhombic_lattice(name, hs, size, origin=(0, 0, 0))[source]

Create and return a 3D body-centered orthorhombic lattice.

Parameters:
  • name (str) –
  • hs (float[3]) – lattice spacings in each axis direction
  • size (int[3]) – Number of lattice nodes in each axis direction.
  • origin (float[3], default value = (0, 0, 0)) – lattice origin
Returns:

lattice – A reference to a Lattice object.

Return type:

Lattice

simphony.cuds.lattice.make_body_centered_tetragonal_lattice(name, hxy, hz, size, origin=(0, 0, 0))[source]

Create and return a 3D body-centered tetragonal lattice.

Parameters:
  • name (str) –
  • hxy (float) – lattice spacing in the xy-plane
  • hz (float) – lattice spacing in the z-direction
  • size (int[3]) – Number of lattice nodes in each axis direction.
  • origin (float[3], default value = (0, 0, 0)) – lattice origin
Returns:

lattice – A reference to a Lattice object.

Return type:

Lattice

simphony.cuds.lattice.make_cubic_lattice(name, h, size, origin=(0, 0, 0))[source]

Create and return a 3D cubic lattice.

Parameters:
  • name (str) –
  • h (float) – lattice spacing
  • size (int[3]) – Number of lattice nodes in each axis direction.
  • origin (float[3], default value = (0, 0, 0)) – lattice origin
Returns:

lattice – A reference to a Lattice object.

Return type:

Lattice

simphony.cuds.lattice.make_face_centered_cubic_lattice(name, h, size, origin=(0, 0, 0))[source]

Create and return a 3D face-centered cubic lattice.

Parameters:
  • name (str) –
  • h (float) – lattice spacing
  • size (int[3]) – Number of lattice nodes in each axis direction.
  • origin (float[3], default value = (0, 0, 0)) – lattice origin
Returns:

lattice – A reference to a Lattice object.

Return type:

Lattice

simphony.cuds.lattice.make_face_centered_orthorhombic_lattice(name, hs, size, origin=(0, 0, 0))[source]

Create and return a 3D face-centered orthorhombic lattice.

Parameters:
  • name (str) –
  • hs (float[3]) – lattice spacings in each axis direction
  • size (int[3]) – Number of lattice nodes in each axis direction.
  • origin (float[3], default value = (0, 0, 0)) – lattice origin
Returns:

lattice – A reference to a Lattice object.

Return type:

Lattice

simphony.cuds.lattice.make_hexagonal_lattice(name, hxy, hz, size, origin=(0, 0, 0))[source]

Create and return a 3D hexagonal lattice.

Parameters:
  • name (str) –
  • hxy (float) – lattice spacing in the xy-plane
  • hz (float) – lattice spacing in the z-direction
  • size (int[3]) – Number of lattice nodes in each axis direction.
  • origin (float[3], default value = (0, 0, 0)) – lattice origin
Returns:

lattice – A reference to a Lattice object.

Return type:

Lattice

simphony.cuds.lattice.make_monoclinic_lattice(name, hs, beta, size, origin=(0, 0, 0))[source]

Create and return a 3D monoclinic lattice.

Parameters:
  • name (str) –
  • hs (float[3]) – lattice spacings in each axis direction
  • beta (float) – angle between the (conventional) unit cell edges (in radians),
  • size (int[3]) – Number of lattice nodes in each axis direction.
  • origin (float[3], default value = (0, 0, 0)) – lattice origin
Returns:

lattice – A reference to a Lattice object.

Return type:

Lattice

simphony.cuds.lattice.make_orthorhombic_lattice(name, hs, size, origin=(0, 0, 0))[source]

Create and return a 3D orthorhombic lattice.

Parameters:
  • name (str) –
  • hs (float[3]) – lattice spacings in each axis direction
  • size (int[3]) – Number of lattice nodes in each axis direction.
  • origin (float[3], default value = (0, 0, 0)) – lattice origin
Returns:

lattice – A reference to a Lattice object.

Return type:

Lattice

simphony.cuds.lattice.make_rhombohedral_lattice(name, h, angle, size, origin=(0, 0, 0))[source]

Create and return a 3D rhombohedral lattice.

Parameters:
  • name (str) –
  • h (float) – lattice spacing
  • angle (float) – angle between the (conventional) unit cell edges (in radians)
  • size (int[3]) – Number of lattice nodes in each axis direction.
  • origin (float[3], default value = (0, 0, 0)) – lattice origin
Returns:

lattice – A reference to a Lattice object.

Return type:

Lattice

simphony.cuds.lattice.make_tetragonal_lattice(name, hxy, hz, size, origin=(0, 0, 0))[source]

Create and return a 3D tetragonal lattice.

Parameters:
  • name (str) –
  • hxy (float) – lattice spacing in the xy-plane
  • hz (float) – lattice spacing in the z-direction
  • size (int[3]) – Number of lattice nodes in each axis direction.
  • origin (float[3], default value = (0, 0, 0)) – lattice origin
Returns:

lattice – A reference to a Lattice object.

Return type:

Lattice

simphony.cuds.lattice.make_triclinic_lattice(name, hs, angles, size, origin=(0, 0, 0))[source]

Create and return a 3D triclinic lattice.

Parameters:
  • name (str) –
  • hs (float[3]) – lattice spacings in each axis direction
  • angles (float[3]) – angles between the (conventional) unit cell edges (in radians)
  • size (int[3]) – Number of lattice nodes in each axis direction.
  • origin (float[3], default value = (0, 0, 0)) – lattice origin
Returns:

lattice – A reference to a Lattice object.

Return type:

Lattice

Mesh module

This module contains the implementation to store, access, and modify a mesh

class simphony.cuds.mesh.Mesh(name)[source]

Mesh object to store points and elements.

Stores general mesh information Points and Elements such as Edges, Faces and Cells and provide the methods to interact with them. The methods are divided in four different blocks:

  1. methods to get the related item with the provided uid;
  2. methods to add a new item or replace;
  3. generator methods that return iterators over all or some of the mesh items and;
  4. inspection methods to identify if there are any edges, faces or cells described in the mesh.
Parameters:name (str) – name of mesh
name

str

name of mesh

data

Data

Data relative to the mesh.

points

dictionary of Point

Points of the mesh.

edges

dictionary of Edge

Edges of the mesh.

faces

dictionary of Face

Faces of the mesh.

cells

dictionary of Cell

Cells of the mesh.

count_of(item_type)[source]

Return the count of item_type in the container.

Parameters:item_type (CUBA) – The CUBA enum of the type of the items to return the count of.
Returns:count – The number of items of item_type in the container.
Return type:int
Raises:ValueError : – If the type of the item is not supported in the current container.
data
class simphony.cuds.particles.Particles(name)[source]

Class that represents a container of particles and bonds.

Class provides methods to add particles and bonds, remove them and update them.

name

str

name of the particle container

_particles

dict

data structure for particles storage

_bonds

dict

data structure for bonds storage

data

DataContainer

data attributes of the element

count_of(item_type)[source]

Return the count of item_type in the container.

Parameters:item_type (CUBA) – The CUBA enum of the type of the items to return the count of.
Returns:count – The number of items of item_type in the container.
Return type:int
Raises:ValueError : – If the type of the item is not supported in the current container.
data