diff options
author | Clemens Barth <barth@root-1.de> | 2011-12-03 00:20:43 +0400 |
---|---|---|
committer | Clemens Barth <barth@root-1.de> | 2011-12-03 00:20:43 +0400 |
commit | ac76a43f80fa313dd8137b5e7760100af8148c09 (patch) | |
tree | 45ed3df23d0e7dda42aece2e9982cb390fa1e45c /io_mesh_pdb | |
parent | 47d6495586f6e1e2b9140820af9d87f4d5706702 (diff) |
Dear all.
Some large data classes (elements, atoms and sticks) use
__slots__
now.
Cheers,
Blendphys.
Diffstat (limited to 'io_mesh_pdb')
-rw-r--r-- | io_mesh_pdb/import_pdb.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/io_mesh_pdb/import_pdb.py b/io_mesh_pdb/import_pdb.py index ecf50204..8a860cbb 100644 --- a/io_mesh_pdb/import_pdb.py +++ b/io_mesh_pdb/import_pdb.py @@ -184,8 +184,9 @@ ATOM_PDB_ELEMENTS_DEFAULT = ( ATOM_PDB_ELEMENTS = [] # This is the class, which stores the properties for one element. -class CLASS_atom_pdb_Elements: # TODO, use __slots__ - def __init__(self, number, name,short_name, color, radii, radii_ionic): +class CLASS_atom_pdb_Elements(object): + __slots__ = ('number', 'name', 'short_name', 'color', 'radii', 'radii_ionic') + def __init__(self, number, name, short_name, color, radii, radii_ionic): self.number = number self.name = name self.short_name = short_name @@ -194,7 +195,8 @@ class CLASS_atom_pdb_Elements: # TODO, use __slots__ self.radii_ionic = radii_ionic # This is the class, which stores the properties of one atom. -class CLASS_atom_pdb_atom: # TODO, use __slots__ +class CLASS_atom_pdb_atom(object): + __slots__ = ('element', 'name', 'location', 'radius', 'color', 'material') def __init__(self, element, name, location, radius, color, material): self.element = element self.name = name @@ -204,7 +206,8 @@ class CLASS_atom_pdb_atom: # TODO, use __slots__ self.material = material # This is the class, which stores the two atoms of one stick. -class CLASS_atom_pdb_stick: # TODO, use __slots__ +class CLASS_atom_pdb_stick(object): + __slots__ = ('atom1', 'atom2') def __init__(self, atom1, atom2): self.atom1 = atom1 self.atom2 = atom2 |