Skip to content

Commit

Permalink
testing fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanraba committed Dec 9, 2021
1 parent 69efc4a commit f64ee00
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 14 deletions.
4 changes: 0 additions & 4 deletions casaconfig/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions casaconfig/measures_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 ...')
Expand All @@ -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))
Expand Down
9 changes: 4 additions & 5 deletions casaconfig/pull_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)

2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit f64ee00

Please sign in to comment.