Skip to content

Commit

Permalink
Merge pull request #2 from sot/unbundle-data
Browse files Browse the repository at this point in the history
Unbundle TDB data from package tarball for easier conda packaging
  • Loading branch information
taldcroft committed Jul 19, 2014
2 parents f6cbd66 + ab58df2 commit 36a0541
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ dist
doc/_build
TDB
Ska/tdb/data/
*.pyc

7 changes: 4 additions & 3 deletions Ska/tdb/tdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
'TableView', 'MsidView']


SKA = os.environ.get('SKA', os.path.join('proj', 'sot', 'ska'))

# Set None values for module globals that are set in set_tdb_version
TDB_VERSIONS = None
TDB_VERSION = None
Expand Down Expand Up @@ -61,7 +63,7 @@ def set_tdb_version(version=None):
global DATA_DIR
global tables
global msids
version_dirs = glob.glob(os.path.join(os.path.dirname(__file__), 'data', 'p0??'))
version_dirs = glob.glob(os.path.join(SKA, 'data', 'Ska.tdb', 'p0??'))
TDB_VERSIONS = sorted([int(os.path.basename(vdir)[2:]) for vdir in version_dirs])

if version is None:
Expand All @@ -70,8 +72,7 @@ def set_tdb_version(version=None):
raise ValueError('TDB version must be one of the following: {}'.format(TDB_VERSIONS))

TDB_VERSION = version
DATA_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)),
'data', 'p{:03d}'.format(TDB_VERSION))
DATA_DIR = os.path.join(SKA, 'data', 'Ska.tdb', 'p{:03d}'.format(TDB_VERSION))
tables = TableDict()
msids = MsidView()

Expand Down
2 changes: 1 addition & 1 deletion Ska/tdb/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
therein are applicable.
"""

version = '0.3'
version = '0.4'

_versplit = version.replace('dev', '').split('.')
major = int(_versplit[0])
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@
version=version,
packages=['Ska', 'Ska.tdb'],
package_dir={'Ska.tdb': 'Ska/tdb'},
package_data={'Ska.tdb': ['data/p0*/*.npy']},
)

0 comments on commit 36a0541

Please sign in to comment.