Skip to content

Move back-end download functions to /api/sedfittingresult#431

Draft
Abh1ramManugur1 wants to merge 12 commits into
scimma:mainfrom
Abh1ramManugur1:411-apisedfitting-download
Draft

Move back-end download functions to /api/sedfittingresult#431
Abh1ramManugur1 wants to merge 12 commits into
scimma:mainfrom
Abh1ramManugur1:411-apisedfitting-download

Conversation

@Abh1ramManugur1

Copy link
Copy Markdown
Collaborator

Resolves #411

  • Added new download functions to /api/sedfittingresult, replacing view functions: download_chains, download_modelfit, download_percentiles
  • New download URL: /api/sedfittingresult/{id}/download/{download-type}/
  • Fixed download URLs on /api/sedfittingresult using new download functions, rerouted transient download on front-end to these functions. Functionality from front-end is identical

Abh1ramManugur1 added a commit to Abh1ramManugur1/blast that referenced this pull request Jun 25, 2026
Copied same helper function from commit: 59789d6 in PR scimma#431
@manning-ncsa

Copy link
Copy Markdown
Collaborator

When I query example endpoint http://localhost:4000/api/sedfittingresult/?transient=2025ass&aperture_type=local, the returned data looks like

[
    {
        "id": 7,
        "chains_file": "http://app/api/sedfittingresult/7/download/chains/",
        "model_file": "http://app/api/sedfittingresult/7/download/model/",
        "percentiles_file": "http://app/api/sedfittingresult/7/download/percentiles/",
        "log_mass_16": 8.20374421964611,
...

It looks like Django is using the Docker Compose service name app as the domain when constructing the URL. We need to fix the URL building functions to generate a valid download link. While we're at it, these three functions should be refactored into a single function with the file type as an input argument.

@manning-ncsa
manning-ncsa marked this pull request as draft July 6, 2026 10:08
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.

Move the download_x endpoints functionality to /api/sedfittingresult/

2 participants