Skip to content

Commit

Permalink
Correction to catkit REAME (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob Boes authored Apr 20, 2018
1 parent fb96db7 commit 992c298
Show file tree
Hide file tree
Showing 3 changed files with 114 additions and 669 deletions.
2 changes: 1 addition & 1 deletion catgen/surface.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class SlabGenerator(object):

def __init__(self,
bulk,
miller_index=[1, 1, 1],
miller_index=(1, 1, 1),
layers=4,
min_width=None,
fixed=0,
Expand Down
9 changes: 4 additions & 5 deletions catkit/gratoms.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,10 @@ def __delitem__(self, i):
# interpreted at 0 and 1 indices.
i = np.atleast_1d(i)

n = len(self)
i = np.arange(n)[i]

if len(self._constraints) > 0:
n = len(self)
i = np.arange(n)[i]
if isinstance(i, int):
i = [i]
constraints = []
Expand All @@ -222,10 +223,8 @@ def __delitem__(self, i):
for name, a in self.arrays.items():
self.arrays[name] = a[mask]

if isinstance(i, slice):
i = np.arange(n)[i]

self._graph.remove_nodes_from(i)

mapping = dict(zip(np.where(mask)[0], np.arange(len(self))))
nx.relabel_nodes(self._graph, mapping, copy=False)

Expand Down
Loading

0 comments on commit 992c298

Please sign in to comment.