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

Fixed non nparrays.

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