Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
parser-cpmd
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
nomad-lab
parser-cpmd
Commits
faa02a1f
Commit
faa02a1f
authored
8 years ago
by
Lauri Himanen
Browse files
Options
Downloads
Patches
Plain Diff
Removed unnecessary access of results by index 0 from test cases.
parent
bc6c6072
Branches
Branches containing commit
Tags
1.2.0
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/unittests/cpmd_4.1/run_tests.py
+9
-8
9 additions, 8 deletions
test/unittests/cpmd_4.1/run_tests.py
with
9 additions
and
8 deletions
test/unittests/cpmd_4.1/run_tests.py
+
9
−
8
View file @
faa02a1f
...
@@ -210,13 +210,13 @@ class TestSinglePoint(unittest.TestCase):
...
@@ -210,13 +210,13 @@ class TestSinglePoint(unittest.TestCase):
def
test_section_method_atom_kind
(
self
):
def
test_section_method_atom_kind
(
self
):
kind
=
self
.
results
[
"
section_method_atom_kind
"
][
0
]
kind
=
self
.
results
[
"
section_method_atom_kind
"
][
0
]
self
.
assertEqual
(
kind
[
"
method_atom_kind_atom_number
"
]
[
0
]
,
1
)
self
.
assertEqual
(
kind
[
"
method_atom_kind_atom_number
"
],
1
)
self
.
assertEqual
(
kind
[
"
method_atom_kind_label
"
]
[
0
]
,
"
H
"
)
self
.
assertEqual
(
kind
[
"
method_atom_kind_label
"
],
"
H
"
)
def
test_section_method_basis_set
(
self
):
def
test_section_method_basis_set
(
self
):
kind
=
self
.
results
[
"
section_method_basis_set
"
][
0
]
kind
=
self
.
results
[
"
section_method_basis_set
"
][
0
]
self
.
assertEqual
(
kind
[
"
method_basis_set_kind
"
]
[
0
]
,
"
wavefunction
"
)
self
.
assertEqual
(
kind
[
"
method_basis_set_kind
"
],
"
wavefunction
"
)
self
.
assertTrue
(
np
.
array_equal
(
kind
[
"
mapping_section_method_basis_set_cell_associated
"
]
[
0
]
,
0
))
self
.
assertTrue
(
np
.
array_equal
(
kind
[
"
mapping_section_method_basis_set_cell_associated
"
],
0
))
def
test_single_configuration_to_calculation_method_ref
(
self
):
def
test_single_configuration_to_calculation_method_ref
(
self
):
result
=
self
.
results
[
"
single_configuration_to_calculation_method_ref
"
]
result
=
self
.
results
[
"
single_configuration_to_calculation_method_ref
"
]
...
@@ -671,15 +671,16 @@ class TestMDPrintSettings(unittest.TestCase):
...
@@ -671,15 +671,16 @@ class TestMDPrintSettings(unittest.TestCase):
systems
=
results
[
"
section_system
"
]
systems
=
results
[
"
section_system
"
]
for
i_scc
,
scc
in
sccs
.
items
():
for
i_scc
,
scc
in
sccs
.
items
():
ref
=
scc
[
"
single_configuration_calculation_to_system_ref
"
]
[
0
]
ref
=
scc
[
"
single_configuration_calculation_to_system_ref
"
]
system
=
systems
[
ref
]
system
=
systems
[
ref
]
pos
=
system
[
"
atom_positions
"
]
pos
=
system
[
"
atom_positions
"
]
vel
=
system
[
"
atom_velocities
"
]
vel
=
system
[
"
atom_velocities
"
]
forces
=
scc
[
"
atom_forces
"
]
forces
=
scc
[
"
atom_forces
"
]
if
i_scc
%
3
==
0
:
if
i_scc
%
3
==
0
:
self
.
assertNotEqual
(
pos
,
None
)
pass
self
.
assertNotEqual
(
vel
,
None
)
self
.
assertFalse
(
pos
is
None
)
self
.
assertNotEqual
(
forces
,
None
)
self
.
assertFalse
(
vel
is
None
)
self
.
assertFalse
(
forces
is
None
)
else
:
else
:
self
.
assertEqual
(
pos
,
None
)
self
.
assertEqual
(
pos
,
None
)
self
.
assertEqual
(
vel
,
None
)
self
.
assertEqual
(
vel
,
None
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment