Skip to content

MAINT: deprecate band from Gaia.load_data() #3278

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ New Tools and Services
API changes
-----------

gaia
^^^^

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

Service fixes and enhancements
------------------------------
Expand Down
11 changes: 1 addition & 10 deletions astroquery/gaia/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def logout(self, *, verbose=False):
except HTTPError:
log.error("Error logging out data server")

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

if band is not None:
if band != 'G' and band != 'BP' and band != 'RP':
raise ValueError(f"Invalid band value '{band}' (Valid values: 'G', 'BP' and 'RP)")
else:
params_dict['BAND'] = band
if isinstance(ids, str):
ids_arg = ids
else:
Expand Down
12 changes: 6 additions & 6 deletions astroquery/gaia/tests/test_gaiatap.py
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,7 @@ def test_datalink_querier_load_data_vot_exception(mock_datalink_querier, overwri
mock_datalink_querier.load_data(ids=[5937083312263887616], data_release='Gaia DR3',
data_structure='INDIVIDUAL',
retrieval_type="ALL",
linking_parameter='SOURCE_ID', valid_data=False, band=None,
linking_parameter='SOURCE_ID', valid_data=False,
avoid_datatype_check=False,
format="votable", dump_to_file=True,
overwrite_output_file=overwrite_output_file,
Expand All @@ -835,7 +835,7 @@ def test_datalink_querier_load_data_vot_exception(mock_datalink_querier, overwri
mock_datalink_querier.load_data(ids=[5937083312263887616], data_release='Gaia DR3',
data_structure='INDIVIDUAL',
retrieval_type="ALL",
linking_parameter='SOURCE_ID', valid_data=False, band=None,
linking_parameter='SOURCE_ID', valid_data=False,
avoid_datatype_check=False,
format="votable", dump_to_file=True,
overwrite_output_file=overwrite_output_file,
Expand All @@ -850,7 +850,7 @@ def test_datalink_querier_load_data_vot(mock_datalink_querier):
result_dict = mock_datalink_querier.load_data(ids=[5937083312263887616], data_release='Gaia DR3',
data_structure='INDIVIDUAL',
retrieval_type="ALL",
linking_parameter='SOURCE_ID', valid_data=False, band=None,
linking_parameter='SOURCE_ID', valid_data=False,
avoid_datatype_check=False,
format="votable", dump_to_file=True, overwrite_output_file=True,
verbose=False)
Expand Down Expand Up @@ -888,7 +888,7 @@ def test_datalink_querier_load_data_ecsv(mock_datalink_querier_ecsv):
result_dict = mock_datalink_querier_ecsv.load_data(ids=[5937083312263887616], data_release='Gaia DR3',
data_structure='INDIVIDUAL',
retrieval_type="ALL",
linking_parameter='SOURCE_ID', valid_data=False, band=None,
linking_parameter='SOURCE_ID', valid_data=False,
avoid_datatype_check=False,
format="ecsv", dump_to_file=True, overwrite_output_file=True,
verbose=False)
Expand Down Expand Up @@ -926,7 +926,7 @@ def test_datalink_querier_load_data_csv(mock_datalink_querier_csv):
result_dict = mock_datalink_querier_csv.load_data(ids=[5937083312263887616], data_release='Gaia DR3',
data_structure='INDIVIDUAL',
retrieval_type="ALL",
linking_parameter='SOURCE_ID', valid_data=False, band=None,
linking_parameter='SOURCE_ID', valid_data=False,
avoid_datatype_check=False,
format="csv", dump_to_file=True, overwrite_output_file=True,
verbose=False)
Expand Down Expand Up @@ -965,7 +965,7 @@ def test_datalink_querier_load_data_fits(mock_datalink_querier_fits):
result_dict = mock_datalink_querier_fits.load_data(ids=[5937083312263887616], data_release='Gaia DR3',
data_structure='INDIVIDUAL',
retrieval_type="ALL",
linking_parameter='SOURCE_ID', valid_data=False, band=None,
linking_parameter='SOURCE_ID', valid_data=False,
avoid_datatype_check=False,
format="fits", dump_to_file=True, overwrite_output_file=True,
verbose=False)
Expand Down
Loading