Skip to content

Add HackAnalysis analyses to endpoints#881

Merged
GraemeWatt merged 1 commit into
mainfrom
add-hackanalysis
May 6, 2025
Merged

Add HackAnalysis analyses to endpoints#881
GraemeWatt merged 1 commit into
mainfrom
add-hackanalysis

Conversation

@GraemeWatt
Copy link
Copy Markdown
Member

@GraemeWatt GraemeWatt commented May 6, 2025

  • Add HackAnalysis to ANALYSES_ENDPOINTS.
  • Also add description to other analysis endpoints. The database will need to be updated, which can be done by running the following Python code in the hepdata shell environment:
from flask import current_app
from hepdata.modules.submission.models import DataResource
from invenio_db import db
endpoints = current_app.config["ANALYSES_ENDPOINTS"]
for analysis_endpoint in endpoints:
    analysis_resources = DataResource.query.filter_by(file_type=analysis_endpoint).all()
    for resource in analysis_resources:
        if "description" in endpoints[analysis_endpoint]:
            resource.file_description = str(endpoints[analysis_endpoint]["description"])
db.session.commit()

The OpenSearch index should also be updated using hepdata utils reindex -b 1.

* Also add 'description' to other analysis endpoints.
@coveralls
Copy link
Copy Markdown

Coverage Status

coverage: 83.647%. remained the same
when pulling c7df980 on add-hackanalysis
into 1aa4130 on main.

@GraemeWatt GraemeWatt merged commit 3a4eae4 into main May 6, 2025
7 checks passed
@GraemeWatt GraemeWatt deleted the add-hackanalysis branch May 7, 2025 13:08
@GraemeWatt GraemeWatt mentioned this pull request May 7, 2025
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