# Path: nport/base.py
# Z = IMPEDANCE = TYPE_Z = 'Z'
# Y = ADMITTANCE = TYPE_Y = 'Y'
# S = SCATTERING = TYPE_S = 'S'
# T = SCATTERING_TRANSFER = TYPE_T = 'T'
# H = HYBRID = TYPE_H = 'H'
# G = INVERSE_HYBRID = TYPE_G = 'G'
# ABCD = TRANSMISSION = TYPE_ABCD = 'ABCD'
#         P = type(cname, cbases, cdict)
# class NPortMatrixBase(np.ndarray):
# class NPortBase(NPortMatrixBase):
#     def __new__(cls, matrix, type, z0=None):
#     def _z0test(self, type, z0):
#     def __repr__(self):
#     def __array_finalize__(self, obj):
#     def __reduce__(self):
#     def __setstate__(self,state):
#     def ports(self):
#     def parameters(self):
#     def get_parameter(self, port1, port2):
#     def convert_z0test(self, type, z0):
#     def __metaclass__(cname, cbases, cdict):
#         def make_op(name, func):
#             def op(this, other):
#     def __new__(cls, freqs, matrices, type, z0=None):
#     def __array_finalize__(self, obj):
#     def __getitem__(self, index):
#     def __getslice__(self, start, end):
#     def __reduce__(self):
#     def __setstate__(self,state):
#     def parameters(self):
#     def get_parameter(self, port1, port2):
#     def get_element(self, port1, port2):
#     def at(self, freqs):
#     def average(self, n):


import numpy as np
from .base import TRANSMISSION
from twonport import TwoNPort
from eigenshuffle import eigenshuffle
        from .twoport import TwoPort
    """Class representing a multiconductor transmission line. It calculates:
    
    * per-unit-length matrices (R, L, G, C), 
    * modal propagation constant matrices and characteristic impedance matrices,
      and
    * natural propagation constant matrices and characteristic impedance
      matrices

    For non-uniform lines, the characteristic impedance matrices differ for
    forward and backward propagation:
    
    * :attr:`modal_z0_forward` and :attr:`natural_z0_forward`
    * :attr:`modal_z0_backward` and :attr:`natural_z0_backward`

    For reciprocal lines, the propagation constant matrices are the same for
    forward and backward propagation, while for non-reciprocal lines they
    differ.

    """
    def __init__(self, twonport, length, reciprocal=True):
        """
        :param twonport: 2n-port that represents a multiconductor transmission
                         line
        :type twonport: TwoNPort
        :param length: physical length of the transmission line in meters
        :type length: float
        :param reciprocal: True if `twonport` represents a reciprocal line
        :type reciprocal: bool
        
        """

# Path: nport/base.py
# Z = IMPEDANCE = TYPE_Z = 'Z'
# Y = ADMITTANCE = TYPE_Y = 'Y'
# S = SCATTERING = TYPE_S = 'S'
# T = SCATTERING_TRANSFER = TYPE_T = 'T'
# H = HYBRID = TYPE_H = 'H'
# G = INVERSE_HYBRID = TYPE_G = 'G'
# ABCD = TRANSMISSION = TYPE_ABCD = 'ABCD'
#         P = type(cname, cbases, cdict)
# class NPortMatrixBase(np.ndarray):
# class NPortBase(NPortMatrixBase):
#     def __new__(cls, matrix, type, z0=None):
#     def _z0test(self, type, z0):
#     def __repr__(self):
#     def __array_finalize__(self, obj):
#     def __reduce__(self):
#     def __setstate__(self,state):
#     def ports(self):
#     def parameters(self):
#     def get_parameter(self, port1, port2):
#     def convert_z0test(self, type, z0):
#     def __metaclass__(cname, cbases, cdict):
#         def make_op(name, func):
#             def op(this, other):
#     def __new__(cls, freqs, matrices, type, z0=None):
#     def __array_finalize__(self, obj):
#     def __getitem__(self, index):
#     def __getslice__(self, start, end):
#     def __reduce__(self):
#     def __setstate__(self,state):
#     def parameters(self):
#     def get_parameter(self, port1, port2):
#     def get_element(self, port1, port2):
#     def at(self, freqs):
#     def average(self, n):


# Path: nport/tline.py
import numpy as np
from .base import TRANSMISSION
from twonport import TwoNPort
from eigenshuffle import eigenshuffle
        from .twoport import TwoPort

    """Class representing a multiconductor transmission line. It calculates:
    
    * per-unit-length matrices (R, L, G, C), 
    * modal propagation constant matrices and characteristic impedance matrices,
      and
    * natural propagation constant matrices and characteristic impedance
      matrices

    For non-uniform lines, the characteristic impedance matrices differ for
    forward and backward propagation:
    
    * :attr:`modal_z0_forward` and :attr:`natural_z0_forward`
    * :attr:`modal_z0_backward` and :attr:`natural_z0_backward`

    For reciprocal lines, the propagation constant matrices are the same for
    forward and backward propagation, while for non-reciprocal lines they
    differ.

    """
    def __init__(self, twonport, length, reciprocal=True):
        """
        :param twonport: 2n-port that represents a multiconductor transmission
                         line
        :type twonport: TwoNPort
        :param length: physical length of the transmission line in meters
        :type length: float
        :param reciprocal: True if `twonport` represents a reciprocal line
        :type reciprocal: bool
        
        """

        self.twonport = twonport.convert(TRANSMISSION)