-
-
Notifications
You must be signed in to change notification settings - Fork 401
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
freeze degree string representation #2347
Conversation
5619d32
to
19f43d0
Compare
Codecov Report
@@ Coverage Diff @@
## main #2347 +/- ##
=======================================
Coverage 63.40% 63.40%
=======================================
Files 131 131
Lines 17044 17044
=======================================
Hits 10807 10807
Misses 6237 6237
📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
If the failures were indeed caused by using some particular versions of external software then why were the tests failing only in this subpackage? |
This subpackage selects mock request data by constructing filename from the request. This way all of the remote tests can have a local version.
|
I was wondering what makes this subpackage different from all the rest. I think your explanation sounds reasonable. But if the problem can be solved by improving the robustness of generating filenames from the requests then why is it necessary to update thousands of lines in data files? If the precision of numerical values would be explicitly set to what it is with the combinations of software that did not cause the tests to fail then the generated filenames should be the same as they have been so far, and there should be no need to modify the mock data at all. |
I share the concern about regenerated data, do you expect them to be stable after this PR? For the long term we need a solution where mock data may change only if there is a server-side API overhaul and not when more data gets added, etc. |
I think you are referring to the option 2 in my list above: using the unchanged mock data for changed requests, by making filename generation insensitive to some changes of request, right? astroquery/astroquery/heasarc/tests/test_heasarc_remote_isdc.py Lines 77 to 78 in db3f08b
I instead went for option 3 - making the request the same for the same user input, with different software versions. For changing files (also responding to @bsipocz), there are several factors:
|
I think all of the above should be covered by the remote data tests, the mock ones is fine if to be limited to ensure As for your second example, we're in that situation with skyview, and it's an annoyance really. Releases change, not too often, but often enough, so we're in a constant catch-up with our test suite without really serving any real purpose. Would be nice to not be exactly sensitive on exact matches. And for random responses, I would say the same as above, if the structure is the same, and one that is expected then it doesn't matter. The big things to look for that if we run into an empty return, or a truncated one or a dropped column when we expect full results, etc. |
Alright, as I try to elaborate in #2348 , there is really no special reason in this parameterized fixture approach I had to change most of the files. I just wanted to make sure that the code will continue to be able to read new responses. But given the disadvantages, I will revert them. Actually, I could just close this PR, and continue in #2348, as you suggested elsewhere. The comments become similar too. edit: maybe, to fix the tests quickly, we could revert all the data changes in this PR, and but keep the change to the request - it's an actual fix for the module functionality. And then we can proceed in the other PRs. |
The commits have to be squashed because otherwise the data files that were added in the first commit will remain in the repository. |
98f4d59
to
8802f84
Compare
8802f84
to
714e6fd
Compare
Done! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
@@ -171,7 +171,7 @@ def query_region_async(self, position: Union[coordinates.SkyCoord, str], | |||
# Generate the request |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you may want to leave a one-liner comment as a reminder why formatting is applied here, otherwise it's likely someone would wonder a few years down the line 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, done. I did not manage in one line, only two, but if you have better ideas - please suggest!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
multi-liner is fine, too, I just meant that it can be just a very short reminder :)
For some reason, the default representation depends on astropy and/or python version.