Skip to content
This repository has been archived by the owner on Apr 23, 2021. It is now read-only.

Commit

Permalink
Merge pull request #328 from simphony/generic-interface-particles-2
Browse files Browse the repository at this point in the history
Generic interface for particles
  • Loading branch information
mehdisadeghi committed Nov 7, 2016
2 parents a7f8c9a + 07eb002 commit 95afad3
Show file tree
Hide file tree
Showing 13 changed files with 598 additions and 300 deletions.
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

0 comments on commit 95afad3

Please sign in to comment.