deffigure(self,fig_kwargs=None,**assignments):"""obtain a figure object from the atom arrangement."""returnget_atom_arrangement_figure(self,fig_kwargs,**assignments)
@beartypedef__init__(self,register:AtomArrangement,cluster_spacing:ScalarType):self._register=registerself._cluster_spacing=cast(cluster_spacing)ifregister.n_atoms>0:# calculate bounding box# of this registerlocation_iter=register.enumerate()(x,y)=next(location_iter).positionx_min=xx_max=xy_min=yy_max=yforlocation_infoinlocation_iter:(x,y)=location_info.positionx_min=x.min(x_min)x_max=x.max(x_max)y_min=y.min(y_min)y_max=y.max(y_max)shift_x=(x_max-x_min)+cluster_spacingshift_y=(y_max-y_min)+cluster_spacingregister_locations=[list(location_info.position)forlocation_infoinregister.enumerate()]register_filling=[location_info.filling.valueforlocation_infoinregister.enumerate()]shift_vectors=[[shift_x,cast(0)],[cast(0),shift_y]]else:raiseValueError("No locations to parallelize.")self.register_locations=register_locationsself.register_filling=register_fillingself.shift_vectors=shift_vectorssuper().__init__(self)