Remove needless argument checks from gaia
#2682
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
astroquery.gaia.GaiaClass
contained a handful of needless argument checks:load_data()
separately checking forretrieval_type
beingNone
(its default value is"ALL"
) is not needed because the value is checked later on, unlessavoid_datatype_check
is explicitly set toTrue
:astroquery/astroquery/gaia/core.py
Lines 245 to 250 in 03c8420
load_data()
checking forids
beingNone
only makes a difference ifNone
is the explicitly specified value, but any other possible invalid value would pass this check, so it is not very useful.cross_match()
several arguments were given default values and the code then checked if any of those arguments had the default value. It is better to not specify the default value at all and to let Python itself ensure that the mandatory argument values are specified. This is not only simpler but also ensures that the error message contains the correct argument name, and if multiple arguments are missing then Python's error message makes that clear too.