Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions news/runtimewarning.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**Added:**

* Adds condition to fix `RuntimeWarning`

**Changed:**

* <news item>

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* <news item>

**Security:**

* <news item>
8 changes: 6 additions & 2 deletions src/diffpy/fourigui/fourigui.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,12 @@ def intensity_upd_local(self):
elif self.axis.get() == 2:
plane = self.cube[:, :, self.plane_num.get()]
nan_ratio = np.count_nonzero(np.isnan(plane)) / plane.size
self.localmax["text"] = "{}".format(np.format_float_scientific(np.nanmax(plane), 1))
self.localmin["text"] = "{}".format(np.format_float_scientific(np.nanmin(plane), 1))
if np.isnan(plane).all():
self.localmax["text"] = "NaN"
self.localmin["text"] = "NaN"
else:
self.localmax["text"] = "{}".format(np.format_float_scientific(np.nanmax(plane), 1))
self.localmin["text"] = "{}".format(np.format_float_scientific(np.nanmin(plane), 1))
self.localsum["text"] = "{}".format(np.format_float_scientific(np.nansum(plane), 1))
self.localnanratio["text"] = "{}".format(round(nan_ratio, 2))

Expand Down