Skip to content

skpkg: rename variable cutted as cutoff_applied #84

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 24, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
10 changes: 5 additions & 5 deletions src/diffpy/fourigui/fourigui.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def initUI(self):
self.transformed = (
False # denotes whether dataset is Fourier transformed
)
self.cutted = (
self.cutoff_applied = (
False # denotes whether cutoff frequencies are applied to dataset
)
self.transcutted = (
Expand Down Expand Up @@ -358,7 +358,7 @@ def load_cube(self):
self.plot_plane()
self.transformed = False
self.transcutted = False
self.cutted = False
self.cutoff_applied = False
self.cutoff.set(0)
self.space.set(0)

Expand Down Expand Up @@ -519,7 +519,7 @@ def applycutoff(self):
--------
nothing
"""
if not self.cutted:
if not self.cutoff_applied:
xdim, ydim, zdim = self.cube.shape
sphere = np.ones((xdim, ydim, zdim))
qmin = float(self.qminentry.get())
Expand Down Expand Up @@ -553,7 +553,7 @@ def applycutoff(self):
self.plot_plane()
self.intensity_upd_global()

self.cutted = True
self.cutoff_applied = True

else:
if self.space.get(): # in real space
Expand Down Expand Up @@ -585,7 +585,7 @@ def newcutoff(self):
self.cube = self.cube_real
else:
self.cube = self.cube_reci
self.cutted = False
self.cutoff_applied = False
self.transcutted = False
self.applycutoff()

Expand Down
8 changes: 4 additions & 4 deletions tests/test_fourigui.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def setUp(self):
def test_init(self):
self.assertFalse(self.test_gui.loaded)
self.assertFalse(self.test_gui.transformed)
self.assertFalse(self.test_gui.cutted)
self.assertFalse(self.test_gui.cutoff_applied)
self.assertFalse(self.test_gui.transcutted)
self.assertFalse(self.test_gui.cutoff.get())
self.assertFalse(self.test_gui.space.get())
Expand Down Expand Up @@ -81,7 +81,7 @@ def test_fft_010(self):
self.assertTrue(
not self.test_gui.transformed and self.test_gui.transcutted
)
# self.assertTrue(self.test_gui.cutted)
# self.assertTrue(self.test_gui.cutoff_applied)

def test_fft_001(self):
# given
Expand Down Expand Up @@ -170,7 +170,7 @@ def test_applycutoff(mocker):
mocker.patch.object(
fg, "plot_plane"
) # we don't want it to plot anything so intercept
fg.cutted = False
fg.cutoff_applied = False
fg.cube = np.ones((5, 5, 5))
expected_ones = np.ones((5, 5, 5))
expected_recip = np.array(
Expand Down Expand Up @@ -229,7 +229,7 @@ def test_applycutoff(mocker):
fg, "fft"
) # we don't want it to do the fft so intercept.
# Should be tested separately (fixme).
fg.cutted = False
fg.cutoff_applied = False
fg.cube_reci = np.ones((5, 5, 5))
fg.cube = np.ones((5, 5, 5))
mocker.patch.object(fg.space, "get", return_value=1)
Expand Down
Loading