From c6eb9ccd0fe1295de6de78ddba033e977bb18ccb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20S=C3=A1nchez-Gallego?= Date: Thu, 14 Nov 2024 11:30:13 -0800 Subject: [PATCH] Format utils.py --- python/target_selection/utils.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/python/target_selection/utils.py b/python/target_selection/utils.py index 78007944..11dac022 100644 --- a/python/target_selection/utils.py +++ b/python/target_selection/utils.py @@ -15,6 +15,7 @@ import pandas from peewee import SQL, DoesNotExist, ProgrammingError, fn + __all__ = [ "Timer", "sql_apply_pm", @@ -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 @@ -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.