@@ -93,7 +93,7 @@ def from_bulk_and_miller(
93
93
selective_dynamics = False ,
94
94
undercoord_threshold = 0.09 ,
95
95
) -> Self :
96
- """This method constructs the adsorbate site finder from a bulk
96
+ """Construct the adsorbate site finder from a bulk
97
97
structure and a miller index, which allows the surface sites to be
98
98
determined from the difference in bulk and slab coordination, as
99
99
opposed to the height threshold.
@@ -150,15 +150,12 @@ def from_bulk_and_miller(
150
150
surf_props += ["surface" ]
151
151
else :
152
152
surf_props += ["subsurface" ]
153
- new_site_properties = {
154
- "surface_properties" : surf_props ,
155
- "undercoords" : under_coords ,
156
- }
153
+ new_site_properties = {"surface_properties" : surf_props , "undercoords" : under_coords }
157
154
new_slab = this_slab .copy (site_properties = new_site_properties )
158
155
return cls (new_slab , selective_dynamics )
159
156
160
157
def find_surface_sites_by_height (self , slab : Slab , height = 0.9 , xy_tol = 0.05 ):
161
- """This method finds surface sites by determining which sites are
158
+ """Find surface sites by determining which sites are
162
159
within a threshold value in height from the topmost site in a list of
163
160
sites.
164
161
@@ -196,7 +193,7 @@ def find_surface_sites_by_height(self, slab: Slab, height=0.9, xy_tol=0.05):
196
193
return surf_sites
197
194
198
195
def assign_site_properties (self , slab : Slab , height = 0.9 ):
199
- """Assigns site properties."""
196
+ """Assign site properties."""
200
197
if "surface_properties" in slab .site_properties :
201
198
return slab
202
199
@@ -205,7 +202,7 @@ def assign_site_properties(self, slab: Slab, height=0.9):
205
202
return slab .copy (site_properties = {"surface_properties" : surf_props })
206
203
207
204
def get_extended_surface_mesh (self , repeat = (5 , 5 , 1 )):
208
- """Gets an extended surface mesh for to use for adsorption site finding
205
+ """Get an extended surface mesh for to use for adsorption site finding
209
206
by constructing supercell of surface sites.
210
207
211
208
Args:
@@ -233,7 +230,7 @@ def find_adsorption_sites(
233
230
positions = ("ontop" , "bridge" , "hollow" ),
234
231
no_obtuse_hollow = True ,
235
232
):
236
- """Finds surface sites according to the above algorithm. Returns a list
233
+ """Find surface sites according to the above algorithm. Returns a list
237
234
of corresponding Cartesian coordinates.
238
235
239
236
Args:
@@ -307,7 +304,7 @@ def find_adsorption_sites(
307
304
return ads_sites
308
305
309
306
def symm_reduce (self , coords_set , threshold = 1e-6 ):
310
- """Reduces the set of adsorbate sites by finding removing symmetrically
307
+ """Reduce the set of adsorbate sites by finding removing symmetrically
311
308
equivalent duplicates.
312
309
313
310
Args:
@@ -332,7 +329,7 @@ def symm_reduce(self, coords_set, threshold=1e-6):
332
329
return [self .slab .lattice .get_cartesian_coords (coords ) for coords in unique_coords ]
333
330
334
331
def near_reduce (self , coords_set , threshold = 1e-4 ):
335
- """Prunes coordinate set for coordinates that are within threshold.
332
+ """Prune coordinate set for coordinates that are within threshold.
336
333
337
334
Args:
338
335
coords_set (Nx3 array-like): list or array of coordinates
@@ -347,7 +344,7 @@ def near_reduce(self, coords_set, threshold=1e-4):
347
344
348
345
@classmethod
349
346
def ensemble_center (cls , site_list , indices , cartesian = True ):
350
- """Finds the center of an ensemble of sites selected from a list of
347
+ """Find the center of an ensemble of sites selected from a list of
351
348
sites. Helper method for the find_adsorption_sites algorithm.
352
349
353
350
Args:
@@ -363,7 +360,7 @@ def ensemble_center(cls, site_list, indices, cartesian=True):
363
360
return np .average ([site_list [idx ].frac_coords for idx in indices ], axis = 0 )
364
361
365
362
def add_adsorbate (self , molecule : Molecule , ads_coord , repeat = None , translate = True , reorient = True ):
366
- """Adds an adsorbate at a particular coordinate. Adsorbate represented
363
+ """Add an adsorbate at a particular coordinate. Adsorbate represented
367
364
by a Molecule object and is translated to (0, 0, 0) if translate is
368
365
True, or positioned relative to the input adsorbate coordinate if
369
366
translate is False.
@@ -604,7 +601,7 @@ def get_mi_vec(slab):
604
601
605
602
606
603
def get_rot (slab : Slab ) -> SymmOp :
607
- """Gets the transformation to rotate the z axis into the miller index."""
604
+ """Get the transformation to rotate the z axis into the miller index."""
608
605
new_z = get_mi_vec (slab )
609
606
a , _b , _c = slab .lattice .matrix
610
607
new_x = a / np .linalg .norm (a )
@@ -616,13 +613,13 @@ def get_rot(slab: Slab) -> SymmOp:
616
613
617
614
618
615
def put_coord_inside (lattice , cart_coordinate ):
619
- """Converts a Cartesian coordinate such that it is inside the unit cell."""
616
+ """Convert a Cartesian coordinate such that it is inside the unit cell."""
620
617
fc = lattice .get_fractional_coords (cart_coordinate )
621
618
return lattice .get_cartesian_coords ([c - np .floor (c ) for c in fc ])
622
619
623
620
624
621
def reorient_z (structure ):
625
- """Reorients a structure such that the z axis is concurrent with the normal
622
+ """Reorient a structure such that the z axis is concurrent with the normal
626
623
to the A-B plane.
627
624
"""
628
625
struct = structure .copy ()
0 commit comments