Loading src/lsst_inaf_agile/catalog_combined.py +11 −4 Original line number Diff line number Diff line Loading @@ -39,7 +39,11 @@ class CatalogCombined: Single star catalog. catalog_binary: catalog_star.CatalogStar or None Binary star catalog. sql_query: str Input SQL query if a database file is read. cache: bool Use an existing catalog whenever available. Otherwise, always overwrite the one in disk. """ def __init__( Loading @@ -50,6 +54,7 @@ class CatalogCombined: catalog_star=None, catalog_binary=None, sql_query=None, cache=True, ): """ Initialize CombinedCatalog. Loading @@ -61,14 +66,16 @@ class CatalogCombined: self.catalog_binary = catalog_binary # NOTE: short-circuit for an existing truth catalog if os.path.exists(filename := self.get_filename()): if cache and os.path.exists(filename := self.get_filename()): logger.info(f"Found catalog FITS file {filename}") self.catalog_combined = util.read_fits(filename) return # NOTE: short-circuit for an existing database truth catalog if sql_query is not None and ( filenames := glob.glob(f"{self.dirname}/db/**/master.db", recursive=True) if ( cache and sql_query is not None and (filenames := glob.glob(f"{self.dirname}/db/**/master.db", recursive=True)) ): import sqlite3 Loading Loading
src/lsst_inaf_agile/catalog_combined.py +11 −4 Original line number Diff line number Diff line Loading @@ -39,7 +39,11 @@ class CatalogCombined: Single star catalog. catalog_binary: catalog_star.CatalogStar or None Binary star catalog. sql_query: str Input SQL query if a database file is read. cache: bool Use an existing catalog whenever available. Otherwise, always overwrite the one in disk. """ def __init__( Loading @@ -50,6 +54,7 @@ class CatalogCombined: catalog_star=None, catalog_binary=None, sql_query=None, cache=True, ): """ Initialize CombinedCatalog. Loading @@ -61,14 +66,16 @@ class CatalogCombined: self.catalog_binary = catalog_binary # NOTE: short-circuit for an existing truth catalog if os.path.exists(filename := self.get_filename()): if cache and os.path.exists(filename := self.get_filename()): logger.info(f"Found catalog FITS file {filename}") self.catalog_combined = util.read_fits(filename) return # NOTE: short-circuit for an existing database truth catalog if sql_query is not None and ( filenames := glob.glob(f"{self.dirname}/db/**/master.db", recursive=True) if ( cache and sql_query is not None and (filenames := glob.glob(f"{self.dirname}/db/**/master.db", recursive=True)) ): import sqlite3 Loading