Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
parser-dl-poly
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-dl-poly
Commits
a81250fb
Commit
a81250fb
authored
9 years ago
by
Carl Poelking
Browse files
Options
Downloads
Patches
Plain Diff
Array type conversion fixes.
parent
bb859931
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
parser/parser-dl_poly/dlPolyParser.py
+8
-8
8 additions, 8 deletions
parser/parser-dl_poly/dlPolyParser.py
with
8 additions
and
8 deletions
parser/parser-dl_poly/dlPolyParser.py
+
8
−
8
View file @
a81250fb
...
...
@@ -47,10 +47,10 @@ def push(jbe, terminal, key1, fct=lambda x: x.As(), key2=None):
jbe
.
addValue
(
key1
,
value
)
return
value
def
push_array
(
jbe
,
terminal
,
key1
,
key2
=
None
):
def
push_array
(
jbe
,
terminal
,
key1
,
fct
=
lambda
x
:
x
.
As
(),
key2
=
None
):
if
key2
==
None
:
key2
=
key1
value
=
np
.
asarray
(
terminal
[
key2
])
jbe
.
addValue
(
key1
,
value
)
value
=
np
.
asarray
(
fct
(
terminal
[
key2
])
)
jbe
.
add
Array
Value
s
(
key1
,
value
)
return
value
def
push_value
(
jbe
,
value
,
key
):
...
...
@@ -139,9 +139,9 @@ def parse(output_file_name):
molecule_type_name_to_type_gid
[
mol
[
'
molecule_type_name
'
].
As
()]
=
gid_mol
push
(
jbe
,
mol
,
'
molecule_type_name
'
)
push
(
jbe
,
mol
,
'
number_of_atoms_in_molecule
'
,
lambda
s
:
s
.
As
(
int
))
#push_array(jbe, mol, 'atom_in_molecule_name') #TODO
push_array
_values
(
jbe
,
np
.
asarray
(
mol
[
'
atom_in_molecule_name
'
])
,
'
atom_in_molecule_name
'
)
#
push_array(jbe, mol, 'atom_in_molecule_charge') # TODO
push_array
(
jbe
,
mol
,
'
atom_in_molecule_name
'
)
#TODO
push_array
(
jbe
,
mol
,
'
atom_in_molecule_charge
'
)
# TODO
push_array_values
(
jbe
,
np
.
asarray
(
atom_gid_list
),
'
atom_in_molecule_to_atom_type_ref
'
)
#TODO
# Global molecule type map
molecule_to_molecule_type
=
[]
...
...
@@ -151,7 +151,7 @@ def parse(output_file_name):
n_this_mol
=
mol
[
'
number_of_molecules
'
].
As
(
int
)
for
i
in
range
(
n_this_mol
):
molecule_to_molecule_type
.
append
(
type_gid_this_mol
)
#
push_value(jbe, molecule_to_molecule_type, 'molecule_to_molecule_type_map') #TODO
push_
array_
value
s
(
jbe
,
np
.
asarray
(
molecule_to_molecule_type
)
,
'
molecule_to_molecule_type_map
'
)
#TODO
# Global atom map
atoms_to_molidx_atomidx
=
[]
...
...
@@ -165,7 +165,7 @@ def parse(output_file_name):
atoms_to_molidx_atomidx
.
append
(
molidx_atomidx
)
atomidx
+=
1
molidx
+=
1
#
push_value(jbe, atoms_to_molidx_atomidx, 'atom_to_molecule') #TODO
push_
array_
value
s
(
jbe
,
np
.
asarray
(
atoms_to_molidx_atomidx
)
,
'
atom_to_molecule
'
)
#TODO
# SAMPLING-METHOD SECTION
with
open_section
(
jbe
,
'
section_sampling_method
'
):
...
...
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