Skip to content
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

Fix linting gui tools #248

Merged
merged 5 commits into from
Jan 9, 2024
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
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
6 changes: 1 addition & 5 deletions stellarphot/gui_tools/comparison_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -127,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))

Expand Down
18 changes: 6 additions & 12 deletions stellarphot/gui_tools/seeing_profile_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -341,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.
"""
Expand Down Expand Up @@ -409,7 +404,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)
Expand Down
1 change: 0 additions & 1 deletion stellarphot/gui_tools/tests/test_seeing_profile.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from astropy.table import Table
from astrowidgets import ImageWidget

from stellarphot.gui_tools import seeing_profile_functions as spf
Expand Down