From 6a02f82b1e877fc1cd79c3364c3e3c1d517dcf0e Mon Sep 17 00:00:00 2001 From: Kelle Cruz Date: Wed, 2 Oct 2024 14:58:28 -0400 Subject: [PATCH] astrodbkit2 -> astrodbkit (#557) --- .github/workflows/gen-db.yml | 4 ++-- README.md | 2 +- documentation/Views.md | 6 +++--- documentation/examples/bdnyc_example.py | 4 ++-- documentation/examples/plotting_example.py | 2 +- documentation/examples/query_example.py | 2 +- requirements.txt | 4 ++-- simple/schema.py | 4 ++-- simple/utils/astrometry.py | 8 ++++---- simple/utils/companions.py | 4 ++-- simple/utils/spectra.py | 10 +++++----- simple/utils/spectral_types.py | 6 +++--- tests/conftest.py | 2 +- tests/scheduled_checks.py | 2 +- tests/test_integrity.py | 4 ++-- 15 files changed, 32 insertions(+), 32 deletions(-) diff --git a/.github/workflows/gen-db.yml b/.github/workflows/gen-db.yml index 1b7f48330..41aa373b4 100644 --- a/.github/workflows/gen-db.yml +++ b/.github/workflows/gen-db.yml @@ -29,8 +29,8 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install astrodbkit2 - pip install git+https://github.com/astrodbtoolkit/astrodb_utils.git@main + pip install astrodbkit + pip install astrodb_utils - name: Generate sqlite (file) database run: | diff --git a/README.md b/README.md index 5d2a20ebd..0d151626f 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ We recommend using a conda environment to handle python dependencies. The follow This step generates a "SIMPLE.sqlite" file which can be opened, explored, and modified using a variety of tools. -4. Use `astrodbkit2` to [explore](https://astrodbkit2.readthedocs.io/en/latest/#exploring-the-schema), [query](https://astrodbkit2.readthedocs.io/en/latest/#querying-the-database), and/or [modify](https://astrodbkit2.readthedocs.io/en/latest/#modifying-data) the database. +4. Use `astrodbkit` to [explore](https://astrodbkit.readthedocs.io/en/latest/#exploring-the-schema), [query](https://astrodbkit.readthedocs.io/en/latest/#querying-the-database), and/or [modify](https://astrodbkit.readthedocs.io/en/latest/#modifying-data) the database. For example: - Find all objects in the database with "0141" in the name ```python diff --git a/documentation/Views.md b/documentation/Views.md index 68089363a..2b2bec74a 100644 --- a/documentation/Views.md +++ b/documentation/Views.md @@ -4,11 +4,11 @@ SIMPLE offers several database views for ease of searching. A database view is a virtual table that is defined by a query. It does not store any data itself, but rather provides a way to access data from one or more tables in a database. -Because views are not part of the standard SIMPLE schema, they must be activated when using `astrodbkit2`. +Because views are not part of the standard SIMPLE schema, they must be activated when using `astrodbkit`. ```python import sqlalchemy as sa -from astrodbkit2.astrodb import Database, and_, or_ +from astrodbkit.astrodb import Database, and_, or_ # Establish connection to database; your connection string may be different connection_string = 'sqlite:///SIMPLE.db' @@ -23,7 +23,7 @@ print(insp.get_view_definition('ParallaxView')) # view definition # Create object reflecting the view # DO NOT USE db.metadata or you will treat the view as a real table -# and break other astrodbkit2 functionality +# and break other astrodbkit functionality PhotometryView = sa.Table('PhotometryView', sa.MetaData()) insp.reflect_table(PhotometryView, include_columns=None) diff --git a/documentation/examples/bdnyc_example.py b/documentation/examples/bdnyc_example.py index 7320f0e01..a9673f64e 100644 --- a/documentation/examples/bdnyc_example.py +++ b/documentation/examples/bdnyc_example.py @@ -1,6 +1,6 @@ -# Example on how to use the BDNYC database with Astrodbkit2 +# Example on how to use the BDNYC database with Astrodbkit -from astrodbkit2.astrodb import Database, copy_database_schema +from astrodbkit.astrodb import Database, copy_database_schema from sqlalchemy import types # for BDNYC column overrides # Establish connection to database diff --git a/documentation/examples/plotting_example.py b/documentation/examples/plotting_example.py index 3682784b0..ed863e0ed 100644 --- a/documentation/examples/plotting_example.py +++ b/documentation/examples/plotting_example.py @@ -6,7 +6,7 @@ from sqlalchemy import func, and_, Integer, cast from scripts.ingests.utils import load_simpledb, logger from scripts.utils.simple_utils import convert_spt_code_to_string_to_code -from astrodbkit2.spectra import load_spectrum +from astrodbkit.spectra import load_spectrum plt.interactive(False) logger.setLevel(logging.INFO) diff --git a/documentation/examples/query_example.py b/documentation/examples/query_example.py index 82ead64f3..5cedcfe63 100644 --- a/documentation/examples/query_example.py +++ b/documentation/examples/query_example.py @@ -1,6 +1,6 @@ # Query examples against the database -from astrodbkit2.astrodb import Database, and_, or_ +from astrodbkit.astrodb import Database, and_, or_ # Establish connection to database connection_string = 'sqlite:///SIMPLE.db' diff --git a/requirements.txt b/requirements.txt index 52fbf3f5d..21a111600 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ pytest ads matplotlib -astrodbkit2 -git+https://github.com/astrodbtoolkit/astrodb_utils.git@main +astrodbkit +astrodb_utils \ No newline at end of file diff --git a/simple/schema.py b/simple/schema.py index 6461f0d08..ab0fa757d 100644 --- a/simple/schema.py +++ b/simple/schema.py @@ -6,8 +6,8 @@ from datetime import datetime import sqlalchemy as sa -from astrodbkit2.astrodb import Base -from astrodbkit2.views import view +from astrodbkit.astrodb import Base +from astrodbkit.views import view from astropy.io.votable.ucd import check_ucd from sqlalchemy import ( Boolean, diff --git a/simple/utils/astrometry.py b/simple/utils/astrometry.py index 2552ecce3..c108fd7c2 100644 --- a/simple/utils/astrometry.py +++ b/simple/utils/astrometry.py @@ -5,7 +5,7 @@ from simple.schema import Parallaxes from astropy.units import Quantity from astropy.table import Table -from astrodbkit2.astrodb import Database +from astrodbkit.astrodb import Database from astrodb_utils import AstroDBError, find_source_in_db, find_publication @@ -30,7 +30,7 @@ def ingest_parallax( Parameters ---------- - db: astrodbkit2.astrodb.Database + db: astrodbkit.astrodb.Database Database object source: str source name @@ -183,7 +183,7 @@ def ingest_proper_motions( Parameters ---------- - db: astrodbkit2.astrodb.Database + db: astrodbkit.astrodb.Database Database object sources: list[str] list of source names @@ -366,7 +366,7 @@ def ingest_radial_velocity( Parameters ---------- - db: astrodbkit2.astrodb.Database + db: astrodbkit.astrodb.Database Database object source: str source name diff --git a/simple/utils/companions.py b/simple/utils/companions.py index e2ed4ae82..a8ec76c0c 100644 --- a/simple/utils/companions.py +++ b/simple/utils/companions.py @@ -28,8 +28,8 @@ def ingest_companion_relationships( Parameters ---------- - db: astrodbkit2.astrodb.Database - Database object created by astrodbkit2 + db: astrodbkit.astrodb.Database + Database object created by astrodbkit source: str Name of source as it appears in sources table relationship: str diff --git a/simple/utils/spectra.py b/simple/utils/spectra.py index bb070d386..8eb2a3892 100644 --- a/simple/utils/spectra.py +++ b/simple/utils/spectra.py @@ -10,7 +10,7 @@ internet_connection, ) from astrodb_utils.spectra import check_spectrum_plottable -from astrodbkit2.astrodb import Database +from astrodbkit.astrodb import Database from astropy.io import fits from simple.schema import Spectra @@ -45,8 +45,8 @@ def ingest_spectrum( """ Parameters ---------- - db: astrodbkit2.astrodb.Database - Database object created by astrodbkit2 + db: astrodbkit.astrodb.Database + Database object created by astrodbkit source: str source name spectrum: str @@ -280,8 +280,8 @@ def find_spectra( Parameters ---------- - db: astrodbkit2.astrodb.Database - Database object created by astrodbkit2 + db: astrodbkit.astrodb.Database + Database object created by astrodbkit source: str source name diff --git a/simple/utils/spectral_types.py b/simple/utils/spectral_types.py index 63b04992c..f88e234d0 100644 --- a/simple/utils/spectral_types.py +++ b/simple/utils/spectral_types.py @@ -37,8 +37,8 @@ def ingest_spectral_type( Parameters ---------- - db: astrodbkit2.astrodb.Database - Database object created by astrodbkit2 + db: astrodbkit.astrodb.Database + Database object created by astrodbkit source: str Name of source. Constrained by the Sources table @@ -332,4 +332,4 @@ def check_one_adopted_sptype(db, source, raise_error=True): logger.error(msg) raise AstroDBError(msg) else: - logger.warning(msg) \ No newline at end of file + logger.warning(msg) diff --git a/tests/conftest.py b/tests/conftest.py index 7501c170f..cab8e1d61 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,7 +1,7 @@ import pytest import os import logging -from astrodbkit2.astrodb import create_database, Database +from astrodbkit.astrodb import create_database, Database import sys sys.path.append("./") # needed for github actions to find the simple module diff --git a/tests/scheduled_checks.py b/tests/scheduled_checks.py index 1876900ee..99d701fbe 100644 --- a/tests/scheduled_checks.py +++ b/tests/scheduled_checks.py @@ -4,7 +4,7 @@ import pytest import requests from astrodb_utils.utils import internet_connection -from astrodbkit2.astrodb import Database, create_database +from astrodbkit.astrodb import Database, create_database from tqdm import tqdm sys.path.append(".") diff --git a/tests/test_integrity.py b/tests/test_integrity.py index 38ced4242..7a461a292 100644 --- a/tests/test_integrity.py +++ b/tests/test_integrity.py @@ -1,8 +1,8 @@ # Test to verify database integrity # database object 'db' defined in conftest.py import pytest -from astrodbkit2.astrodb import or_ -from astrodbkit2.utils import _name_formatter +from astrodbkit.astrodb import or_ +from astrodbkit.utils import _name_formatter from astropy import units as u from astropy.table import unique from astroquery.simbad import Simbad