Skip to content
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

Bugfix: SIMBAD test cleanup, ROW_LIMIT support #2637

Merged
merged 13 commits into from
Jan 14, 2023

Conversation

keflavich
Copy link
Contributor

This error has been present since day 1:
https://github.com/astropy/astroquery/blame/4822f81d66ed5322d2c3b6e23a51c3595545bc1b/astroquery/simbad/tests/test_simbad_remote.py#L16

I'm not clear why this wasn't causing errors before.

This is a partial fix for some open remote test failures in #2634, but is a WIP as I expect there are others to fix.

@codecov
Copy link

codecov bot commented Jan 10, 2023

Codecov Report

Merging #2637 (4cdf297) into main (07fb421) will increase coverage by 0.03%.
The diff coverage is 75.00%.

@@            Coverage Diff             @@
##             main    #2637      +/-   ##
==========================================
+ Coverage   68.90%   68.94%   +0.03%     
==========================================
  Files         304      304              
  Lines       22621    22621              
==========================================
+ Hits        15587    15596       +9     
+ Misses       7034     7025       -9     
Impacted Files Coverage Δ
astroquery/exceptions.py 0.00% <0.00%> (ø)
astroquery/simbad/core.py 90.62% <100.00%> (+0.21%) ⬆️
astroquery/query.py 62.40% <0.00%> (+3.48%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@@ -111,3 +112,11 @@ class EmptyResponseError(ValueError):
Astroquery error class to be raised when the query returns an empty result
"""
pass


class BadRowWarning(AstropyWarning):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not so sure about the naming of this, is this a row, or an entry, or an object? after all this warning is expected with e.g. vectorized query_object queries. (what is actually/orginal error/warning coming back? (I suppose I can check on it tomorrow myself)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error can vary. For example, in one of the tests, it is:

[5] 'gHer' this identifier has an incorrect format for catalogs:
	gH : Gurwell + Hodge
	g : Giclas

In another case, it is:

[5] 'dosntexist': No known catalog could be found

But the net effect is to not include that search term in the output results.

Maybe this should be MissingRowWarning or BlankResponseWarning? I think it is right that we raise a warning rather than an error, because it is often valuable to run a query where you do not expect results for all search terms.

Copy link
Member

@bsipocz bsipocz Jan 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still, my problem with the "Row" remains, it's feels like not the right word. MissingObjectWarning/MissingTargetWarning/BadObjectWarning, or in fact your suggestion of BlankResponseWarning could all work better.

(it's an implementation detail that the result will be returned one object per row, it could be a different structure, too, so I think the warning shouldn't really refer to this detail)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah sounds good - I'll change to... I guess BlankResponseWarning, then? It's not necessarily a missing object, since the first example says 'there might be an object there but you got the name format wrong'.

@bsipocz bsipocz added the simbad label Jan 10, 2023
@bsipocz bsipocz added this to the v0.4.7 milestone Jan 10, 2023
@bsipocz
Copy link
Member

bsipocz commented Jan 10, 2023

This will need a changelog for sure.

@keflavich keflavich changed the title Bugfix: M42 is at -5d, not -5h! Bugfix: SIMBAD test cleanup, ROW_LIMIT support Jan 10, 2023
Copy link
Member

@eerovaher eerovaher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a couple of refactoring suggestions. Furthermore, test_query_region_null() and test_query_small_region_null(), which this pull request modifies, could be implemented as a single parametrized test.

astroquery/exceptions.py Outdated Show resolved Hide resolved
astroquery/simbad/core.py Outdated Show resolved Hide resolved
@bsipocz
Copy link
Member

bsipocz commented Jan 14, 2023

Thanks @keflavich!

@bsipocz bsipocz merged commit 1446f1a into astropy:main Jan 14, 2023
@bsipocz
Copy link
Member

bsipocz commented Jan 14, 2023

Ohh, we should have squash down the bit of the back and forth before merging, well, next time.

@keflavich
Copy link
Contributor Author

sorry yeah, I meant to do a squash before the end

@bsipocz bsipocz mentioned this pull request Jan 23, 2023
19 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants