Skip to content
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

Add hardware section to metadata #927

Merged
merged 9 commits into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added _static/hardware_logos/aws.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions demonstrations/tutorial_qubit_rotation.metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,12 @@
"id": "tutorial_state_preparation",
"weight": 1.0
}
],
"hardware": [
{
"id": "aws",
"link": "https://pennylane.ai/qml/demos/tutorial_qubit_rotation",
"logo": "/_static/hardware_logos/aws.png"
}
]
}
20 changes: 19 additions & 1 deletion demonstrations_metadata.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ Below is given an example of a complete metadata file for a demonstration.
"id": "tutorial_qubit_rotation",
"weight": 1.0
}
],
"hardware": [
{
"id": "aws",
"link": "https://pennylane.ai/qml/demos/tutorial_quantum_transfer_learning",
"logo": "/_static/hardware_logos/aws.png"
}
]
}
```
Expand All @@ -84,6 +91,7 @@ The table below gives details about the fields in the metadata JSON file for ver
| `basedOnPapers` | Yes, but can be an empty array | `array` of `string` | An array of the DOIs for the papers this demo is based on. |
| `referencedByPapers` | Yes, but can be an empty array | `array` of `string` | An array of the DOIs of any papers that reference this demo. |
| `relatedContent` | Yes, but can be an empty array | `array` of `object` | An array of objects describing the content related to this demo. See below for the object structure. |
| `hardware` | No. Can be an empty array. | `array` of `object` | An array of objects representing third-party vendors who can run the demo on their hardware. See below for the object structure. |

### Author Object Properties

Expand Down Expand Up @@ -125,6 +133,14 @@ The table below gives details about the fields in the metadata JSON file for ver
| `id` | Yes | `string` | The id of the content that this relation refers to. For demos, it's the file name of the demo without the extension - i.e., `tutorial_haar_measure`. |
| `weight` | Yes | `number` | A number between -1.0 and 1.0 indicating both how closely related these two pieces of content are, and which one it is preferable to encounter first. A value of 1.0 indicates that these two pieces of content are *very* closely related, and this one should be read first, and the linked one second. A value of -1.0 indicates again that these two pieces of content are very closely related, but that the linked one should be read first. A value of 0.0 indicates that these two pieces of content have nothing to do with each other. |

### Hardware Object Properties

| Name | Is Required | Value Type | Description |
|---|---|---|---|
| `id` | Yes | `enum` | The ID of the hardware vendor |
| `link` | Yes | `string` | Link to run the demo on the vendor's hardware |
| `logo` | Yes | `string` | The URI of the vendor's logo image, whether it be something hosted locally or on another site. |




Expand Down Expand Up @@ -202,7 +218,9 @@ The table below gives details about the fields in the metadata JSON file for ver
"id": "",
"weight": 1.0
}
]
],
"relatedContent": [],
"hardware": []
}
```

Expand Down
7 changes: 7 additions & 0 deletions metadata_schemas/demo.metadata.schema.0.1.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,13 @@
"items": {
"$ref": "file:./objects/related.content.schema.0.1.0.json"
}
},
"hardware": {
"description": "An array of objects representing third-party vendors who can run the demo on their hardware. An empty array is allowed.",
"type": "array",
"items": {
"$ref": "file:./objects/hardware.schema.0.1.0.json"
}
}
},
"required": [
Expand Down
25 changes: 25 additions & 0 deletions metadata_schemas/objects/hardware.schema.0.1.0.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "hardware.schema.0.1.0.json",
"title": "Hardware",
"description": "Hardware vendors that can run the demo on their hardware",
"type": "object",
"properties": {
"id": {
"description": "The ID of the hardware vendor",
"enum": ["aws"]
},
"link": {
"description": "Link to run the demo on the vendor's hardware",
"type": "string"
},
"logo": {
"description": "The URI of the vendor's logo image, whether it be something hosted locally or on another site.",
"type": "string",
"format": "uri-reference"
}
},
"required": [
"id", "link", "logo"
]
}