Skip to content

Commit

Permalink
Merge pull request #3 from sot/packaging
Browse files Browse the repository at this point in the history
Packaging fixes
  • Loading branch information
taldcroft committed Aug 17, 2014
2 parents 36a0541 + 963cdbb commit e932104
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
7 changes: 5 additions & 2 deletions Ska/tdb/tdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ def set_tdb_version(version=None):
TDB_VERSIONS = sorted([int(os.path.basename(vdir)[2:]) for vdir in version_dirs])

if version is None:
version = TDB_VERSIONS[-1]
if TDB_VERSIONS:
version = TDB_VERSIONS[-1]
else:
version = 0 # Allow for package import / installation with no data
elif version not in TDB_VERSIONS:
raise ValueError('TDB version must be one of the following: {}'.format(TDB_VERSIONS))

Expand All @@ -91,7 +94,7 @@ def __getitem__(self, item):
filename = os.path.join(DATA_DIR, item + '.npy')
self[item] = TableView(np.load(filename))
except IOError:
raise KeyError("Table {} not in TDB files".format(item))
raise KeyError("Table {} not in TDB files (no file {})".format(item, filename))
return dict.__getitem__(self, item)

def keys(self):
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.4'
version = '0.4.1'

_versplit = version.replace('dev', '').split('.')
major = int(_versplit[0])
Expand Down
2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
author_email='aldcroft@head.cfa.harvard.edu',
py_modules=['Ska.tdb.tdb'],
version=version,
zip_safe=False,
namespace_packages=['Ska'],
packages=['Ska', 'Ska.tdb'],
package_dir={'Ska.tdb': 'Ska/tdb'},
)

0 comments on commit e932104

Please sign in to comment.