Skip to content

Commit

Permalink
Format utils.py
Browse files Browse the repository at this point in the history
  • Loading branch information
albireox committed Nov 14, 2024
1 parent 4459d68 commit c6eb9cc
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions python/target_selection/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import pandas
from peewee import SQL, DoesNotExist, ProgrammingError, fn


__all__ = [
"Timer",
"sql_apply_pm",
Expand Down Expand Up @@ -53,9 +54,7 @@ def elapsed(self):
return time.time() - self.start


def sql_apply_pm(
ra_field, dec_field, pmra_field, pmdec_field, epoch_delta, is_pmra_cos=True
):
def sql_apply_pm(ra_field, dec_field, pmra_field, pmdec_field, epoch_delta, is_pmra_cos=True):
"""Constructs a SQL expression for applying proper motions to RA/Dec.
Parameters
Expand Down Expand Up @@ -285,14 +284,10 @@ def remove_version(
print("Removed entry in 'version'.")


def vacuum_table(
database, table_name, vacuum=True, analyze=True, maintenance_work_mem="50GB"
):
def vacuum_table(database, table_name, vacuum=True, analyze=True, maintenance_work_mem="50GB"):
"""Vacuums and analyses a table."""

statement = (
("VACUUM " if vacuum else "") + ("ANALYZE " if analyze else "") + table_name
)
statement = ("VACUUM " if vacuum else "") + ("ANALYZE " if analyze else "") + table_name

with database.atomic():
# Change isolation level to allow executing commands such as VACUUM.
Expand Down

0 comments on commit c6eb9cc

Please sign in to comment.