# 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
from __future__ import division




class cached_property(property):
    def __init__(self, function, *args, **kwargs):
        super(cached_property, self).__init__(function, *args, **kwargs)
        self._function_name = function.__name__
        
    def __get__(self, obj, *args):
        cache_variable = '_' + self._function_name
        try:
            return getattr(obj, cache_variable)
        except AttributeError:

# 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

from __future__ import division




class cached_property(property):
    def __init__(self, function, *args, **kwargs):
        super(cached_property, self).__init__(function, *args, **kwargs)
        self._function_name = function.__name__
        
    def __get__(self, obj, *args):
        cache_variable = '_' + self._function_name
        try:
            return getattr(obj, cache_variable)
        except AttributeError:

            cache_value = super(cached_property, self).__get__(obj, *args)