Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
normalizer-system-type
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
normalizer-system-type
Commits
1b4e1a2f
Commit
1b4e1a2f
authored
6 years ago
by
Markus Scheidgen
Browse files
Options
Downloads
Patches
Plain Diff
Some adaptations for nomad-xts backend.
parent
99f1f834
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
normalizer/normalizer-system-type/systemtypenormalizer/classify_structure.py
+6
-5
6 additions, 5 deletions
...er-system-type/systemtypenormalizer/classify_structure.py
with
6 additions
and
5 deletions
normalizer/normalizer-system-type/systemtypenormalizer/classify_structure.py
+
6
−
5
View file @
1b4e1a2f
...
...
@@ -83,6 +83,7 @@ class ClassifyStructure(object):
# increase covalent radius of unknown element X to 1 Angstrom
self
.
covalent_radii
[
0
]
=
1.0
# nomad-xt: the given values already are numpy arrays
# If these values cannot be read, then skip this system (by raising the Key exception)
atom_labels
=
section_system
[
"
atom_labels
"
]
atom_pos
=
section_system
[
"
atom_positions
"
]
...
...
@@ -95,15 +96,15 @@ class ClassifyStructure(object):
if
pbc
is
None
:
pbc
=
np
.
asarray
(
3
*
[
False
])
else
:
pbc
=
pbc
[
0
]
pbc
=
np
.
array
(
pbc
[
"
flatData
"
]).
reshape
(
pbc
[
"
shape
"
])
#
pbc = pbc[0]
#
pbc = np.array(pbc["flatData"]).reshape(pbc["shape"])
# The pbc should be defined as a single-dimensional list
if
len
(
pbc
.
shape
)
==
2
:
pbc
=
pbc
[
0
,
:]
# Transform data into numpy arrays, don't reshape to work with old code using flat arrays
atom_labels
=
np
.
array
(
atom_labels
[
"
flatData
"
]).
reshape
(
atom_labels
[
"
shape
"
])
atom_pos
=
np
.
array
(
atom_pos
[
"
flatData
"
]).
reshape
(
atom_pos
[
"
shape
"
])
#
atom_labels = np.array(atom_labels["flatData"]).reshape(atom_labels["shape"])
#
atom_pos = np.array(atom_pos["flatData"]).reshape(atom_pos["shape"])
# No further analysis will be done if there is no cell or all periodic_dimensions are False.
# The classification will be set to 'Atom' or 'Molecule' depending on the number of atoms.
...
...
@@ -113,7 +114,7 @@ class ClassifyStructure(object):
else
:
self
.
classification
=
'
Molecule / Cluster
'
else
:
cell
=
np
.
array
(
cell
[
"
flatData
"
]).
reshape
(
cell
[
"
shape
"
])
#
cell = np.array(cell["flatData"]).reshape(cell["shape"])
# convert to Angstrom and numpy array
atom_pos
=
self
.
m_to_ang
*
atom_pos
cell
=
self
.
m_to_ang
*
cell
...
...
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