Move astropy.samp to pyvo.astropy_samp#729
Conversation
|
Oh and one more thing: this obviously erases the original authors and makes tools like Edit: I think GitHub would notify them all if I were to do that, so I'm reluctant to, to avoid spam. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #729 +/- ##
==========================================
- Coverage 84.12% 82.62% -1.50%
==========================================
Files 79 91 +12
Lines 8617 10287 +1670
==========================================
+ Hits 7249 8500 +1251
- Misses 1368 1787 +419 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
The main thing that got the move stalled for a few times in the past that this codebase and the existing |
|
@pllim - please add Fergus to the astropy org, so I don't need to approve each of the CI runs here. |
Try marking that test with |
|
I invited PR author to https://github.com/orgs/astropy/teams/astropy-contributors team, though I am not sure if that affects the CI approval. I think you have to keep approving until they have a PR in... |
I think it should be fine once he is in the team. |
|
@bsipocz it's not happening inside a test, it's during setup: It's strange, I can't reproduce it locally now, it magically started working fine after trying different |
|
Locally it will work fine as long as you have the datafile. Let me just push a one line to the config, which should fix it. |
|
A few gotchas/notes:
|
|
Ignore: codecov status; and python3.9 status -- there is already a PR to bump those versions, once it's merged we can rebase this and hopefully the failure is going away, and if not we'll fix it at that point. |
|
Ah excellent! Thank you for that, it would have taken me a while to think to look there. And thanks for the notes! Out of curiosity, why is it recommended to work on a feature branch on a fork? Isn't the fork's In the meantime, I merged everything together into a Am I alright to push that here as well? |
Because you may want to work something else, too while this is waiting for review :) |
OK, that sounds all right, push it in here. I'll leave the actual review to the others as I don't really have relevant samp experience. |
That's absolutely fair enough, will bear that in mind for the future! I've pushed the last of my changes then for now and will await review. Thanks again for your help and for wrangling the CI :) |
|
The sphinx warnings are real, but we can wrangle the docs once the review is done and if opinions about the public API are expressed. |
bsipocz
left a comment
There was a problem hiding this comment.
Some very high level comments, I would say the most important part will be to think about what the public API should look like.
There was a problem hiding this comment.
we don;t need this file, I wonder why was it still around for astropy
There was a problem hiding this comment.
@astrofrog probably should have deleted it in astropy/astropy#8413 but looks like he deleted the content but not the file itself. Probably an oversight.
| n_retries = _config.ConfigItem( | ||
| 10, "How many times to retry communications when they fail" | ||
| ) | ||
|
|
There was a problem hiding this comment.
I suppose we may want to have some package level public API with an __all__; at least this should be a discussion item during review of what and how the public API should look like.
| else: | ||
| try: | ||
| urlopen("http://google.com", timeout=1.0) | ||
| except Exception: |
There was a problem hiding this comment.
It would be probably useful to clean up all these blanket exceptions (here and everywhere below); maybe it's more as a part of a follow-up though
| from .errors import SAMPProxyError | ||
|
|
||
|
|
||
| def internet_on(): |
There was a problem hiding this comment.
It seems to be used in a couple of places: https://github.com/search?q=repo%3Aastropy%2Fastropy%20internet_on&type=code
|
|
||
| from .standard_profile import SAMPSimpleXMLRPCRequestHandler, ThreadingXMLRPCServer | ||
|
|
||
| __all__ = [] |
There was a problem hiding this comment.
Nope. Not since astropy/astropy#1907 but doesn't mean you cannot make them public now.
|
On Fri, Feb 06, 2026 at 01:31:41PM -0800, Fergus Baker wrote:
fjebaker left a comment (astropy/pyvo#729)
I've pushed the last of my changes then for now and will await
review. Thanks again for your help and for wrangling the CI :)
I've paged through a summary diff towards 2f31cc1, and while it
would certainly be useful to again think about much of sampy's code,
my take would be that it's old enough to count as ground truth until
proven buggy. I'd hence be happy to take this as a baseline (merged
into pyvo, as far as I am concerned) and then start working from that
for API and robustness improvements and in particular documentation;
against what's currently documented in astropy.samp, I think I'd
prefer showing people the context manager (without it, they're quite
likely to accumulate hung clients in the Hub), and perhaps also the
convenience functions for sending tables and images.
Fergus: If there's non-technical changes against what was in
astropy.samp already in this PR, could you briefly say where they are
and where we should take a closer look?
|
@msdemlei I have made no changes to the implementation or interfaces in this PR -- all of the commits are simply moving code around and appeasing the style checker, packaging, and adjusting one test case to catch the actual exception being thrown (*). My plan was to help move the existing SAMP code, unchanged, from astropy to pyvo, so that I would have a clear place where I can start opening PRs to fix common pitfalls. As Markus mentions, the documentation is also not always the most clarifying (e.g. on the difference between the different I agree that decisions on what should the public API be ought to be deferred to later PRs. Nothing has been changed from the current experience, so a user would not notice anything other than an eventual (*) for the record, this PR was prepared by taking #527 and the main branch of astropy and using diff to resolve any changes and correct the import statements as necessary. If you diff astropy main and this branch now, that's also all you would see. |
|
I'm ok with this plan above. The plan is to release 1.9 before ivoa, so I think we have plenty of time to sort out any critical issues that may pop up. |
msdemlei
left a comment
There was a problem hiding this comment.
Given #729 (comment), I'm all in favour of merging this.
|
@fjebaker - could you please add a sentence or two to the changelog entry, and also rebase? That would take care of two of the failing CI jobs. |
|
For the CI failures:
|
Thanks!
I'll have a look at this, maybe directly push some changes if the workaround will feel to be too hacky to explain
Do ignore codecov, it has no significance for this type of PR (we only care about it if a PR directly decreases coverage, here everything is just ported so our new baseline will have to change). |
|
|
||
| from astropy.samp import SAMPHubServer, SAMPIntegratedClient, conf | ||
| from astropy.samp.web_profile import CLIENT_ACCESS_POLICY, CROSS_DOMAIN | ||
| from astropy.tests.helper import CI |
There was a problem hiding this comment.
Just swap this out with the line, here and in the other file, too.
CI = os.environ.get("CI", "false") == "true"
The Python 3.10 CI fails to resolve the necessary versions of astropy to import the CI helper. As suggested by Brigitta, these are replaced with queries to the environment variables.
These particular test seems to hang forever on the MacOS CI runner, likely due to some race condition or other.
|
I tried discovering which tests are causing MacOS to fail but it's a bit tedious since I don't have a Mac and can't reproduce the failure outside of the GitHub CI. So, instead I've just skipped basically all the SAMP tests on MacOS. It's not ideal but I think if it needs to be addressed it can be done so in a subsequent PR. |
| from pyvo.samp.hub_proxy import SAMPHubProxy | ||
| from pyvo.samp.integrated_client import SAMPIntegratedClient | ||
|
|
||
| IS_MACOS = sys.platform == "darwin" |
There was a problem hiding this comment.
Locally these don't hang, so I went ahead and change that they are only skipped in CI.
That sounds all good. The issue is that the tests passing well for me locally, on osx. So I'm just as puzzled. Would you mind opening a reminder issue for turning back on these tests? |
|
@bsipocz thanks for looking at this so quick! Yes, I can put together a deprecating PR (?) for astropy. I had a quick look at how astropy does that and I gather I should decorate all of the main SAMP classes and methods with |
|
Thanks! So is the next step to release pyvo with this feature and then we can deprecate |
This will be released in v1.9, end of May - early June. I don't see dates for v8.0 yet, do you have them by any chance? We can either coordinate to get it out in 8.0, or schedule the deprecation for v8.1 to be merged once 8.0 is out. |
It's whole module level deprecation, we may instead want to just raise the warning at the time of import (e.g. I do similar things in astroquery for astroquery.irsa; there maybe similar precedents on the sub-submodule level in astropy, too). |
|
Yeah I have to remember how we did that for vo_conesearch back in the days. |
|
A single module level warning seems reasonable |
@astrofrog , can you please fill in https://github.com/astropy/astropy/wiki/Release-Calendar ? 🙏 I am guessing it would be Apr-May 2026, which is just before the release here. So maybe pushing back to astropy v8.1 is more realistic. Which means we cannot merge the astropy.samp deprecation PR until after v8.0.x is branched. |
|
OK, then my suggestion is that either you @pllim or I open the astropy PR as it's just scaffolding and admin wrangling through the different versions (and we should not do that to Fergus just for the sake of it, there isn't much interesting happening there but potentially a lot of coordination and kicking the testing infrastructure until it's happy.) |
|
Sure! But we should not do it until we can sort out the release timelines. No point doing it now if we have to wait till v8.1 |
Except that we don't forget about it 😅 ; there is certainly precedent to parking PRs like that. |
This comment was marked as resolved.
This comment was marked as resolved.
|
OK, here it is: astropy/astropy#19373 |
Addresses #155 (mirrored at astropy/astropy#9763).
(should it be called
pyvo.astropy_samp? In my opinion it would be cleaner to merge with the existing SAMP things so it's all underpyvo.samp?)Not much had changed in the astropy/main version of the SAMP implementation since #527, so I applied the diffs on top as a fixup commit.
The only additional change required was a test case that I don't understand why it wasn't failing before? From my understanding of the exception subclass rules,
SAMPProxyErrorcould never be caught when axmlrpc.client.Faultwas being thrown.I had the tests for SAMP all passing (some non-SAMP ones were failing though) and then rebased onto the main branch of pyvo. I'm now hitting this error when I try to use pytest:
I don't really know how to resolve it. If I curl the URLs its trying to reach it's 200 fine? Importing
pyvoand using SAMP works too.Help with that much appreciated!