Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tsoc
openmm
Commits
24eb8d48
"csrc/vscode:/vscode.git/clone" did not exist on "75890221c1897f89a63dfcc71734224279139d26"
Commit
24eb8d48
authored
Dec 10, 2013
by
peastman
Browse files
Pickling an Element object works correctly
parent
0cb269f5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
wrappers/python/simtk/openmm/app/element.py
wrappers/python/simtk/openmm/app/element.py
+6
-1
No files found.
wrappers/python/simtk/openmm/app/element.py
View file @
24eb8d48
...
...
@@ -35,8 +35,9 @@ __version__ = "1.0"
from
simtk.unit
import
daltons
import
copy_reg
class
Element
:
class
Element
(
object
)
:
"""An Element represents a chemical element.
The simtk.openmm.app.element module contains objects for all the standard chemical elements,
...
...
@@ -85,6 +86,10 @@ def get_by_symbol(symbol):
s
=
symbol
.
strip
().
upper
()
return
Element
.
_elements_by_symbol
[
s
]
def
_pickle_element
(
element
):
return
(
get_by_symbol
,
(
element
.
symbol
,))
copy_reg
.
pickle
(
Element
,
_pickle_element
)
hydrogen
=
Element
(
1
,
"hydrogen"
,
"H"
,
1.007947
*
daltons
)
deuterium
=
Element
(
1
,
"deuterium"
,
"D"
,
2.01355321270
*
daltons
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment