Skip to content

Commit

Permalink
added Kirk21 test
Browse files Browse the repository at this point in the history
  • Loading branch information
Exu-112 committed Jul 8, 2024
1 parent 4049cd0 commit 0864850
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 46 deletions.
46 changes: 0 additions & 46 deletions tests/test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,40 +148,6 @@ def test_proper_motion_refs(db):
assert len(t) == 44, f"found {len(t)} proper motion reference entries for {ref}"


def test_parallax_refs(db):
# Test total odopted measuruments
t = db.query(db.Parallaxes).filter(db.Parallaxes.c.adopted == 1).astropy()
assert len(t) == 1876, f"found {len(t)} adopted parallax measuruments."

ref = "GaiaDR3"
t = db.query(db.Parallaxes).filter(db.Parallaxes.c.reference == ref).astropy()
assert len(t) == 1, f"found {len(t)} parallax reference entries for {ref}"

ref = "GaiaDR2"
t = db.query(db.Parallaxes).filter(db.Parallaxes.c.reference == ref).astropy()
assert len(t) == 1076, f"found {len(t)} parallax reference entries for {ref}"

t = (
db.query(db.Parallaxes)
.filter(and_(db.Parallaxes.c.reference == ref, db.Parallaxes.c.adopted == 1))
.astropy()
)
assert len(t) == 33, f"found {len(t)} adopted parallax reference entries for {ref}"

ref = "GaiaEDR3"
t = db.query(db.Parallaxes).filter(db.Parallaxes.c.reference == ref).astropy()
assert len(t) == 1134, f"found {len(t)} parallax reference entries for {ref}"

t = (
db.query(db.Parallaxes)
.filter(and_(db.Parallaxes.c.reference == ref, db.Parallaxes.c.adopted == 1))
.astropy()
)
assert (
len(t) == 1077
), f"found {len(t)} adopted parallax reference entries for {ref}"


def test_missions(db):
# If 2MASS designation in Names, 2MASS photometry should exist
stm = except_(
Expand Down Expand Up @@ -552,23 +518,11 @@ def test_Kirk19_ingest(db):
t = db.query(db.Sources).filter(db.Sources.c.reference == ref).astropy()
assert len(t) == 1, f"found {len(t)} sources for {ref}"

# Test spectral types added

# Test parallaxes
ref = "Kirk19"
t = db.query(db.Parallaxes).filter(db.Parallaxes.c.reference == ref).astropy()
assert len(t) == 64, f"found {len(t)} parallax entries for {ref}"

# Test proper motions added
ref = "Kirk19"
t = db.query(db.ProperMotions).filter(db.ProperMotions.c.reference == ref).astropy()
assert len(t) == 182, f"found {len(t)} proper motion entries for {ref}"

# Test parallaxes added for ATLAS
ref = "Mart18"
t = db.query(db.Parallaxes).filter(db.Parallaxes.c.reference == ref).astropy()
assert len(t) == 15, f"found {len(t)} parallax entries for {ref}"


def test_Best2020_ingest(db):
# Test for Best20.257 proper motions added
Expand Down
54 changes: 54 additions & 0 deletions tests/test_data_astrometry.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
from sqlalchemy import except_, select, and_


def test_parallax_refs(db):
# Test total adopted measuruments
t = db.query(db.Parallaxes).filter(db.Parallaxes.c.adopted == 1).astropy()
assert len(t) == 1876, f"found {len(t)} adopted parallax measuruments."

ref = "GaiaDR3"
t = db.query(db.Parallaxes).filter(db.Parallaxes.c.reference == ref).astropy()
assert len(t) == 1, f"found {len(t)} parallax reference entries for {ref}"

ref = "GaiaDR2"
t = db.query(db.Parallaxes).filter(db.Parallaxes.c.reference == ref).astropy()
assert len(t) == 1076, f"found {len(t)} parallax reference entries for {ref}"

t = (
db.query(db.Parallaxes)
.filter(and_(db.Parallaxes.c.reference == ref, db.Parallaxes.c.adopted == 1))
.astropy()
)
assert len(t) == 33, f"found {len(t)} adopted parallax reference entries for {ref}"

ref = "GaiaEDR3"
t = db.query(db.Parallaxes).filter(db.Parallaxes.c.reference == ref).astropy()
assert len(t) == 1134, f"found {len(t)} parallax reference entries for {ref}"

t = (
db.query(db.Parallaxes)
.filter(and_(db.Parallaxes.c.reference == ref, db.Parallaxes.c.adopted == 1))
.astropy()
)
assert (
len(t) == 1077
), f"found {len(t)} adopted parallax reference entries for {ref}"

ref = "Kirk21"
t = db.query(db.Parallaxes).filter(db.Parallaxes.c.reference == ref).astropy()
assert len(t) == 325, f"found {len(t)} parallax reference entries for {ref}"

t = (
db.query(db.Parallaxes)
.filter(and_(db.Parallaxes.c.reference == ref, db.Parallaxes.c.adopted == 1))
.astropy()
)
assert len(t) == 248, f"found {len(t)} adopted parallax reference entries for {ref}"

ref = "Kirk19"
t = db.query(db.Parallaxes).filter(db.Parallaxes.c.reference == ref).astropy()
assert len(t) == 64, f"found {len(t)} parallax entries for {ref}"

ref = "Mart18"
t = db.query(db.Parallaxes).filter(db.Parallaxes.c.reference == ref).astropy()
assert len(t) == 15, f"found {len(t)} parallax entries for {ref}"

0 comments on commit 0864850

Please sign in to comment.