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
4b2ef27c
Commit
4b2ef27c
authored
Jan 19, 2016
by
jchodera
Browse files
Fixed tests
parent
46f62eb2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
82 additions
and
84 deletions
+82
-84
wrappers/python/tests/TestModeller.py
wrappers/python/tests/TestModeller.py
+82
-84
No files found.
wrappers/python/tests/TestModeller.py
View file @
4b2ef27c
...
@@ -395,7 +395,7 @@ class TestModeller(unittest.TestCase):
...
@@ -395,7 +395,7 @@ class TestModeller(unittest.TestCase):
total_added
=
water_count
+
sodium_count
+
chlorine_count
total_added
=
water_count
+
sodium_count
+
chlorine_count
self
.
assertEqual
(
total_added
,
1364
)
self
.
assertEqual
(
total_added
,
1364
)
expected_ion_fraction
=
2.0
*
molar
/
(
55.4
*
molar
)
expected_ion_fraction
=
2.0
*
molar
/
(
55.4
*
molar
)
expected_ions
=
math
.
floor
(
total_added
*
expected_ion_fraction
/
2
+
0.5
)
expected_ions
=
math
.
floor
(
total_added
*
expected_ion_fraction
+
0.5
)
self
.
assertEqual
(
sodium_count
,
expected_ions
)
self
.
assertEqual
(
sodium_count
,
expected_ions
)
self
.
assertEqual
(
chlorine_count
,
expected_ions
)
self
.
assertEqual
(
chlorine_count
,
expected_ions
)
...
@@ -437,7 +437,7 @@ class TestModeller(unittest.TestCase):
...
@@ -437,7 +437,7 @@ class TestModeller(unittest.TestCase):
total_water_ions
=
water_count
+
sodium_count
+
chlorine_count
total_water_ions
=
water_count
+
sodium_count
+
chlorine_count
expected_ion_fraction
=
1.0
*
molar
/
(
55.4
*
molar
)
expected_ion_fraction
=
1.0
*
molar
/
(
55.4
*
molar
)
expected_chlorine
=
math
.
floor
((
total_water_ions
-
10
)
*
expected_ion_fraction
/
2
+
0.5
)
+
5
expected_chlorine
=
math
.
floor
((
total_water_ions
-
10
)
*
expected_ion_fraction
+
0.5
)
+
5
expected_sodium
=
expected_chlorine
if
neutralize
else
expected_chlorine
-
5
expected_sodium
=
expected_chlorine
if
neutralize
else
expected_chlorine
-
5
self
.
assertEqual
(
sodium_count
,
expected_sodium
)
self
.
assertEqual
(
sodium_count
,
expected_sodium
)
self
.
assertEqual
(
chlorine_count
,
expected_chlorine
)
self
.
assertEqual
(
chlorine_count
,
expected_chlorine
)
...
@@ -482,7 +482,7 @@ class TestModeller(unittest.TestCase):
...
@@ -482,7 +482,7 @@ class TestModeller(unittest.TestCase):
total_water_ions
=
water_count
+
sodium_count
+
chlorine_count
total_water_ions
=
water_count
+
sodium_count
+
chlorine_count
expected_ion_fraction
=
1.0
*
molar
/
(
55.4
*
molar
)
expected_ion_fraction
=
1.0
*
molar
/
(
55.4
*
molar
)
expected_sodium
=
math
.
floor
((
total_water_ions
-
10
)
*
expected_ion_fraction
/
2
+
0.5
)
+
5
expected_sodium
=
math
.
floor
((
total_water_ions
-
10
)
*
expected_ion_fraction
+
0.5
)
+
5
expected_chlorine
=
expected_sodium
if
neutralize
else
expected_sodium
-
5
expected_chlorine
=
expected_sodium
if
neutralize
else
expected_sodium
-
5
self
.
assertEqual
(
sodium_count
,
expected_sodium
)
self
.
assertEqual
(
sodium_count
,
expected_sodium
)
self
.
assertEqual
(
chlorine_count
,
expected_chlorine
)
self
.
assertEqual
(
chlorine_count
,
expected_chlorine
)
...
@@ -520,7 +520,7 @@ class TestModeller(unittest.TestCase):
...
@@ -520,7 +520,7 @@ class TestModeller(unittest.TestCase):
total_added
=
water_count
+
positive_ion_count
+
chlorine_count
total_added
=
water_count
+
positive_ion_count
+
chlorine_count
self
.
assertEqual
(
total_added
,
1364
)
self
.
assertEqual
(
total_added
,
1364
)
expected_ions
=
math
.
floor
(
total_added
*
expected_ion_fraction
/
2
+
0.5
)
expected_ions
=
math
.
floor
(
total_added
*
expected_ion_fraction
+
0.5
)
self
.
assertEqual
(
positive_ion_count
,
expected_ions
)
self
.
assertEqual
(
positive_ion_count
,
expected_ions
)
self
.
assertEqual
(
chlorine_count
,
expected_ions
)
self
.
assertEqual
(
chlorine_count
,
expected_ions
)
...
@@ -544,7 +544,7 @@ class TestModeller(unittest.TestCase):
...
@@ -544,7 +544,7 @@ class TestModeller(unittest.TestCase):
total_added
=
water_count
+
sodium_count
+
negative_ion_count
total_added
=
water_count
+
sodium_count
+
negative_ion_count
self
.
assertEqual
(
total_added
,
1364
)
self
.
assertEqual
(
total_added
,
1364
)
expected_ions
=
math
.
floor
(
total_added
*
expected_ion_fraction
/
2
+
0.5
)
expected_ions
=
math
.
floor
(
total_added
*
expected_ion_fraction
+
0.5
)
self
.
assertEqual
(
positive_ion_count
,
expected_ions
)
self
.
assertEqual
(
positive_ion_count
,
expected_ions
)
self
.
assertEqual
(
chlorine_count
,
expected_ions
)
self
.
assertEqual
(
chlorine_count
,
expected_ions
)
...
@@ -1083,5 +1083,3 @@ class TestModeller(unittest.TestCase):
...
@@ -1083,5 +1083,3 @@ class TestModeller(unittest.TestCase):
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
unittest
.
main
()
unittest
.
main
()
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