diff --git a/pyEPR/ansys.py b/pyEPR/ansys.py index 911dcba..5fa8eee 100644 --- a/pyEPR/ansys.py +++ b/pyEPR/ansys.py @@ -1500,7 +1500,7 @@ def _readin_Q3D_matrix(path: str): skipinitialspace=True, index_col=0) units = re.findall(r'C Units:(.*?),', text)[0] - + if len(s2) > 1: df_cond = pd.read_csv(io.StringIO(s2[1].strip()), delim_whitespace=True, @@ -1509,6 +1509,7 @@ def _readin_Q3D_matrix(path: str): units_cond = re.findall(r'G Units:(.*?)\n', text)[0] else: df_cond = None + units_cond = None var = re.findall(r'DesignVariation:(.*?)\n', text) # this changed circa v2020 diff --git a/pyEPR/calcs/back_box_numeric.py b/pyEPR/calcs/back_box_numeric.py index 8dda6ad..22aeb9d 100644 --- a/pyEPR/calcs/back_box_numeric.py +++ b/pyEPR/calcs/back_box_numeric.py @@ -153,8 +153,11 @@ def make_dispersive(H, fock_trunc, fzpfs=None, f0s=None, chi_prime=False, [H_lin, H_nl] = H H = H_lin + H_nl else: # make sure its a quanutm object - assert type( - H) == qutip.qobj.Qobj, "Please pass in either a list of Qobjs or Qobj for the Hamiltonian" + from qutip import Qobj + if not isinstance(H, Qobj): # Validate that the input is a Qobj instance. + raise TypeError("Please pass in either a list of Qobjs or a Qobj for the Hamiltonian") + #assert type( + # H) == qutip.qobj.Qobj, "Please pass in either a list of Qobjs or Qobj for the Hamiltonian" print("Starting the diagonalization") evals, evecs = H.eigenstates() diff --git a/pyEPR/toolbox/plotting.py b/pyEPR/toolbox/plotting.py index 5a5e08e..5cc9a79 100644 --- a/pyEPR/toolbox/plotting.py +++ b/pyEPR/toolbox/plotting.py @@ -97,6 +97,7 @@ def get_color_cycle(n, colormap=None, start=0., stop=1., format='hex'): colormap = colormap or default_colormap() pts = np.linspace(start, stop, n) + colors = None if format == 'hex': colors = [rgb2hex(colormap(pt)) for pt in pts] return colors