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
63909299
Commit
63909299
authored
Mar 13, 2012
by
Peter Eastman
Browse files
Fixed bug where tuples would sometimes turn into lists when changing their units
parent
980280cb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
wrappers/python/simtk/unit/quantity.py
wrappers/python/simtk/unit/quantity.py
+2
-2
No files found.
wrappers/python/simtk/unit/quantity.py
View file @
63909299
...
...
@@ -550,13 +550,13 @@ class Quantity(object):
def
_scale_sequence
(
self
,
value
,
factor
,
post_multiply
):
try
:
if
post_multiply
:
if
isinstance
(
value
,
tuple
):
if
isinstance
(
self
.
_
value
,
tuple
):
value
=
tuple
([
x
*
factor
for
x
in
value
])
else
:
for
i
in
range
(
len
(
value
)):
value
[
i
]
=
value
[
i
]
*
factor
else
:
if
isinstance
(
value
,
tuple
):
if
isinstance
(
self
.
_
value
,
tuple
):
value
=
tuple
([
factor
*
x
for
x
in
value
])
else
:
for
i
in
range
(
len
(
value
)):
...
...
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