Skip to content

Add SWPC events support - #211

Open
samaloney wants to merge 5 commits into
sunpy:mainfrom
samaloney:feat-swpc-events
Open

Add SWPC events support#211
samaloney wants to merge 5 commits into
sunpy:mainfrom
samaloney:feat-swpc-events

Conversation

@samaloney

Copy link
Copy Markdown
Member

PR Description

Add an SWPC Event Fido client to search and download the event files/archives.
Add a parser to parse the files/arhcives into and an astropy QTable/s

AI Assistance Disclosure

AI tools were used for:

  • [x ] Code generation (e.g., when writing an implementation or fixing a bug)
  • [x ] Test/benchmark generation
  • [x ] Documentation (including examples)
  • [ ] Research and understanding
  • [ ] No AI tools were used

Regardless of AI use, the human contributor remains fully responsible for correctness, design choices, licensing compatibility, and long-term maintainability.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Not ready to approve

There are confirmed runtime failure cases (empty archive vstack and empty flare-row handling in the example) plus a few documentation/text issues that should be fixed before merging.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.

Pull request overview

Adds first-class support for NOAA SWPC “Edited Solar Events List” data by introducing a SunPy/Fido client for discovery/download and parsers to convert both daily event files and yearly archives into astropy.table.QTable outputs, plus documentation, examples, and tests.

Changes:

  • Added SWPCEventsClient (Fido client) to search/fetch daily files and archived yearly tarballs from SWPC FTP.
  • Added parsers for single files and yearly archives, plus a dispatcher helper with optional TimeRange filtering.
  • Added tests, sample SWPC fixtures, Sphinx API docs entry, a comparison example, and a changelog entry.
File summaries
File Description
sunkit_instruments/swpc/client.py New Fido client for SWPC Edited Solar Events List discovery/download.
sunkit_instruments/swpc/parser.py New parsers for daily files and yearly tar.gz archives, plus dispatcher/filtering.
sunkit_instruments/swpc/init.py Exposes SWPC client and parsing functions as public API.
sunkit_instruments/swpc/tests/test_client.py Remote-data tests covering Fido search/fetch behavior.
sunkit_instruments/swpc/tests/test_parser.py Unit tests for parsing new/old formats, archives, masks, and day rollover.
sunkit_instruments/swpc/tests/init.py Test package marker.
sunkit_instruments/data/test/swpc_20260710events.txt New-format fixture for parser tests.
sunkit_instruments/data/test/swpc_19970121events.txt Old-format fixture for parser tests.
sunkit_instruments/data/test/swpc_19970115events.txt “No events” fixture for parser tests.
examples/compare_swpc_events_hek.py Example comparing SWPC XRA events with HEK and GOES XRS flux.
docs/code_ref/swpc.rst New API reference page for sunkit_instruments.swpc.
docs/code_ref/index.rst Adds SWPC to the API reference index.
changelog/211.feature.rst Changelog entry announcing SWPC client/parsers + example.
Review details
  • Files reviewed: 12/14 changed files
  • Comments generated: 4
  • Review effort level: Lite

We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.

Comment thread examples/compare_swpc_events_hek.py
Comment thread sunkit_instruments/swpc/client.py Outdated
Comment thread changelog/211.feature.rst Outdated
Comment thread sunkit_instruments/swpc/parser.py
samaloney and others added 3 commits July 31, 2026 00:08
@samaloney
samaloney marked this pull request as ready for review July 31, 2026 13:52
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.

2 participants