From 7f2bccd5b44a960df42c367820bef352c7c73f64 Mon Sep 17 00:00:00 2001 From: Zlatko Minev Date: Mon, 20 May 2024 21:51:06 -0400 Subject: [PATCH 1/3] Update back_box_numeric.py - fix lint error for Qobj import fix lint error for Qobj import --- pyEPR/calcs/back_box_numeric.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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() From 3b98035c79acbc51c96b665587255991045917f1 Mon Sep 17 00:00:00 2001 From: Zlatko Minev Date: Mon, 20 May 2024 21:54:34 -0400 Subject: [PATCH 2/3] Update plotting.py colors = None fix lint --- pyEPR/toolbox/plotting.py | 1 + 1 file changed, 1 insertion(+) 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 From 63e5cbf23fc1ab90052554c63252042d24eab73a Mon Sep 17 00:00:00 2001 From: Zlatko Minev Date: Mon, 20 May 2024 22:03:09 -0400 Subject: [PATCH 3/3] Update ansys.py --- pyEPR/ansys.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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