Skip to content

Added github mirror#391

Merged
nabobalis merged 6 commits into
mainfrom
mirror
Mar 26, 2026
Merged

Added github mirror#391
nabobalis merged 6 commits into
mainfrom
mirror

Conversation

@nabobalis
Copy link
Copy Markdown
Member

@nabobalis nabobalis commented Mar 10, 2026

Fixes #390

Summary by Sourcery

Add a new LMSAL-managed GitHub mirror to the list of SSW data mirrors and align related file path handling.

New Features:

  • Introduce a GitHub-hosted mirror URL for static SSW AIA response files.

Enhancements:

  • Clarify and simplify handling of AIA instrument response and error table file paths, including documenting the current version usage.

Documentation:

  • Add a changelog entry describing the new GitHub mirror feature.

@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai Bot commented Mar 10, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adds an LMSAL-managed GitHub mirror to the list of SSW mirrors for static AIA response/error files, simplifies error table URL construction, and clarifies the AIA response version constant documentation without changing the version used.

Sequence diagram for downloading AIA error table using SSW mirrors

sequenceDiagram
    actor User_script
    participant Aiapy_calibrate_utils as Aiapy_calibrate_utils
    participant Mirror_GitHub as Mirror_GitHub
    participant Mirror_Soho as Mirror_Soho
    participant Mirror_Hesperia as Mirror_Hesperia

    User_script->>Aiapy_calibrate_utils: request_error_table(version_3)
    Aiapy_calibrate_utils->>Aiapy_calibrate_utils: build_urls_from_SSW_MIRRORS("sdo/aia/response/aia_V3_error_table.txt")

    Aiapy_calibrate_utils->>Mirror_GitHub: HTTP GET aia_V3_error_table.txt
    alt GitHub mirror has file
        Mirror_GitHub-->>Aiapy_calibrate_utils: 200 OK, file contents
        Aiapy_calibrate_utils-->>User_script: return error_table_data
    else GitHub mirror unavailable
        Mirror_GitHub-->>Aiapy_calibrate_utils: error
        Aiapy_calibrate_utils->>Mirror_Soho: HTTP GET aia_V3_error_table.txt
        alt Soho mirror succeeds
            Mirror_Soho-->>Aiapy_calibrate_utils: 200 OK, file contents
            Aiapy_calibrate_utils-->>User_script: return error_table_data
        else Soho mirror fails
            Mirror_Soho-->>Aiapy_calibrate_utils: error
            Aiapy_calibrate_utils->>Mirror_Hesperia: HTTP GET aia_V3_error_table.txt
            Mirror_Hesperia-->>Aiapy_calibrate_utils: response or error
            Aiapy_calibrate_utils-->>User_script: error or error_table_data
        end
    end
Loading

File-Level Changes

Change Details Files
Add LMSAL-managed GitHub mirror to SSW mirror list for static AIA response files.
  • Extend the _SSW_MIRRORS list with a new LMSAL GitHub raw-content URL used as a mirror for static AIA files.
  • Document that the new mirror is a GitHub mirror managed by LMSAL.
aiapy/__init__.py
Clarify AIA instrument response version constant usage and documentation.
  • Remove an outdated TODO related to AIA response version changes.
  • Adjust the VERSION_NUMBER comment to clarify that version 9 exists but is identical to version 8, keeping VERSION_NUMBER set to 8.
aiapy/response/channel.py
Inline AIA error table filename in URL construction to better support multiple mirrors.
  • Remove the _AIA_ERROR_FILE format string constant for the AIA error table filename.
  • Construct the error table URLs directly using the version-specific filename string when joining with each mirror in _SSW_MIRRORS.
  • Keep the existing SHA-256 hash mapping for the error table unchanged.
aiapy/calibrate/utils.py
Record the new feature in the changelog.
  • Add a new feature changelog entry file documenting the addition of the GitHub mirror.
changelog/391.feature.rst

Assessment against linked issues

Issue Objective Addressed Explanation
#390 Allow aiapy to download the required AIA response and error table files from a non-SSW mirror (the LMSAL-managed GitHub mirror) in addition to the existing SSW mirrors.

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Comment thread aiapy/__init__.py Outdated

_SSW_MIRRORS = [
# Github mirror managed by LMSAL
"https://raw.githubusercontent.com/LM-SAL/backup-files/refs/heads/aia/static/",
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I made it the default for now.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is there a reason for preferring this over the "real" mirrors? This does have the disadvantage that any updates to those files will not automatically take effect in aiapy, but maybe that isn't necessarily a bad thing.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

None, I can and will switch it back to SSW.

@nabobalis nabobalis marked this pull request as ready for review March 10, 2026 23:47
Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey - I've found 1 issue, and left some high level feedback:

  • Consider keeping the error table filename as a single template constant (similar to AIA_INSTRUMENT_FILE) rather than hardcoding the V3 path inline, so future versions or additional mirrors only require updating one place.
  • The VERSION_NUMBER comment in channel.py could be clarified (and possibly reference the underlying source) to explain why V9 exists but is treated as identical to V8, since this affects how future version bumps should be handled.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider keeping the error table filename as a single template constant (similar to `AIA_INSTRUMENT_FILE`) rather than hardcoding the V3 path inline, so future versions or additional mirrors only require updating one place.
- The `VERSION_NUMBER` comment in `channel.py` could be clarified (and possibly reference the underlying source) to explain why V9 exists but is treated as identical to V8, since this affects how future version bumps should be handled.

## Individual Comments

### Comment 1
<location path="aiapy/__init__.py" line_range="21" />
<code_context>

 _SSW_MIRRORS = [
+    # Github mirror managed by LMSAL
+    "https://raw.githubusercontent.com/LM-SAL/backup-files/refs/heads/aia/static/",
     "https://soho.nascom.nasa.gov/solarsoft/",
     "https://hesperia.gsfc.nasa.gov/ssw/",
</code_context>
<issue_to_address>
**question (bug_risk):** Double-check the interaction of this mirror URL with `urljoin` and the expected directory structure.

Since downstream code does `urljoin(mirror, "sdo/aia/response/...")`, this trailing `static/` will yield URLs like `.../static/sdo/aia/response/...`. Please confirm that this matches the actual layout of the `backup-files` repo (e.g. `static/sdo/aia/response/...`) and, if not, update either the mirror URL or the relative path used with `urljoin` so the joined URLs point to the correct files.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread aiapy/__init__.py Outdated

_SSW_MIRRORS = [
# Github mirror managed by LMSAL
"https://raw.githubusercontent.com/LM-SAL/backup-files/refs/heads/aia/static/",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

question (bug_risk): Double-check the interaction of this mirror URL with urljoin and the expected directory structure.

Since downstream code does urljoin(mirror, "sdo/aia/response/..."), this trailing static/ will yield URLs like .../static/sdo/aia/response/.... Please confirm that this matches the actual layout of the backup-files repo (e.g. static/sdo/aia/response/...) and, if not, update either the mirror URL or the relative path used with urljoin so the joined URLs point to the correct files.

@nabobalis nabobalis force-pushed the mirror branch 2 times, most recently from f951373 to 54f3517 Compare March 11, 2026 00:35
Comment thread aiapy/__init__.py Outdated

_SSW_MIRRORS = [
# Github mirror managed by LMSAL
"https://raw.githubusercontent.com/LM-SAL/backup-files/refs/heads/aia/static/",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is there a reason for preferring this over the "real" mirrors? This does have the disadvantage that any updates to those files will not automatically take effect in aiapy, but maybe that isn't necessarily a bad thing.

@nabobalis nabobalis merged commit a8ab919 into main Mar 26, 2026
24 checks passed
@nabobalis nabobalis deleted the mirror branch March 26, 2026 20:27
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.

Pull needed files from non-SSW, non-SSW mirror

2 participants