class Loads(object):

    def __init__(self, loadsID = None, panelID = None, Nxx = 0.0, Nyy = 0.0,
    Nxy = 0.0, Mxx = 0.0, Myy = 0.0, Mxy = 0.0, p0 = 0.0, P = 0.0, xCG = 0.0,
    yCG = 0.0, xLength = 0.0, yLength = 0.0, loadsType = "inplane",
    Qyz = 0.0, Qxz = 0.0, deltaT = 0.0, deltaC = 0.0,
    Ntt = 0.0, Ntx = 0.0, Nxt = 0.0, Mtt = 0.0, Mxt = 0.0, Mtx = 0.0):
        """Initialize the Loads instance.
        
        Parameters
        ----------

        loadsID : str

            Loadcase ID (required)

        panelID : str

            Panel ID (required)

        Nxx : float

            In plane axial (optional)

        Nyy : float

            In plane axial (optional)

        Nxy : float
        
            In plane shear (optional)

        Mxx : float

            In plane noment (optional)

        Myy : float

            In plane moment (optional)

        Mxy : float

            In plane moment (optional)

        Ntt: float

            In plane axial in cylindrical coord (optional)

        Ntx : float

            In plane shear in cylindrical coord (optional)

        Nxt : float

            In plane shear in cylindrical coord (optional)

        Mtt : float

            In plane moment in cylindrical coord (optional)

        Mxt : float

            In plane moment in cylindrical coord (optional)

        Mtx : float

            In plane moment in cylindrical coord (optional)

        p0 : float

            Amplitude of pressure (optional)

        P : float

            Amplitude of point load (optional)

        xCG : float

            xCG of distributed load (optional)

        yCG : float

            yCG of distributed load (optional)

        xLength : float

            xLength of distributed transverse load (optional)
            Must be less than panel length

        yLength : float

            yLength of distributed transverse load (optional)
            Must be less than panel width

        type : str

            loads type (required, default = "inplane")
            "sinusoidal pressure", "uniform pressure", "point load", "partial pressure"

        Qyz : float

            Out of plane shear (optional)

        Qxz : float
            Out of plane shear (optional)

        deltaT : float

            Temperature differential (default = 0.0) (optional)

        deltaC : float

            Moisture differential (default = 0.0) (optional)

        """

        self.loadsID = str(loadsID)
        self.panelID = str(panelID)
        self.Nxx = float(Nxx)
        self.Nyy = float(Nyy)
        self.Nxy = float(Nxy)
        self.Mxx = float(Mxx)
        self.Myy = float(Myy)
        self.Mxy = float(Mxy)
        self.p0 = float(p0)
        self.P = float(P)
        self.xCG = float(xCG)
        self.yCG = float(yCG)
        self.xLength = float(xLength)
        self.yLength = float(yLength)
        self.type = str(loadsType).lower()
        self.Qyz = float(Qyz)
        self.Qxz = float(Qxz)
        self.deltaT = float(deltaT)
        self.deltaC = float(deltaC)

        self.Ntt = float(Ntt)
        self.Ntx = float(Ntx)
        self.Nxt = float(Nxt)
        self.Mtt = float(Mtt)
        self.Mxt = float(Mxt)
        self.Mtx = float(Mtx)

    @classmethod
    def fromDict(cls, **kwargs):
        """Initialize from dict
        
        Returns
        -------
        
        cls: Loads
        
        """
        
        loadsID = kwargs.get("loadsID")
        panelID = kwargs.get("panelID")
        Nxx = kwargs.get("Nxx")
        Nyy = kwargs.get("Nyy")
        Nxy = kwargs.get("Nxy")
        Mxx = kwargs.get("Mxx")
        Myy = kwargs.get("Myy")
        Mxy = kwargs.get("Mxy")
        p0 = kwargs.get("p0")
        P = kwargs.get("P")
        xCG = kwargs.get("xCG")
        yCG = kwargs.get("yCG")
        xLength = kwargs.get("xLength")
        yLength = kwargs.get("yLength")
        loadsType = kwargs.get("loadsType")
        Qyz = kwargs.get("Qyz")
        Qxz = kwargs.get("Qxz")
        deltaT = kwargs.get("deltaT")
        deltaC = kwargs.get("deltaC")

        Ntt = kwargs.get("Ntt")
        Ntx = kwargs.get("Ntx")
        Nxt = kwargs.get("Nxt")
        Mtt = kwargs.get("Mtt")
        Mxt = kwargs.get("Mxt")
        Mtx = kwargs.get("Mtx")
        return cls(loadsID, panelID, Nxx, Nyy, Nxy, Mxx, Myy, Mxy, 
        p0, P, xCG, yCG, xLength, yLength, loadsType, Qyz, Qxz,
        deltaT, deltaC, Ntt, Ntx, Nxt, Mtt, Mxt, Mtx)
