Skip to content

Commit

Permalink
Merge pull request #97 from zlatko-minev/96_plot_hamiltonian
Browse files Browse the repository at this point in the history
Check for infinite values in the Quality Factors.
  • Loading branch information
zlatko-minev authored Feb 10, 2022
2 parents e1a6815 + 427bc7d commit 4b9b6f2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pyEPR/core_quantum_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,13 @@ def plot_hamiltonian_results(self,
Qs.plot(ax=ax, lw=0, marker=markerf1, ms=4,
legend=True, zorder=20, color=cmap)
Qs.plot(ax=ax, lw=1, alpha=0.2, color='grey', legend=False)
if not (len(Qs) == 0):

df_Qs = np.isinf(Qs)
# pylint: disable=E1101
# Instance of 'ndarray' has no 'values' member (no-member)
Qs_val = df_Qs.values
Qs_inf = Qs_val.sum()
if not (len(Qs) == 0 or Qs_inf > 0):
ax.set_yscale('log')

############################################################################
Expand Down

0 comments on commit 4b9b6f2

Please sign in to comment.