Skip to content

Commit 76e8ef1

Browse files
committed
Merge pull request #417 from agroener/cosmosim-table-updates
Cosmosim table updates
2 parents 67527ff + 8d710d2 commit 76e8ef1

File tree

9 files changed

+657
-230
lines changed

9 files changed

+657
-230
lines changed

CHANGES

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
- Added new tool: ALMA archive query tool
3030
http://astroquery.readthedocs.org/en/latest/alma/alma.html
3131
(#411)
32-
3332
- setup script and installation fixes
3433

3534
0.2 (2014-08-17)

astroquery/alma/core.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@ def _get_dataarchive_url(self):
150150
self.dataarchive_url = self.archive_url
151151
return self.dataarchive_url
152152

153-
154153
def stage_data(self, uids, cache=False):
155154
"""
156155
Stage ALMA data
@@ -205,7 +204,6 @@ def stage_data(self, uids, cache=False):
205204
self._staging_log['request_id'] = request_id
206205
log.debug("Request ID: {0}".format(request_id))
207206

208-
209207
# Submit a request for the specific request ID identified above
210208
submission_url = os.path.join(self.dataarchive_url, 'rh', 'submission',
211209
request_id)
@@ -248,7 +246,6 @@ def stage_data(self, uids, cache=False):
248246
errormessage = root.find('div', id='errorContent').string.strip()
249247
raise RemoteServiceError(errormessage)
250248

251-
252249
data_table = root.findAll('table', class_='list', id='report')[0]
253250
columns = {'uid':[], 'URL':[], 'size':[]}
254251
for tr in data_table.findAll('tr'):
@@ -275,7 +272,6 @@ def _HEADER_data_size(self, files):
275272
"""
276273
Given a list of file URLs, return the data size. This is useful for
277274
assessing how much data you might be downloading!
278-
279275
(This is discouraged by the ALMA archive, as it puts unnecessary load
280276
on their system)
281277
"""
@@ -337,11 +333,9 @@ def retrieve_data_from_uid(self, uids, cache=True):
337333

338334
#log.info("Determining download size for {0} files...".format(len(files)))
339335
#each_size,totalsize = self.data_size(files)
340-
341336
log.info("Downloading files of size {0}...".format(totalsize.to(u.GB)))
342337
# TODO: Add cache=cache keyword here. Currently would have no effect.
343338
downloaded_files = self.download_files(file_urls)
344-
345339
return downloaded_files
346340

347341
def _parse_result(self, response, verbose=False):
@@ -642,7 +636,6 @@ def _validate_payload(self, payload):
642636
"by the ALMA query service:"
643637
" {0}".format(invalid_params))
644638

645-
646639
Alma = AlmaClass()
647640

648641
def clean_uid(uid):

astroquery/alma/tests/test_alma.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ def test_SgrAstar(monkeypatch):
7171
monkeypatch.setattr(Alma, '_get_dataarchive_url', _get_dataarchive_url)
7272
alma = Alma()
7373
monkeypatch.setattr(alma, '_get_dataarchive_url', _get_dataarchive_url)
74-
7574
# monkeypatch instructions from https://pytest.org/latest/monkeypatch.html
7675
monkeypatch.setattr(alma, '_request', alma_request)
7776
# set up local cache path to prevent remote query

astroquery/alma/tests/test_alma_remote.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,13 @@ def test_stage_data(self, temp_dir):
3737

3838
result_s = alma.query_object('Sgr A*')
3939
assert b'2011.0.00217.S' in result_s['Project_code']
40-
4140
uid = result_s['Asdm_uid'][0]
4241

4342
alma.stage_data([uid])
4443

4544
def test_doc_example(self, temp_dir):
4645
alma = Alma()
4746
alma.cache_location = temp_dir
48-
4947
m83_data = alma.query_object('M83')
5048
assert m83_data.colnames == ['Project_code', 'Source_name', 'RA',
5149
'Dec', 'Band', 'Frequency_resolution',

astroquery/cosmosim/core.py

Lines changed: 637 additions & 197 deletions
Large diffs are not rendered by default.
File renamed without changes.
Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,24 @@
11
# Licensed under a 3-clause BSD style license - see LICENSE.rst
22
import os
3+
import tempfile
4+
import shutil
35
from astropy.tests.helper import pytest, remote_data
4-
from ...cosmosim import CosmoSim
6+
try:
7+
import keyring
8+
HAS_KEYRING = True
9+
except ImportError:
10+
HAS_KEYRING = False
11+
try:
12+
from ...cosmosim import CosmoSim
13+
COSMOSIM_IMPORTED = True
14+
except ImportError:
15+
COSMOSIM_IMPORTED = False
516
from ...exceptions import LoginError
17+
18+
SKIP_TESTS = not(HAS_KEYRING and COSMOSIM_IMPORTED)
19+
20+
#@pytest.mark.skipif('SKIP_TESTS')
21+
#@remote_data
22+
#class TestEso:
23+
# def __init__():
24+

astroquery/millennium/__init__.py

Lines changed: 0 additions & 21 deletions
This file was deleted.

astroquery/millennium/tests/test_millennium_remote.py

Whitespace-only changes.

0 commit comments

Comments
 (0)