Skip to content

Migrate network clients to new unified Scraper format (Fix #113)#142

Open
Amityush-lgtm wants to merge 8 commits intosunpy:mainfrom
Amityush-lgtm:fix-scraper-issue-113
Open

Migrate network clients to new unified Scraper format (Fix #113)#142
Amityush-lgtm wants to merge 8 commits intosunpy:mainfrom
Amityush-lgtm:fix-scraper-issue-113

Conversation

@Amityush-lgtm
Copy link

@Amityush-lgtm Amityush-lgtm commented Feb 9, 2026

PR Description

Migrate network clients to unified Scraper format. Fixes: #113

Summary

This PR updates all radiospectra network clients (RSTN, eCallisto, I-LOFAR, and PSP) to use the modern, unified sunpy.net.scraper.Scraper interface introduced in SunPy 6.1 and enforced in 7.1.0.
It fixes CI failures caused by breaking changes in SunPy 7.1.0 and brings the networking code in line with current SunPy standards. This PR restores compatibility and modernizes the implementation to match current SunPy expectations.

What changed

  • Unified Scraper patterns: Replaced separate baseurl + pattern usage with a single modern pattern string using the {{ }} format required by Scraper.
  • Bug fixes across clients:
    • PSP: Fixed errors caused by regex-style braces conflicting with Scraper’s internal .format() handling.
    • RSTN: Fixed initialization errors and a KeyError by aligning pattern capture groups with metadata usage.
    • eCallisto & I-LOFAR: Migrated to the unified pattern format and removed redundant configuration.
  • Client logic updates: Adjusted search() and pre_search_hook() implementations to match the updated Scraper API.

Verification

  • Tested on Python 3.12 with SunPy 7.1.0
  • All networking-related tests now pass:
    • test_ecallisto_client
    • test_rstn_client
    • test_ilofar
    • test_psp_client
  • All pre-commit hooks (ruff, isort, codespell) pass.

Reviewer:

@samaloney, Please let me know if this change looks good to you or if you’d like any revisions.

@Amityush-lgtm
Copy link
Author

All the CI Checks are green now. The PR is ready for review now @samaloney.
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update scraper based client for new format

1 participant