-
Notifications
You must be signed in to change notification settings - Fork 14
Analysis schema #906
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Analysis schema #906
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
08d7877
add first draft of schema
mhabedan 60e448d
move test file and add schema test
mhabedan 5f6e5af
add jsonschema package to CI
mhabedan b49198a
fix schema path
mhabedan 27564c6
add optional field 'implementations_license'
mhabedan 0bddeb9
specify used default license
mhabedan f05c92a
make 'license' field consistent with hepdata-validator (https://githu…
mhabedan 51445c1
add tool_type field
mhabedan 503ff8f
rename 'tool_type' field to 'implementations_description'
mhabedan 0d972a9
add date_created to schema
mhabedan 9f204ba
introduce schema_version field
mhabedan f4dd175
more renames, add readme
mhabedan 698e8c5
correct url
mhabedan 34df6e1
include schema validation
mhabedan ab9fce0
Merge branch 'main' into analysisSchema
mhabedan 788c6bb
add schema version 0.1.0
mhabedan a44e698
test for analyses schema version
mhabedan 87b94b6
Merge branch 'main' into analysisSchema
mhabedan 2014de3
avoid name starting with 'test' because that is being picked up by py…
mhabedan 63fb262
fix typos in schema
mhabedan 9b46ff7
fix implementations_license typo
mhabedan 534e8fc
disallow nested placeholders
mhabedan c2c5d76
test for v0.1.0 instead of 1.0.0
mhabedan 98c072a
use SModelS as test case, test for implementation license
mhabedan e747050
fix license id
mhabedan 9657ff6
use license name instead of id
mhabedan ce4b4ca
Merge branch 'main' into analysisSchema
GraemeWatt 5add1d9
theme: add Flask route to analyses JSON schema
GraemeWatt ee2d5b7
tests: extend e2e tests for analyses JSON schema
GraemeWatt 3d8f340
tests: extend test_update_analyses for coverage
GraemeWatt d25ee47
Space around == according to Python style guide
mhabedan 17a2b31
Another space around == according to Python style guide
mhabedan 091b8ca
records: address review by Copilot and codecov-ai
GraemeWatt 5975669
tests: filter out error message for favicon.ico
GraemeWatt 3897cff
fix grammar/typos
mhabedan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
hepdata/templates/analyses_schema/0.1.0/analyses_schema.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| { | ||
| "$schema": "https://json-schema.org/draft/2020-12/schema", | ||
| "$id": "https://hepdata.net/analyses/schemas/0.1.0/analyses_schema.json", | ||
| "title": "HEPData analysis tool schema", | ||
| "description": "A JSON schema for tracking implementations of HEPData analyses in different tools", | ||
| "type": "object", | ||
| "patternProperties": { | ||
| "^[0-9]+$": { | ||
| "type": "array", | ||
| "items": { | ||
| "type": "string" | ||
| }, | ||
| "minItems": 1 | ||
| } | ||
| }, | ||
| "additionalProperties": false | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| # About the analyses JSON schema | ||
|
|
||
| This readme details a JSON schema which is used by reinterpretation tools to communicate to HEPData which analyses are implemented in that tool and where to find the implementations. | ||
|
|
||
| ## The standard | ||
|
|
||
| The standard is quite simple: the whole file is basically a dictionary where the keys are the different INSPIRE IDs for the analyses implemented in the tool and the values are lists of tool-internal names for the reimplentations, i.e. | ||
| ```JSON | ||
| { | ||
| "<INSPIRE ID>": ["<implementation 1>", "<implementation 2>"] | ||
| } | ||
| ``` | ||
|
|
||
| No other fields are allowed. | ||
|
|
||
| ## Example | ||
| A minimal example for an analyses JSON adhering to the standard looks like this: | ||
| ```JSON | ||
| { | ||
| "100592": ["MARKI_1975_I100592", "MARKI_ALTERNATIVE_IMPLEMENTATION"], | ||
| "1081268": ["LHCB_2013_I1081268"] | ||
| } | ||
| ``` | ||
|
|
||
| ## Testing an implementation | ||
|
|
||
| Whether an analyses JSON file adheres to the standard defined here, can be checked with python as follows: | ||
| ```python | ||
| import json | ||
| import jsonschema | ||
|
|
||
| with open("analyses_schema.json") as f: | ||
| schema = json.load(f) | ||
| with open("analyses_example.json") as f: | ||
| test = json.load(f) | ||
|
|
||
| jsonschema.validate(instance=test, schema=schema) | ||
| ``` |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.