Skip to content

Commit

Permalink
Merge pull request #2862 from shresthasurav/patch1
Browse files Browse the repository at this point in the history
fix typos in function definition helper text in python files of directory astroquery/mast/collections.py
  • Loading branch information
bsipocz committed Oct 24, 2023
2 parents 5add2e3 + b81a51b commit 4e1d4fe
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 30 deletions.
8 changes: 4 additions & 4 deletions astroquery/mast/collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def query_region_async(self, coordinates, *, radius=0.2*u.deg, catalog="Hsc",
response : list of `~requests.Response`
"""

# Put coordinates and radius into consistant format
# Put coordinates and radius into consistent format
coordinates = commons.parse_coordinates(coordinates)

# if radius is just a number we assume degrees
Expand Down Expand Up @@ -255,7 +255,7 @@ def query_criteria_async(self, catalog, *, pagesize=None, page=None, **criteria)
response : list of `~requests.Response`
"""

# Seperating any position info from the rest of the filters
# Separating any position info from the rest of the filters
coordinates = criteria.pop('coordinates', None)
objectname = criteria.pop('objectname', None)
radius = criteria.pop('radius', 0.2*u.deg)
Expand Down Expand Up @@ -339,7 +339,7 @@ def query_hsc_matchid_async(self, match, *, version=3, pagesize=None, page=None)
E.g. when using a slow internet connection.
page : int, optional
Can be used to override the default behavior of all results being returned to obtain
one sepcific page of results.
one specific page of results.
Returns
-------
Expand Down Expand Up @@ -375,7 +375,7 @@ def get_hsc_spectra_async(self, *, pagesize=None, page=None):
E.g. when using a slow internet connection.
page : int, optional
Can be used to override the default behavior of all results being returned to obtain
one sepcific page of results.
one specific page of results.
Returns
-------
Expand Down
16 changes: 8 additions & 8 deletions astroquery/mast/discovery_portal.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ def _json_to_table(json_obj, col_config=None):
if col == "_selected_":
continue

# reading the colum config if given
# reading the column config if given
ignore_value = None
if col_config:
col_props = col_config.get(col, {})
ignore_value = col_props.get("ignoreValue", None)

# regularlizing the type
# regularizing the type
reg_type = utils.parse_type(atype)
atype = reg_type[1]
ignore_value = reg_type[2] if (ignore_value is None) else ignore_value
Expand All @@ -93,7 +93,7 @@ def _json_to_table(json_obj, col_config=None):
if ignore_value is not None:
col_data[np.where(np.equal(col_data, None))] = ignore_value

# no consistant way to make the mask because np.equal fails on ''
# no consistent way to make the mask because np.equal fails on ''
# and array == value fails with None
if atype == 'str':
col_mask = (col_data == ignore_value)
Expand All @@ -109,9 +109,9 @@ def _json_to_table(json_obj, col_config=None):
@async_to_sync
class PortalAPI(BaseQuery):
"""
MAST Discovery Portal API calss.
MAST Discovery Portal API calls.
Class that allows direct programatic access to the MAST Portal.
Class that allows direct programmatic access to the MAST Portal.
Should be used to facilitate all Portal API queries.
"""

Expand Down Expand Up @@ -254,7 +254,7 @@ def _get_col_config(self, service, fetch_name=None):
self._column_configs[service].update(json_response['data']['Tables'][0]
['ExtendedProperties']['continuousHistogram'])
for col, val in self._column_configs[service].items():
val.pop('hist', None) # don't want to save all this unecessary data
val.pop('hist', None) # don't want to save all this unnecessary data

def _parse_result(self, responses, verbose=False):
"""
Expand Down Expand Up @@ -302,7 +302,7 @@ def _parse_result(self, responses, verbose=False):
@class_or_instance
def service_request_async(self, service, params, pagesize=None, page=None, **kwargs):
"""
Given a Mashup service and parameters, builds and excecutes a Mashup query.
Given a Mashup service and parameters, builds and executes a Mashup query.
See documentation `here <https://mast.stsci.edu/api/v0/class_mashup_1_1_mashup_request.html>`__
for information about how to build a Mashup request.
Expand Down Expand Up @@ -496,7 +496,7 @@ def _get_columnsconfig_metadata(self, colconf_name):
examples = []

for colname in column_dict:
# skipping the _selected column (gets rmoved in return table)
# skipping the _selected column (gets removed in return table)
if colname == "_selected_":
continue

Expand Down
12 changes: 6 additions & 6 deletions astroquery/mast/missions.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
class MastMissionsClass(MastQueryWithLogin):
"""
MastMissions search class.
Class that allows direct programatic access to retrieve metadata via the MAST search API for a given mission.
Class that allows direct programmatic access to retrieve metadata via the MAST search API for a given mission.
"""

def __init__(self, *, mission='hst', service='search'):
Expand Down Expand Up @@ -86,7 +86,7 @@ def query_region_async(self, coordinates, *, radius=3*u.arcmin, limit=5000, offs
`~astropy.units` may also be used. Defaults to 3 arcminutes.
limit : int
Optional and default is 5000.
the maximun number of dataset IDs in the results.
the maximum number of dataset IDs in the results.
offset : int
Optional and default is 0
the number of records you wish to skip before selecting records.
Expand All @@ -104,7 +104,7 @@ def query_region_async(self, coordinates, *, radius=3*u.arcmin, limit=5000, offs

self.limit = limit

# Put coordinates and radius into consistant format
# Put coordinates and radius into consistent format
coordinates = commons.parse_coordinates(coordinates)

# if radius is just a number we assume degrees
Expand Down Expand Up @@ -147,7 +147,7 @@ def query_criteria_async(self, *, coordinates=None, objectname=None, radius=3*u.
`~astropy.units` may also be used. Defaults to 3 arcminutes.
limit : int
Optional and default is 5000.
the maximun number of dataset IDs in the results.
the maximum number of dataset IDs in the results.
offset : int
Optional and default is 0.
the number of records you wish to skip before selecting records.
Expand Down Expand Up @@ -211,7 +211,7 @@ def query_object_async(self, objectname, *, radius=3*u.arcmin, limit=5000, offse
`~astropy.units` may also be used. Defaults to 3 arcminutes.
limit : int
Optional and default is 5000.
the maximun number of dataset IDs in the results.
the maximum number of dataset IDs in the results.
offset : int
Optional and default is 0.
the number of records you wish to skip before selecting records.
Expand Down Expand Up @@ -255,7 +255,7 @@ def get_column_list(self):
data_table = Table(rows=rows, names=('name', 'data_type', 'description'))
return data_table
except Exception:
raise Exception(f"Error occured while trying to get column list for mission {self.mission}")
raise Exception(f"Error occurred while trying to get column list for mission {self.mission}")


MastMissions = MastMissionsClass()
16 changes: 8 additions & 8 deletions astroquery/mast/observations.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def _parse_result(self, responses, *, verbose=False): # Used by the async_to_sy

def list_missions(self):
"""
Lists data missions archived by MAST and avaiable through `astroquery.mast`.
Lists data missions archived by MAST and available through `astroquery.mast`.
Returns
-------
Expand Down Expand Up @@ -141,7 +141,7 @@ def _parse_caom_criteria(self, **criteria):
not given) or a string, and filter_set is list of filters dictionaries.
"""

# Seperating any position info from the rest of the filters
# Separating any position info from the rest of the filters
coordinates = criteria.pop('coordinates', None)
objectname = criteria.pop('objectname', None)
radius = criteria.pop('radius', 0.2*u.deg)
Expand Down Expand Up @@ -199,7 +199,7 @@ def query_region_async(self, coordinates, *, radius=0.2*u.deg, pagesize=None, pa
response : list of `~requests.Response`
"""

# Put coordinates and radius into consistant format
# Put coordinates and radius into consistent format
coordinates = commons.parse_coordinates(coordinates)

# if radius is just a number we assume degrees
Expand Down Expand Up @@ -258,7 +258,7 @@ def query_criteria_async(self, *, pagesize=None, page=None, **criteria):
E.g. when using a slow internet connection.
page : int, optional
Can be used to override the default behavior of all results being returned to obtain
one sepcific page of results.
one specific page of results.
**criteria
Criteria to apply. At least one non-positional criteria must be supplied.
Valid criteria are coordinates, objectname, radius (as in `query_region` and `query_object`),
Expand Down Expand Up @@ -351,7 +351,7 @@ def query_object_count(self, objectname, *, radius=0.2*u.deg, pagesize=None, pag
E.g. when using a slow internet connection.
page : int, optional
Can be used to override the default behavior of all results being returned to obtain
one sepcific page of results.
one specific page of results.
Returns
-------
Expand All @@ -373,7 +373,7 @@ def query_criteria_count(self, *, pagesize=None, page=None, **criteria):
E.g. when using a slow internet connection.
page : int, optional
Can be used to override the default behavior of all results being returned to obtain
one sepcific page of results.
one specific page of results.
**criteria
Criteria to apply. At least one non-positional criterion must be supplied.
Valid criteria are coordinates, objectname, radius (as in `query_region` and `query_object`),
Expand Down Expand Up @@ -852,7 +852,7 @@ class MastClass(MastQueryWithLogin):
"""
MAST query class.
Class that allows direct programatic access to the MAST Portal,
Class that allows direct programmatic access to the MAST Portal,
more flexible but less user friendly than `ObservationsClass`.
"""

Expand All @@ -879,7 +879,7 @@ def _parse_result(self, responses, *, verbose=False): # Used by the async_to_sy
@class_or_instance
def service_request_async(self, service, params, *, pagesize=None, page=None, **kwargs):
"""
Given a Mashup service and parameters, builds and excecutes a Mashup query.
Given a Mashup service and parameters, builds and executes a Mashup query.
See documentation `here <https://mast.stsci.edu/api/v0/class_mashup_1_1_mashup_request.html>`__
for information about how to build a Mashup request.
Expand Down
8 changes: 4 additions & 4 deletions astroquery/mast/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def _json_to_table(json_obj, data_key='data'):
if ignore_value is not None:
col_data[np.where(np.equal(col_data, None))] = ignore_value

# no consistant way to make the mask because np.equal fails on ''
# no consistent way to make the mask because np.equal fails on ''
# and array == value fails with None
if col_type == 'str':
col_mask = (col_data == ignore_value)
Expand All @@ -99,9 +99,9 @@ def _json_to_table(json_obj, data_key='data'):
@async_to_sync
class ServiceAPI(BaseQuery):
"""
MAST microservice API calss.
MAST microservice API calls.
Class that allows direct programatic access to MAST microservice APIs.
Class that allows direct programmatic access to MAST microservice APIs.
Should be used to facilitate all microservice API queries.
"""

Expand Down Expand Up @@ -224,7 +224,7 @@ def _parse_result(self, response, verbose=False, data_key='data'):
@class_or_instance
def service_request_async(self, service, params, page_size=None, page=None, use_json=False, **kwargs):
"""
Given a MAST fabric service and parameters, builds and excecutes a fabric microservice catalog query.
Given a MAST fabric service and parameters, builds and executes a fabric microservice catalog query.
See documentation `here <https://catalogs.mast.stsci.edu/docs/index.html>`__
for information about how to build a MAST catalogs microservice request.
Expand Down

0 comments on commit 4e1d4fe

Please sign in to comment.