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
d6710744
Commit
d6710744
authored
Oct 07, 2015
by
M J Harvey
Browse files
add kwargs to constructor
parent
b2900404
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
wrappers/python/simtk/openmm/app/charmmparameterset.py
wrappers/python/simtk/openmm/app/charmmparameterset.py
+9
-4
No files found.
wrappers/python/simtk/openmm/app/charmmparameterset.py
View file @
d6710744
...
@@ -100,7 +100,7 @@ class CharmmParameterSet(object):
...
@@ -100,7 +100,7 @@ class CharmmParameterSet(object):
except
ValueError
:
except
ValueError
:
raise
CharmmFileError
(
'Could not convert %s to %s'
%
(
msg
,
type
))
raise
CharmmFileError
(
'Could not convert %s to %s'
%
(
msg
,
type
))
def
__init__
(
self
,
*
args
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
# Instantiate the list types
# Instantiate the list types
self
.
atom_types_str
=
dict
()
self
.
atom_types_str
=
dict
()
self
.
atom_types_int
=
dict
()
self
.
atom_types_int
=
dict
()
...
@@ -135,8 +135,13 @@ class CharmmParameterSet(object):
...
@@ -135,8 +135,13 @@ class CharmmParameterSet(object):
raise
TypeError
(
'Unrecognized file type: %s'
%
arg
)
raise
TypeError
(
'Unrecognized file type: %s'
%
arg
)
else
:
else
:
raise
TypeError
(
'Unrecognized file type: %s'
%
arg
)
raise
TypeError
(
'Unrecognized file type: %s'
%
arg
)
permissive
=
kwargs
.
pop
(
"permissive"
,
False
)
if
len
(
kwargs
):
raise
TypeError
(
'Unrecognised named argument'
)
for
top
in
tops
:
self
.
readTopologyFile
(
top
)
for
top
in
tops
:
self
.
readTopologyFile
(
top
)
for
par
in
pars
:
self
.
readParameterFile
(
par
)
for
par
in
pars
:
self
.
readParameterFile
(
par
,
permissive
=
permissive
)
for
strf
in
strs
:
self
.
readStreamFile
(
strf
)
for
strf
in
strs
:
self
.
readStreamFile
(
strf
)
@
classmethod
@
classmethod
...
@@ -489,13 +494,13 @@ class CharmmParameterSet(object):
...
@@ -489,13 +494,13 @@ class CharmmParameterSet(object):
if
permissive
:
if
permissive
:
try
:
try
:
idx
=
max
(
self
.
atom_types_int
.
keys
())
+
1000
idx
=
max
(
self
.
atom_types_int
.
keys
())
+
1000
except
:
except
ValueError
:
idx
=
10000
idx
=
10000
for
key
in
nonbonded_types
:
for
key
in
nonbonded_types
:
if
not
key
in
self
.
atom_types_str
:
if
not
key
in
self
.
atom_types_str
:
atype
=
AtomType
(
name
=
key
,
number
=
idx
,
mass
=
float
(
'NaN'
),
atomic_number
=
1
)
atype
=
AtomType
(
name
=
key
,
number
=
idx
,
mass
=
float
(
'NaN'
),
atomic_number
=
1
)
self
.
atom_types_str
[
key
]
=
atype
self
.
atom_types_str
[
key
]
=
atype
self
.
atom_types_int
[
key
]
=
atype
self
.
atom_types_int
[
idx
]
=
atype
idx
=
idx
+
1
idx
=
idx
+
1
# Now we're done. Load the nonbonded types into the relevant AtomType
# Now we're done. Load the nonbonded types into the relevant AtomType
...
...
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