diff --git a/hepdata/cli.py b/hepdata/cli.py index d85e0effd..d0b9c64fe 100644 --- a/hepdata/cli.py +++ b/hepdata/cli.py @@ -223,9 +223,10 @@ def do_unload(records_to_unload): @utils.command() @with_appcontext -def find_and_add_record_analyses(): - """Finds analyses such as Rivet and adds them to records.""" - update_analyses() +@click.option('--endpoint', '-e', type=str, help='Specific endpoint to update (e.g. "rivet" or "MadAnalysis"). Omit for all.') +def find_and_add_record_analyses(endpoint): + """Finds analyses such as Rivet and MadAnalysis 5 and adds them to records.""" + update_analyses(endpoint) @utils.command() diff --git a/hepdata/config.py b/hepdata/config.py index 73c9fa80c..f91066c8b 100644 --- a/hepdata/config.py +++ b/hepdata/config.py @@ -313,11 +313,14 @@ def _(x): 'endpoint_url': 'http://rivet.hepforge.org/analyses.json', 'url_template': 'http://rivet.hepforge.org/analyses/{0}' }, + 'MadAnalysis': { + 'endpoint_url': 'https://madanalysis.irmp.ucl.ac.be/raw-attachment/wiki/MA5SandBox/analyses.json', + 'url_template': 'https://doi.org/{0}' + }, #'ufo': {}, #'xfitter': {}, #'applgrid': {}, #'fastnlo': {}, - #'madanalysis': {}, } HISTFACTORY_FILE_TYPE = 'HistFactory' diff --git a/hepdata/ext/opensearch/document_enhancers.py b/hepdata/ext/opensearch/document_enhancers.py index 4086a4a82..b8abe895b 100644 --- a/hepdata/ext/opensearch/document_enhancers.py +++ b/hepdata/ext/opensearch/document_enhancers.py @@ -91,7 +91,8 @@ def add_shortened_authors(doc): def add_analyses(doc): """ - TODO: Generalise for badges other than Rivet + Add analyses links such as Rivet, MadAnalysis 5 and HistFactory to the index. + :param doc: :return: """ diff --git a/hepdata/modules/records/assets/js/hepdata_common.js b/hepdata/modules/records/assets/js/hepdata_common.js index 5261b6247..393150b39 100644 --- a/hepdata/modules/records/assets/js/hepdata_common.js +++ b/hepdata/modules/records/assets/js/hepdata_common.js @@ -44,7 +44,7 @@ HEPDATA.file_type_to_details = { "bitbucket": {"icon": "bitbucket", "description": "Bitbucket Repository"}, "fastnlo": {"icon": "area-chart", "description": "fastNLO Analysis"}, "rivet": {"icon": "area-chart", "description": "Rivet Analysis"}, - "madanalysis": {"icon": "area-chart", "description": "MadAnalysis5 Analysis"}, + "madanalysis": {"icon": "area-chart", "description": "MadAnalysis 5 Analysis"}, "xfitter": {"icon": "area-chart", "description": "xFitter Analysis"}, "applgrid": {"icon": "area-chart", "description": "APPLgrid Analysis"}, "ufo": {"icon": "rocket", "description": "Universal Feynrules Output (UFO)"}, diff --git a/hepdata/modules/records/templates/hepdata_records/components/resources-widget.html b/hepdata/modules/records/templates/hepdata_records/components/resources-widget.html index 63a999289..396017f49 100644 --- a/hepdata/modules/records/templates/hepdata_records/components/resources-widget.html +++ b/hepdata/modules/records/templates/hepdata_records/components/resources-widget.html @@ -39,7 +39,7 @@

Add Resource for Submission