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
74d9d76a
Commit
74d9d76a
authored
6 years ago
by
Markus Scheidgen
Browse files
Options
Downloads
Patches
Plain Diff
Fixed non nparrays.
parent
1b4e1a2f
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
+7
-0
7 additions, 0 deletions
...er-system-type/systemtypenormalizer/classify_structure.py
with
7 additions
and
0 deletions
normalizer/normalizer-system-type/systemtypenormalizer/classify_structure.py
+
7
−
0
View file @
74d9d76a
...
@@ -98,13 +98,18 @@ class ClassifyStructure(object):
...
@@ -98,13 +98,18 @@ class ClassifyStructure(object):
else
:
else
:
# pbc = pbc[0]
# pbc = pbc[0]
# pbc = np.array(pbc["flatData"]).reshape(pbc["shape"])
# pbc = np.array(pbc["flatData"]).reshape(pbc["shape"])
# nomad-xt: we already provide numpy or python data
pbc
=
np
.
asarray
(
pbc
)
# The pbc should be defined as a single-dimensional list
# The pbc should be defined as a single-dimensional list
if
len
(
pbc
.
shape
)
==
2
:
if
len
(
pbc
.
shape
)
==
2
:
pbc
=
pbc
[
0
,
:]
pbc
=
pbc
[
0
,
:]
# nomad-xt: we already provide numpy or python data
# Transform data into numpy arrays, don't reshape to work with old code using flat arrays
# 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_labels = np.array(atom_labels["flatData"]).reshape(atom_labels["shape"])
# atom_pos = np.array(atom_pos["flatData"]).reshape(atom_pos["shape"])
# atom_pos = np.array(atom_pos["flatData"]).reshape(atom_pos["shape"])
atom_labels
=
np
.
asarray
(
atom_labels
)
atom_pos
=
np
.
asarray
(
atom_pos
)
# No further analysis will be done if there is no cell or all periodic_dimensions are False.
# 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.
# The classification will be set to 'Atom' or 'Molecule' depending on the number of atoms.
...
@@ -114,7 +119,9 @@ class ClassifyStructure(object):
...
@@ -114,7 +119,9 @@ class ClassifyStructure(object):
else
:
else
:
self
.
classification
=
'
Molecule / Cluster
'
self
.
classification
=
'
Molecule / Cluster
'
else
:
else
:
# nomad-xt: we already provide numpy or python data
# cell = np.array(cell["flatData"]).reshape(cell["shape"])
# cell = np.array(cell["flatData"]).reshape(cell["shape"])
cell
=
np
.
asarray
(
cell
)
# convert to Angstrom and numpy array
# convert to Angstrom and numpy array
atom_pos
=
self
.
m_to_ang
*
atom_pos
atom_pos
=
self
.
m_to_ang
*
atom_pos
cell
=
self
.
m_to_ang
*
cell
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