Skip to content

Commit 023975b

Browse files
authored
Merge pull request #3278 from bsipocz/MAINT_gaia_deprecate_band
MAINT: deprecate ``band`` from ``Gaia.load_data()``
2 parents 67b5ed5 + f021816 commit 023975b

File tree

3 files changed

+11
-16
lines changed

3 files changed

+11
-16
lines changed

CHANGES.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ New Tools and Services
99
API changes
1010
-----------
1111

12+
gaia
13+
^^^^
1214

15+
- Deprecated ``band`` from ``load_data`` as it has no effect on upstream
16+
response any more. [#3278]
1317

1418
Service fixes and enhancements
1519
------------------------------

astroquery/gaia/core.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ def logout(self, *, verbose=False):
168168
except HTTPError:
169169
log.error("Error logging out data server")
170170

171-
@deprecated_renamed_argument("output_file", None, since="0.4.8")
171+
@deprecated_renamed_argument(("output_file", "band"), (None, None), since=("0.4.8", "0.4.11"))
172172
def load_data(self, ids, *, data_release=None, data_structure='INDIVIDUAL', retrieval_type="ALL",
173173
linking_parameter='SOURCE_ID', valid_data=False, band=None, avoid_datatype_check=False,
174174
format="votable", dump_to_file=False, overwrite_output_file=False, verbose=False,
@@ -212,10 +212,6 @@ def load_data(self, ids, *, data_release=None, data_structure='INDIVIDUAL', retr
212212
In order to retrieve only valid data (data rows where flux is not null and/or the
213213
rejected_by_photometry flag is set to False) this request parameter should be included
214214
with valid_data=True.
215-
band : str, optional, default None, valid values: G, BP, RP
216-
By default, the epoch photometry service returns all the
217-
available photometry bands for the requested source.
218-
This parameter allows to filter the output lightcurve by its band.
219215
avoid_datatype_check: boolean, optional, default False.
220216
By default, this value will be set to False. If it is set to 'true'
221217
the Datalink items tags will not be checked.
@@ -281,11 +277,6 @@ def load_data(self, ids, *, data_release=None, data_structure='INDIVIDUAL', retr
281277
elif valid_data:
282278
params_dict['VALID_DATA'] = "true"
283279

284-
if band is not None:
285-
if band != 'G' and band != 'BP' and band != 'RP':
286-
raise ValueError(f"Invalid band value '{band}' (Valid values: 'G', 'BP' and 'RP)")
287-
else:
288-
params_dict['BAND'] = band
289280
if isinstance(ids, str):
290281
ids_arg = ids
291282
else:

astroquery/gaia/tests/test_gaiatap.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -821,7 +821,7 @@ def test_datalink_querier_load_data_vot_exception(mock_datalink_querier, overwri
821821
mock_datalink_querier.load_data(ids=[5937083312263887616], data_release='Gaia DR3',
822822
data_structure='INDIVIDUAL',
823823
retrieval_type="ALL",
824-
linking_parameter='SOURCE_ID', valid_data=False, band=None,
824+
linking_parameter='SOURCE_ID', valid_data=False,
825825
avoid_datatype_check=False,
826826
format="votable", dump_to_file=True,
827827
overwrite_output_file=overwrite_output_file,
@@ -835,7 +835,7 @@ def test_datalink_querier_load_data_vot_exception(mock_datalink_querier, overwri
835835
mock_datalink_querier.load_data(ids=[5937083312263887616], data_release='Gaia DR3',
836836
data_structure='INDIVIDUAL',
837837
retrieval_type="ALL",
838-
linking_parameter='SOURCE_ID', valid_data=False, band=None,
838+
linking_parameter='SOURCE_ID', valid_data=False,
839839
avoid_datatype_check=False,
840840
format="votable", dump_to_file=True,
841841
overwrite_output_file=overwrite_output_file,
@@ -850,7 +850,7 @@ def test_datalink_querier_load_data_vot(mock_datalink_querier):
850850
result_dict = mock_datalink_querier.load_data(ids=[5937083312263887616], data_release='Gaia DR3',
851851
data_structure='INDIVIDUAL',
852852
retrieval_type="ALL",
853-
linking_parameter='SOURCE_ID', valid_data=False, band=None,
853+
linking_parameter='SOURCE_ID', valid_data=False,
854854
avoid_datatype_check=False,
855855
format="votable", dump_to_file=True, overwrite_output_file=True,
856856
verbose=False)
@@ -888,7 +888,7 @@ def test_datalink_querier_load_data_ecsv(mock_datalink_querier_ecsv):
888888
result_dict = mock_datalink_querier_ecsv.load_data(ids=[5937083312263887616], data_release='Gaia DR3',
889889
data_structure='INDIVIDUAL',
890890
retrieval_type="ALL",
891-
linking_parameter='SOURCE_ID', valid_data=False, band=None,
891+
linking_parameter='SOURCE_ID', valid_data=False,
892892
avoid_datatype_check=False,
893893
format="ecsv", dump_to_file=True, overwrite_output_file=True,
894894
verbose=False)
@@ -926,7 +926,7 @@ def test_datalink_querier_load_data_csv(mock_datalink_querier_csv):
926926
result_dict = mock_datalink_querier_csv.load_data(ids=[5937083312263887616], data_release='Gaia DR3',
927927
data_structure='INDIVIDUAL',
928928
retrieval_type="ALL",
929-
linking_parameter='SOURCE_ID', valid_data=False, band=None,
929+
linking_parameter='SOURCE_ID', valid_data=False,
930930
avoid_datatype_check=False,
931931
format="csv", dump_to_file=True, overwrite_output_file=True,
932932
verbose=False)
@@ -965,7 +965,7 @@ def test_datalink_querier_load_data_fits(mock_datalink_querier_fits):
965965
result_dict = mock_datalink_querier_fits.load_data(ids=[5937083312263887616], data_release='Gaia DR3',
966966
data_structure='INDIVIDUAL',
967967
retrieval_type="ALL",
968-
linking_parameter='SOURCE_ID', valid_data=False, band=None,
968+
linking_parameter='SOURCE_ID', valid_data=False,
969969
avoid_datatype_check=False,
970970
format="fits", dump_to_file=True, overwrite_output_file=True,
971971
verbose=False)

0 commit comments

Comments
 (0)