From fa2f55ed8ee8d78194895295b766296d35eade2f Mon Sep 17 00:00:00 2001 From: Martin Habedank Date: Mon, 4 May 2026 16:25:16 +0100 Subject: [PATCH 1/4] add preliminary URL and tests for SimpleAnalysis --- hepdata/config.py | 3 +++ tests/records_test.py | 14 ++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/hepdata/config.py b/hepdata/config.py index 86b5040f..81cf5e08 100644 --- a/hepdata/config.py +++ b/hepdata/config.py @@ -363,6 +363,9 @@ def _(x): 'GAMBIT': { 'endpoint_url': 'https://gambitbsm.org/analyses.json', }, + 'SimpleAnalysis': { + 'endpoint_url': 'https://simpleanalysis.docs.cern.ch/analyses.json', + }, #'ufo': {}, #'xfitter': {}, #'applgrid': {}, diff --git a/tests/records_test.py b/tests/records_test.py index 97003318..15486f6f 100644 --- a/tests/records_test.py +++ b/tests/records_test.py @@ -1206,6 +1206,20 @@ def test_update_analyses(app): assert len(analysis_resources) == 1 assert analysis_resources[0].file_location == 'https://github.com/GambitBSM/gambit_2.6/blob/release_2.6/ColliderBit/src/analyses/Analysis_ATLAS_13TeV_MONOJET_139infb.cpp' + # ins1847779 has SimpleAnalysis file attached and is also listed in SimpleAnalysis JSON file + analysis_resources = DataResource.query.filter_by(file_type='SimpleAnalaysis').all() + assert len(analysis_resources) == 1 + update_analyses('SimpleAnalysis') + analysis_resources = DataResource.query.filter_by(file_type='SimpleAnalaysis').all() + assert len(analysis_resources) == 1 + file_location = re.sub(r'v[\d.]+', "VERSION", analysis_resources[0].file_location) + assert file_location == 'https://gitlab.cern.ch/atlas-sa/simple-analysis/-/tree/VERSION/SimpleAnalysisCodes/src/ANA-EXOT-2018-06.cxx' + import_records(['ins1597123'], synchronous=True) # only appears in SimpleAnalysis JSON file + assert len(analysis_resources) == 0 + update_analyses('SimpleAnalysis') + analysis_resources = DataResource.query.filter_by(file_type='SimpleAnalaysis').all() + assert len(analysis_resources) == 1 + # Call update_analysis using an endpoint with no endpoint_url current_app.config["ANALYSES_ENDPOINTS"]["TestAnalysis"] = {} update_analyses('TestAnalysis') From 21ec673b965201c434c51491f276494b76514471 Mon Sep 17 00:00:00 2001 From: Martin Habedank Date: Mon, 4 May 2026 17:16:13 +0100 Subject: [PATCH 2/4] fix test --- tests/records_test.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/tests/records_test.py b/tests/records_test.py index 15486f6f..afbcbaa3 100644 --- a/tests/records_test.py +++ b/tests/records_test.py @@ -1208,17 +1208,12 @@ def test_update_analyses(app): # ins1847779 has SimpleAnalysis file attached and is also listed in SimpleAnalysis JSON file analysis_resources = DataResource.query.filter_by(file_type='SimpleAnalaysis').all() - assert len(analysis_resources) == 1 + assert len(analysis_resources) == 0 update_analyses('SimpleAnalysis') analysis_resources = DataResource.query.filter_by(file_type='SimpleAnalaysis').all() assert len(analysis_resources) == 1 file_location = re.sub(r'v[\d.]+', "VERSION", analysis_resources[0].file_location) assert file_location == 'https://gitlab.cern.ch/atlas-sa/simple-analysis/-/tree/VERSION/SimpleAnalysisCodes/src/ANA-EXOT-2018-06.cxx' - import_records(['ins1597123'], synchronous=True) # only appears in SimpleAnalysis JSON file - assert len(analysis_resources) == 0 - update_analyses('SimpleAnalysis') - analysis_resources = DataResource.query.filter_by(file_type='SimpleAnalaysis').all() - assert len(analysis_resources) == 1 # Call update_analysis using an endpoint with no endpoint_url current_app.config["ANALYSES_ENDPOINTS"]["TestAnalysis"] = {} From d23550e9d1fcec86065f4b7238e1d4b4ea1c22e0 Mon Sep 17 00:00:00 2001 From: Martin Habedank Date: Tue, 5 May 2026 11:41:49 +0100 Subject: [PATCH 3/4] add inspire ID without SimpleAnalysis code already on HEPData, fix typo, fix numbers --- tests/records_test.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/records_test.py b/tests/records_test.py index afbcbaa3..49ad9d42 100644 --- a/tests/records_test.py +++ b/tests/records_test.py @@ -1206,13 +1206,14 @@ def test_update_analyses(app): assert len(analysis_resources) == 1 assert analysis_resources[0].file_location == 'https://github.com/GambitBSM/gambit_2.6/blob/release_2.6/ColliderBit/src/analyses/Analysis_ATLAS_13TeV_MONOJET_139infb.cpp' - # ins1847779 has SimpleAnalysis file attached and is also listed in SimpleAnalysis JSON file - analysis_resources = DataResource.query.filter_by(file_type='SimpleAnalaysis').all() - assert len(analysis_resources) == 0 + # SimpleAnalysis + import_records(['ins1597123'], synchronous=True) # 1597123 is in SimpleAnalysis JSON but doesn't have code uploaded to HEPData + analysis_resources = DataResource.query.filter_by(file_type='SimpleAnalysis').all() + assert len(analysis_resources) == 2 # 1811596 and 1847779 have SimpleAnalysis file attached update_analyses('SimpleAnalysis') - analysis_resources = DataResource.query.filter_by(file_type='SimpleAnalaysis').all() - assert len(analysis_resources) == 1 - file_location = re.sub(r'v[\d.]+', "VERSION", analysis_resources[0].file_location) + analysis_resources = DataResource.query.filter_by(file_type='SimpleAnalysis').all() + assert len(analysis_resources) == 5 # file attached: 1811596, 1847779; JSON file: 1811596, 1847779, 1597123 + file_location = re.sub(r'v[\d.]+', "VERSION", analysis_resources[4].file_location) # 1847779 assert file_location == 'https://gitlab.cern.ch/atlas-sa/simple-analysis/-/tree/VERSION/SimpleAnalysisCodes/src/ANA-EXOT-2018-06.cxx' # Call update_analysis using an endpoint with no endpoint_url From 40cf823fc06d4c8812196c1719abc9f029a27859 Mon Sep 17 00:00:00 2001 From: Martin Habedank Date: Tue, 12 May 2026 11:51:15 +0100 Subject: [PATCH 4/4] point add correct SimpleAnalysis link --- tests/records_test.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/records_test.py b/tests/records_test.py index 49ad9d42..c0318ac7 100644 --- a/tests/records_test.py +++ b/tests/records_test.py @@ -1213,8 +1213,7 @@ def test_update_analyses(app): update_analyses('SimpleAnalysis') analysis_resources = DataResource.query.filter_by(file_type='SimpleAnalysis').all() assert len(analysis_resources) == 5 # file attached: 1811596, 1847779; JSON file: 1811596, 1847779, 1597123 - file_location = re.sub(r'v[\d.]+', "VERSION", analysis_resources[4].file_location) # 1847779 - assert file_location == 'https://gitlab.cern.ch/atlas-sa/simple-analysis/-/tree/VERSION/SimpleAnalysisCodes/src/ANA-EXOT-2018-06.cxx' + assert analysis_resources[4].file_location == 'https://gitlab.cern.ch/atlas-sa/simple-analysis/-/tree/master/SimpleAnalysisCodes/src/ANA-EXOT-2018-06.cxx' # 1847779 # Call update_analysis using an endpoint with no endpoint_url current_app.config["ANALYSES_ENDPOINTS"]["TestAnalysis"] = {}