diff --git a/casaconfig/__init__.py b/casaconfig/__init__.py index 760c09b..c648633 100644 --- a/casaconfig/__init__.py +++ b/casaconfig/__init__.py @@ -2,12 +2,8 @@ """ casaconfig API functions """ -import pkg_resources - __name__ = 'casaconfig' -datapath = pkg_resources.resource_filename('casaconfig', '__data__/') - from .get_data_dir import get_data_dir from .measures_update import measures_update from .measures_available import measures_available diff --git a/casaconfig/measures_update.py b/casaconfig/measures_update.py index fe01dbc..ec11213 100644 --- a/casaconfig/measures_update.py +++ b/casaconfig/measures_update.py @@ -55,8 +55,8 @@ def measures_update(path=None, version=None, force=False, logger=None): # don't re-download the same data if not force: if ((version is not None) and (version == current)) or ((version is None) and (updated == datetime.today().strftime('%Y-%m-%d'))): - print('casaconfig current measures detected, using version %s' % current) - if logger is not None: logger.post('casaconfig current measures detected, using version %s' % current, 'INFO') + print('casaconfig current measures detected in %s, using version %s' % (path, current)) + if logger is not None: logger.post('casaconfig current measures detected in %s, using version %s' % (path, current), 'INFO') return print('casaconfig connecting to ftp.astron.nl ...') @@ -75,8 +75,8 @@ def measures_update(path=None, version=None, force=False, logger=None): return with open(os.path.join(path,'measures.ztar'), 'wb') as fid: - print('casaconfig downloading data from ASTRON server ...') - if logger is not None: logger.post('casaconfig downloading %s from ASTRON server ...' % target, 'INFO') + print('casaconfig downloading %s from ASTRON server to %s ...' % (target, path)) + if logger is not None: logger.post('casaconfig downloading %s from ASTRON server to %s ...' % (target, path), 'INFO') ftp.retrbinary('RETR ' + target, fid.write) os.system("tar -zxf %s -C %s" % (os.path.join(path,'measures.ztar'), path)) diff --git a/casaconfig/pull_data.py b/casaconfig/pull_data.py index 320451a..5303ef5 100644 --- a/casaconfig/pull_data.py +++ b/casaconfig/pull_data.py @@ -49,12 +49,12 @@ def pull_data(path=None, branch=None, force=False, logger=None): # check contents of destination folder expected = ['catalogs', 'demo', 'geodetic', 'alma', 'nrao', 'ephemerides', 'telescope_layout', 'dish_models', 'gui'] if (len(np.setdiff1d(expected, os.listdir(path))) == 0) and (force == False): - print('casaconfig found populated data folder') - if logger is not None: logger.post('casaconfig found populated data folder', 'INFO') + print('casaconfig found populated data folder %s' % path) + if logger is not None: logger.post('casaconfig found populated data folder %s' % path, 'INFO') return - print('casaconfig downloading data contents...') - if logger is not None: logger.post('casaconfig downloading data contents...', 'INFO') + print('casaconfig downloading data contents to %s ...' % path) + if logger is not None: logger.post('casaconfig downloading data contents to %s ...' % path, 'INFO') try: repo = git.Repo.clone_from('https://github.com/casangi/casaconfig.git', path+'/tmp', branch=branch) @@ -66,4 +66,3 @@ def pull_data(path=None, branch=None, force=False, logger=None): os.system('cp -r %s/tmp/data/* %s' % (path, path)) os.system('rm -fr %s/tmp' % path) - diff --git a/setup.py b/setup.py index 951052c..bdc8843 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ setup( name='casaconfig', - version='0.0.19', + version='0.0.20', description='CASA Operational Configuration Package', long_description=long_description, long_description_content_type="text/markdown",