Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
blender-addons
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
blender
blender-addons
Commits
ac76a43f
Commit
ac76a43f
authored
13 years ago
by
Clemens Barth
Browse files
Options
Downloads
Patches
Plain Diff
Dear all. Some large data classes (elements, atoms and sticks) use __slots__ now. Cheers, Blendphys.
parent
47d64955
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
io_mesh_pdb/import_pdb.py
+7
-4
7 additions, 4 deletions
io_mesh_pdb/import_pdb.py
with
7 additions
and
4 deletions
io_mesh_pdb/import_pdb.py
+
7
−
4
View file @
ac76a43f
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment