Skip to content
Snippets Groups Projects
Commit 1b4e1a2f authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Some adaptations for nomad-xts backend.

parent 99f1f834
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment