Fix NetworkSet division
@@ -44,13 +44,16 @@ NetworkSet Utilities
"""
import zipfile
-import numpy as npy
-from numbers import Number
-from typing import Union, Any, Mapping, TextIO
from io import BytesIO
+from numbers import Number
+from typing import Any, Mapping, TextIO, Union
+
+import numpy as npy
from scipy.interpolate import interp1d
-from . network import Network, Frequency, PRIMARY_PROPERTIES, COMPONENT_FUNC_DICT
+
from . import mathFunctions as mf
+from .network import (COMPONENT_FUNC_DICT, PRIMARY_PROPERTIES, Frequency,
+ Network)
from .util import now_string_2_dt
try:
@@ -206,7 +209,7 @@ class NetworkSet:
self.__add_a_element_wise_method(network_method_name)
for operator_name in \
- ['__pow__','__floordiv__','__mul__','__div__','__add__','__sub__']:
+ ['__pow__','__floordiv__','__mul__','__truediv__','__add__','__sub__']:
self.__add_a_operator(operator_name)
@classmethod
@@ -786,8 +789,8 @@ class NetworkSet:
"""
- from scipy import stats
from numpy import frompyfunc
+ from scipy import stats
gimme_norm = lambda x: stats.norm(loc=0,scale=x).rvs(1)[0]
ugimme_norm = frompyfunc(gimme_norm,1,1)
@@ -978,7 +981,7 @@ class NetworkSet:
>>> df.to_excel('output.xls') # see Pandas docs for more info
"""
- from pandas import DataFrame, Series, Index
+ from pandas import DataFrame, Index, Series
index = Index(
self[0].frequency.f_scaled,
name='Freq(%s)'%self[0].frequency.unit
@@ -1410,3 +1413,5 @@ def tuner_constellation(name='tuner', singlefreq=76, Z0=50, r_lin = 9, phi_lin=2
else :
return x,y,g
+ return x,y,g
+
