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
e370c346
Unverified
Commit
e370c346
authored
Oct 02, 2024
by
Peter Eastman
Committed by
GitHub
Oct 02, 2024
Browse files
Improved performance of writeModel() (#4679)
parent
bcc3442e
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
0 deletions
+4
-0
wrappers/python/openmm/app/dcdfile.py
wrappers/python/openmm/app/dcdfile.py
+1
-0
wrappers/python/openmm/app/pdbfile.py
wrappers/python/openmm/app/pdbfile.py
+1
-0
wrappers/python/openmm/app/pdbxfile.py
wrappers/python/openmm/app/pdbxfile.py
+1
-0
wrappers/python/openmm/app/xtcfile.py
wrappers/python/openmm/app/xtcfile.py
+1
-0
No files found.
wrappers/python/openmm/app/dcdfile.py
View file @
e370c346
...
@@ -122,6 +122,7 @@ class DCDFile(object):
...
@@ -122,6 +122,7 @@ class DCDFile(object):
if
is_quantity
(
positions
):
if
is_quantity
(
positions
):
positions
=
positions
.
value_in_unit
(
nanometers
)
positions
=
positions
.
value_in_unit
(
nanometers
)
import
numpy
as
np
import
numpy
as
np
positions
=
np
.
asarray
(
positions
)
if
np
.
isnan
(
positions
).
any
():
if
np
.
isnan
(
positions
).
any
():
raise
ValueError
(
'Particle position is NaN. For more information, see https://github.com/openmm/openmm/wiki/Frequently-Asked-Questions#nan'
)
raise
ValueError
(
'Particle position is NaN. For more information, see https://github.com/openmm/openmm/wiki/Frequently-Asked-Questions#nan'
)
if
np
.
isinf
(
positions
).
any
():
if
np
.
isinf
(
positions
).
any
():
...
...
wrappers/python/openmm/app/pdbfile.py
View file @
e370c346
...
@@ -344,6 +344,7 @@ class PDBFile(object):
...
@@ -344,6 +344,7 @@ class PDBFile(object):
if
is_quantity
(
positions
):
if
is_quantity
(
positions
):
positions
=
positions
.
value_in_unit
(
angstroms
)
positions
=
positions
.
value_in_unit
(
angstroms
)
import
numpy
as
np
import
numpy
as
np
positions
=
np
.
asarray
(
positions
)
if
np
.
isnan
(
positions
).
any
():
if
np
.
isnan
(
positions
).
any
():
raise
ValueError
(
'Particle position is NaN. For more information, see https://github.com/openmm/openmm/wiki/Frequently-Asked-Questions#nan'
)
raise
ValueError
(
'Particle position is NaN. For more information, see https://github.com/openmm/openmm/wiki/Frequently-Asked-Questions#nan'
)
if
np
.
isinf
(
positions
).
any
():
if
np
.
isinf
(
positions
).
any
():
...
...
wrappers/python/openmm/app/pdbxfile.py
View file @
e370c346
...
@@ -419,6 +419,7 @@ class PDBxFile(object):
...
@@ -419,6 +419,7 @@ class PDBxFile(object):
if
is_quantity
(
positions
):
if
is_quantity
(
positions
):
positions
=
positions
.
value_in_unit
(
angstroms
)
positions
=
positions
.
value_in_unit
(
angstroms
)
import
numpy
as
np
import
numpy
as
np
positions
=
np
.
asarray
(
positions
)
if
np
.
isnan
(
positions
).
any
():
if
np
.
isnan
(
positions
).
any
():
raise
ValueError
(
'Particle position is NaN. For more information, see https://github.com/openmm/openmm/wiki/Frequently-Asked-Questions#nan'
)
raise
ValueError
(
'Particle position is NaN. For more information, see https://github.com/openmm/openmm/wiki/Frequently-Asked-Questions#nan'
)
if
np
.
isinf
(
positions
).
any
():
if
np
.
isinf
(
positions
).
any
():
...
...
wrappers/python/openmm/app/xtcfile.py
View file @
e370c346
...
@@ -91,6 +91,7 @@ class XTCFile(object):
...
@@ -91,6 +91,7 @@ class XTCFile(object):
if
is_quantity
(
positions
):
if
is_quantity
(
positions
):
positions
=
positions
.
value_in_unit
(
nanometers
)
positions
=
positions
.
value_in_unit
(
nanometers
)
import
numpy
as
np
import
numpy
as
np
positions
=
np
.
asarray
(
positions
)
if
np
.
isnan
(
positions
).
any
():
if
np
.
isnan
(
positions
).
any
():
raise
ValueError
(
raise
ValueError
(
"Particle position is NaN. For more information, see https://github.com/openmm/openmm/wiki/Frequently-Asked-Questions#nan"
"Particle position is NaN. For more information, see https://github.com/openmm/openmm/wiki/Frequently-Asked-Questions#nan"
...
...
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