Skip to content
This repository was archived by the owner on Apr 23, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion bench/cuds_file_bench.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@

from .util import bench
from simphony.io.h5_cuds import H5CUDS
from simphony.cuds.particles import Particle, Particles
from simphony.cuds.particles import Particles
from simphony.cuds.particles_items import Particle

particles = [
Particle(coordinates=(0.0, 1.1, 2.2)) for i in range(10000)]
Expand Down
3 changes: 2 additions & 1 deletion simphony/cuds/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
from .mesh import Mesh
from .mesh_items import Point, Element, Edge, Face, Cell
from .lattice import Lattice, LatticeNode
from .particles import Particles, Particle, Bond
from .particles import Particles
from .particles_items import Particle, Bond
from .model import CUDS
from .simulation import Simulation
from .meta import api
Expand Down
9 changes: 7 additions & 2 deletions simphony/cuds/abc_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,14 @@ def iter(self, uids=None, item_type=None): # pragma: no cover
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 enum
Restricts iteration only to the specified item type.
e.g. CUDSItem.PARTICLE will only iterate over particles in
a Particles container.

Yields
------
object : Particle
object :
The object item.

Raises
Expand Down Expand Up @@ -180,7 +185,7 @@ def __len__(self):
Returns
-------
count : int
The number of items of item_type in the dataset.
The number of items in the dataset.
"""

def __contains__(self, item):
Expand Down
Loading