class Atom:
def __init__(self,x,y,z,element,charge,notused,fx,fy,fz):
self.x=float(x)
self.y=float(y)
self.z=float(z)
self.element=str(element)
self.charge=float(charge)
self.notused=int(float(notused))
self.fx=float(fx)
self.fy=float(fy)
self.fz=float(fz)
@classmethod
def from_lammps(self,element,x,y,z):
self.x=float(x)
self.y=float(y)
self.z=float(z)
self.element=str(element)
I am trying to implement an alternate constructor for class Atom. However, I am not sure how what to do differently in from_lammps()
to get an object with the given arguments only.