Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 460fd24

Browse files
committedMar 16, 2023
make path location get/set work properly
1 parent 23affe0 commit 460fd24

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed
 

‎astroquery/mast/core.py

+21
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,27 @@ def _login(self, token=None, store_token=False, reenter_token=False):
5959

6060
return self._auth_obj.login(token, store_token, reenter_token)
6161

62+
@property
63+
def cache_location(self):
64+
cl = self._portal_api_connection.cache_location
65+
cl_2 = self._service_api_connection.cache_location
66+
67+
if cl != cl_2:
68+
print("What should we do in this case? (currently setting it by force)")
69+
self._service_api_connection.cache_location = cl
70+
71+
return cl
72+
73+
@cache_location.setter
74+
def cache_location(self, loc):
75+
self._portal_api_connection.cache_location = loc
76+
self._service_api_connection.cache_location = loc
77+
78+
def reset_cache_location(self):
79+
"""Resets the cache location to the default astropy cache"""
80+
self._portal_api_connection.reset_cache_location()
81+
self._service_api_connection.reset_cache_location()
82+
6283
def session_info(self, verbose=True):
6384
"""
6485
Displays information about current MAST user, and returns user info dictionary.

‎astroquery/mast/discovery_portal.py

+2
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@ def __init__(self, session=None):
134134
if session:
135135
self._session = session
136136

137+
self.name = "Mast"
138+
137139
def _request(self, method, url, params=None, data=None, headers=None,
138140
files=None, stream=False, auth=None, retrieve_all=True):
139141
"""

0 commit comments

Comments
 (0)
Please sign in to comment.