Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

astrodbkit2 -> astrodbkit #557

Merged
merged 1 commit into from
Oct 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
astrodbkit2 -> astrodbkit
kelle committed Oct 1, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit b97dbac57af856f8dbd09daee9f0caa2fec9b549
4 changes: 2 additions & 2 deletions .github/workflows/gen-db.yml
Original file line number Diff line number Diff line change
@@ -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: |
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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
6 changes: 3 additions & 3 deletions documentation/Views.md
Original file line number Diff line number Diff line change
@@ -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)

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
2 changes: 1 addition & 1 deletion documentation/examples/plotting_example.py
Original file line number Diff line number Diff line change
@@ -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)
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'
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
@@ -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,
8 changes: 4 additions & 4 deletions simple/utils/astrometry.py
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions simple/utils/companions.py
Original file line number Diff line number Diff line change
@@ -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
10 changes: 5 additions & 5 deletions simple/utils/spectra.py
Original file line number Diff line number Diff line change
@@ -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

6 changes: 3 additions & 3 deletions simple/utils/spectral_types.py
Original file line number Diff line number Diff line change
@@ -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)
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
2 changes: 1 addition & 1 deletion tests/scheduled_checks.py
Original file line number Diff line number Diff line change
@@ -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(".")
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