Skip to content

Commit

Permalink
astrodbkit2 -> astrodbkit (#557)
Browse files Browse the repository at this point in the history
  • Loading branch information
kelle authored Oct 2, 2024
1 parent 10112b5 commit 6a02f82
Show file tree
Hide file tree
Showing 15 changed files with 32 additions and 32 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/gen-db.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions documentation/Views.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions documentation/examples/bdnyc_example.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion documentation/examples/plotting_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion documentation/examples/query_example.py
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pytest
ads
matplotlib
astrodbkit2
git+https://github.com/astrodbtoolkit/astrodb_utils.git@main
astrodbkit
astrodb_utils
4 changes: 2 additions & 2 deletions simple/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 4 additions & 4 deletions simple/utils/astrometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -30,7 +30,7 @@ def ingest_parallax(
Parameters
----------
db: astrodbkit2.astrodb.Database
db: astrodbkit.astrodb.Database
Database object
source: str
source name
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -366,7 +366,7 @@ def ingest_radial_velocity(
Parameters
----------
db: astrodbkit2.astrodb.Database
db: astrodbkit.astrodb.Database
Database object
source: str
source name
Expand Down
4 changes: 2 additions & 2 deletions simple/utils/companions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions simple/utils/spectra.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions simple/utils/spectral_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -332,4 +332,4 @@ def check_one_adopted_sptype(db, source, raise_error=True):
logger.error(msg)
raise AstroDBError(msg)
else:
logger.warning(msg)
logger.warning(msg)
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/scheduled_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(".")
Expand Down
4 changes: 2 additions & 2 deletions tests/test_integrity.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 6a02f82

Please sign in to comment.