Skip to content

Commit f3bd5a8

Browse files
committed
Use Astropy table instead of pandas
1 parent b11029c commit f3bd5a8

File tree

3 files changed

+5
-18
lines changed

3 files changed

+5
-18
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ env:
3333
- MAIN_CMD='python setup.py'
3434
- SETUP_CMD='test'
3535
- EVENT_TYPE='pull_request push'
36-
- PIP_DEPENDENCIES='numpy scipy matplotlib pandas ads synphot https://github.com/astropy/astroquery/archive/master.zip pytest-astropy sphinx-astropy'
36+
- PIP_DEPENDENCIES='numpy scipy matplotlib ads synphot https://github.com/astropy/astroquery/archive/master.zip pytest-astropy sphinx-astropy'
3737
- ADS_DEV_KEY=TjUyPHFOH48m5Katkeq0UCZQcejTg6bDbTuTGHxT
3838

3939
matrix:

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,3 @@ matplotlib
44
ads
55
synphot
66
git+git://github.com/astropy/astroquery.git@master#egg=astroquery
7-
pandas

sbpy/utils/dastcom5.py

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@
55

66
import astropy.units as u
77
import numpy as np
8-
import pandas as pd
98
from astropy.time import Time
10-
from astropy.table import Table
9+
from astropy.table import Table, vstack
1110
import astropy.units as u
1211

1312
AST_DTYPE = np.dtype(
@@ -558,30 +557,19 @@ def entire_db():
558557
ast_database = asteroid_db()
559558
com_database = comet_db()
560559

561-
ast_database = pd.DataFrame(
560+
ast_database = Table(
562561
ast_database[
563562
list(ast_database.dtype.names[:17])
564563
+ list(ast_database.dtype.names[-4:-3])
565564
+ list(ast_database.dtype.names[-2:])
566565
]
567566
)
568-
ast_database.rename(
569-
columns={"ASTNAM": "NAME", "NO": "NUMBER", "CALEPO": "CALEPOCH"},
570-
inplace=True
571-
)
572-
com_database = pd.DataFrame(
567+
com_database = Table(
573568
com_database[
574569
list(com_database.dtype.names[:17])
575570
+ list(com_database.dtype.names[-4:-3])
576571
+ list(com_database.dtype.names[-2:])
577572
]
578573
)
579-
com_database.rename(
580-
columns={"COMNAM": "NAME", "NO": "NUMBER", "CALEPO": "CALEPOCH"},
581-
inplace=True
582-
)
583-
df = ast_database.append(com_database, ignore_index=True)
584-
df[["NAME", "DESIG", "IREF"]] = df[["NAME", "DESIG", "IREF"]].apply(
585-
lambda x: x.str.strip().str.decode("utf-8")
586-
)
574+
df = vstack(ast_database, com_database)
587575
return df

0 commit comments

Comments
 (0)