Skip to content

Commit

Permalink
Continue cleaning, add action
Browse files Browse the repository at this point in the history
  • Loading branch information
brickbots committed Jun 11, 2024
1 parent a8972b5 commit 8059530
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 18 deletions.
10 changes: 0 additions & 10 deletions .github/workflows/black.yml

This file was deleted.

14 changes: 14 additions & 0 deletions .github/workflows/ruff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Ruff
on: [push, pull_request]
jobs:
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: chartboost/ruff-action@v1
with:
- changed-files: 'true'
- uses: chartboost/ruff-action@v1
with:
- changed-files: 'true'
- args: 'format --check'
2 changes: 0 additions & 2 deletions python/PiFinder/audit_images.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ def get_catalog_objects():
"/Users/rich/Projects/Astronomy/PiFinder/astro_data/pifinder_objects.db"
)
conn.row_factory = sqlite3.Row
db_c = conn.cursor()
cat_objects = conn.execute(
"""
SELECT * from objects
Expand All @@ -40,7 +39,6 @@ def check_object_image(catalog_object):
"/Users/rich/Projects/Astronomy/PiFinder/astro_data/pifinder_objects.db"
)
conn.row_factory = sqlite3.Row
db_c = conn.cursor()

aka_rec = conn.execute(
f"""
Expand Down
6 changes: 3 additions & 3 deletions python/PiFinder/calc_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ def altaz_to_radec(self, alt, az, dt):

observer = self.observer_loc.at(t)
a = observer.from_altaz(alt_degrees=alt, az_degrees=az)
ra, dec, distance = a.radec(epoch=t)
ra, dec, _distance = a.radec(epoch=t)
return ra._degrees, dec._degrees

def radec_to_altaz(self, ra, dec, dt, atmos=True):
Expand All @@ -260,9 +260,9 @@ def radec_to_altaz(self, ra, dec, dt, atmos=True):

apparent = observer.observe(sky_pos).apparent()
if atmos:
alt, az, distance = apparent.altaz("standard")
alt, az, _distance = apparent.altaz("standard")
else:
alt, az, distance = apparent.altaz()
alt, az, _distance = apparent.altaz()
return alt.degrees, az.degrees

def radec_to_constellation(self, ra, dec):
Expand Down
6 changes: 3 additions & 3 deletions python/PiFinder/db/observations_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def check_logged(self, obj_record: CompositeObject):
Returns true/false if this object has been observed
"""
# safety check
if self.observed_objects_cache == None:
if self.observed_objects_cache is None:
self.load_observed_objects_cache()

if (
Expand Down Expand Up @@ -198,7 +198,7 @@ def get_sessions(self, session_uid=None):
avg(lon) as lon
from obs_sessions
"""
if session_uid != None:
if session_uid is not None:
# add in a where clause
q += """
where uid= :sess_uid
Expand Down Expand Up @@ -236,7 +236,7 @@ def get_session(self, session_uid):
returns a record for a specific session
applies the same enrichment
"""
return get_sessions(session_uid=session_uid)[0]
return self.get_sessions(session_uid=session_uid)[0]

def get_logs_by_session(self, session_uid):
"""
Expand Down

0 comments on commit 8059530

Please sign in to comment.