From 358d343052cb4f41ec80804a274f7a8a354f6a76 Mon Sep 17 00:00:00 2001 From: Matt Craig Date: Wed, 3 Jan 2024 18:26:14 -0600 Subject: [PATCH 1/5] Remove unused imports --- stellarphot/gui_tools/comparison_functions.py | 2 -- stellarphot/gui_tools/tests/test_seeing_profile.py | 1 - 2 files changed, 3 deletions(-) diff --git a/stellarphot/gui_tools/comparison_functions.py b/stellarphot/gui_tools/comparison_functions.py index 6235d6f6..8b746acb 100644 --- a/stellarphot/gui_tools/comparison_functions.py +++ b/stellarphot/gui_tools/comparison_functions.py @@ -17,8 +17,6 @@ from astrowidgets.ginga import ImageWidget from stellarphot import SourceListData -from stellarphot.differential_photometry import * -from stellarphot.photometry import * from stellarphot.gui_tools.seeing_profile_functions import set_keybindings from stellarphot.gui_tools.fits_opener import FitsOpener from stellarphot.io import TessSubmission, TOI, TessTargetFile diff --git a/stellarphot/gui_tools/tests/test_seeing_profile.py b/stellarphot/gui_tools/tests/test_seeing_profile.py index 5525060a..75348617 100644 --- a/stellarphot/gui_tools/tests/test_seeing_profile.py +++ b/stellarphot/gui_tools/tests/test_seeing_profile.py @@ -1,4 +1,3 @@ -from astropy.table import Table from astrowidgets import ImageWidget from stellarphot.gui_tools import seeing_profile_functions as spf From 724f196fe7b9c287d9ba2dfd7fa13a56a5d323ad Mon Sep 17 00:00:00 2001 From: Matt Craig Date: Wed, 3 Jan 2024 18:27:58 -0600 Subject: [PATCH 2/5] Remove unused variables --- stellarphot/gui_tools/comparison_functions.py | 4 +--- stellarphot/gui_tools/seeing_profile_functions.py | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/stellarphot/gui_tools/comparison_functions.py b/stellarphot/gui_tools/comparison_functions.py index 8b746acb..5483544c 100644 --- a/stellarphot/gui_tools/comparison_functions.py +++ b/stellarphot/gui_tools/comparison_functions.py @@ -125,9 +125,7 @@ def cb(viewer, event, data_x, data_y): # noqa: ARG001 imagewidget.next_elim += 1 except AttributeError: imagewidget.next_elim = 1 - pad = 15 - x = int(np.floor(event.data_x)) - y = int(np.floor(event.data_y)) + ra, dec = i.wcs.wcs.all_pix2world(event.data_x, event.data_y, 0) out_skycoord = SkyCoord(ra=ra, dec=dec, unit=(u.degree, u.degree)) diff --git a/stellarphot/gui_tools/seeing_profile_functions.py b/stellarphot/gui_tools/seeing_profile_functions.py index 7a9c5933..e42dc4e2 100644 --- a/stellarphot/gui_tools/seeing_profile_functions.py +++ b/stellarphot/gui_tools/seeing_profile_functions.py @@ -409,7 +409,6 @@ def show_event( def _update_plots(self): # DISPLAY THE SCALED PROFILE fig_size = (10, 5) - profile_size = 60 rad_prof = self.rad_prof self.seeing_profile_plot.clear_output(wait=True) From c1b4f9465d73c0bf8173c26b4614fb8ea9ecbb27 Mon Sep 17 00:00:00 2001 From: Matt Craig Date: Wed, 3 Jan 2024 18:30:51 -0600 Subject: [PATCH 3/5] Remove unneeded method argument --- stellarphot/gui_tools/seeing_profile_functions.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/stellarphot/gui_tools/seeing_profile_functions.py b/stellarphot/gui_tools/seeing_profile_functions.py index e42dc4e2..5811b40c 100644 --- a/stellarphot/gui_tools/seeing_profile_functions.py +++ b/stellarphot/gui_tools/seeing_profile_functions.py @@ -227,15 +227,9 @@ def __init__(self, imagewidget=None, width=500, camera=None): self._set_observers() self.aperture_settings.description = "" - def load_fits(self, file): + def load_fits(self): """ Load a FITS file into the image widget. - - Parameters - ---------- - - file : str - Filename to open. """ self.fits_file.load_in_image_widget(self.iw) self.object_name = self.fits_file.object @@ -250,8 +244,9 @@ def load_fits(self, file): ) self.exposure = np.nan - def _update_file(self, change): - self.load_fits(change.selected) + def _update_file(self, change): # noqa: ARG002 + # Widget callbacks need to accept a single argument, even if it is not used. + self.load_fits() def _construct_tess_sub(self): file = self.fits_file.path From 55e1dca51b9207d7e536959a99ab8b2ba28e67e4 Mon Sep 17 00:00:00 2001 From: Matt Craig Date: Wed, 3 Jan 2024 18:31:02 -0600 Subject: [PATCH 4/5] Put noqa on correct line --- stellarphot/gui_tools/seeing_profile_functions.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stellarphot/gui_tools/seeing_profile_functions.py b/stellarphot/gui_tools/seeing_profile_functions.py index 5811b40c..602ec26b 100644 --- a/stellarphot/gui_tools/seeing_profile_functions.py +++ b/stellarphot/gui_tools/seeing_profile_functions.py @@ -336,8 +336,8 @@ def _update_ap_settings(self, value): def _make_show_event(self): def show_event( - viewer, event=None, datax=None, datay=None, aperture=None - ): # noqa: ARG001 + viewer, event=None, datax=None, datay=None, aperture=None # noqa: ARG001 + ): """ ginga callbacks require the function signature above. """ From 4ed257016053ee82ce8b02c180781f0d08aeb991 Mon Sep 17 00:00:00 2001 From: Matt Craig Date: Tue, 9 Jan 2024 11:07:16 -0600 Subject: [PATCH 5/5] Removing linting exception for gui_tools --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index f8475626..1c18f4ee 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -122,7 +122,6 @@ select = [ "docs/conf.py" = ["F405"] # Ignore pyflakes and ARGS issues in each subpackage until they are fixed -"stellarphot/gui_tools/*" = ["F", "ARG"] "stellarphot/utils/*" = ["F", "ARG"] [tool.pytest.ini_options]