|
2 | 2 | "cells": [
|
3 | 3 | {
|
4 | 4 | "cell_type": "code",
|
5 |
| - "execution_count": 1, |
| 5 | + "execution_count": 2, |
6 | 6 | "metadata": {},
|
7 | 7 | "outputs": [],
|
8 | 8 | "source": [
|
|
18 | 18 | },
|
19 | 19 | {
|
20 | 20 | "cell_type": "code",
|
21 |
| - "execution_count": 2, |
| 21 | + "execution_count": 3, |
22 | 22 | "metadata": {},
|
23 | 23 | "outputs": [
|
24 | 24 | {
|
|
47 | 47 | " - Terminals: The IDs of spaces which must match the codomain of the parent block.\n",
|
48 | 48 | " - Subsystem: The subsystem of the processor which is a system that the processor represents and passes its ports to and receives spaces to its terminals from.\n",
|
49 | 49 | " - System ID: The ID of the system that the processor is a processor for.\n",
|
50 |
| - " - Wires: The IDs of the wires that connect the processor ports and terminals to the system ports and terminals.\n", |
| 50 | + " - Port Mappings: This array, which is equal in length to the number of ports on the processor, maps each port to an internal processor within the subsystem and its port index that the port should be passed on to.\n", |
| 51 | + " - Processor: The ID of the processor in the system.\n", |
| 52 | + " - Index: The index of the terminal.\n", |
| 53 | + " - Terminal Mappings: This array, which is equal in length to the number of terminals on the processor, maps terminal port to an internal processor within the subsystem and its terminal index that the outer terminal should receive output from.\n", |
| 54 | + " - Processor: The ID of the processor in the system.\n", |
| 55 | + " - Index: The index of the terminal.\n", |
51 | 56 | " - Wires: A list of wires in the block diagram protocol that follow the wire schema.\n",
|
52 | 57 | " - ID: A unique identifier for the wire.\n",
|
53 | 58 | " - Parent: The ID of the space that the wire is passing.\n",
|
|
83 | 88 | },
|
84 | 89 | {
|
85 | 90 | "cell_type": "code",
|
86 |
| - "execution_count": null, |
| 91 | + "execution_count": 4, |
87 | 92 | "metadata": {},
|
88 |
| - "outputs": [], |
89 |
| - "source": [] |
| 93 | + "outputs": [ |
| 94 | + { |
| 95 | + "data": { |
| 96 | + "text/plain": [ |
| 97 | + "{'type': 'array',\n", |
| 98 | + " 'description': 'A list of processors in the block diagram protocol that follow the processor schema.',\n", |
| 99 | + " 'title': 'Processors',\n", |
| 100 | + " 'items': {'$id': 'https://github.com/BlockScience/bdp-lib/tree/main/src/bdp_lib/schemas/processor.schema.json',\n", |
| 101 | + " '$schema': 'http://json-schema.org/draft-07/schema#',\n", |
| 102 | + " 'title': 'Processor',\n", |
| 103 | + " 'type': 'object',\n", |
| 104 | + " 'additionalProperties': False,\n", |
| 105 | + " 'description': 'A processor is an instance of a block where computation or actions would happen. When the optional parameter of subsystem is present, the processor is a composite processor and it represents a system as a processor with the systsem ID it is a processor for as well as the wires that connect the processor ports and terminals to the system ports and terminals.',\n", |
| 106 | + " 'properties': {'ID': {'type': 'string',\n", |
| 107 | + " 'title': 'ID',\n", |
| 108 | + " 'description': 'A unique identifier for the processor.'},\n", |
| 109 | + " 'Name': {'type': 'string',\n", |
| 110 | + " 'title': 'Name',\n", |
| 111 | + " 'description': 'The name of the processor.'},\n", |
| 112 | + " 'Description': {'type': 'string',\n", |
| 113 | + " 'title': 'Description',\n", |
| 114 | + " 'description': 'A description of the processor.'},\n", |
| 115 | + " 'Parent': {'type': 'string',\n", |
| 116 | + " 'title': 'Parent',\n", |
| 117 | + " 'description': 'The ID of the block that the processor is an instance of.'},\n", |
| 118 | + " 'Ports': {'type': 'array',\n", |
| 119 | + " 'title': 'Ports',\n", |
| 120 | + " 'description': 'The IDs of spaces which must match the domain of the parent block.',\n", |
| 121 | + " 'items': {'type': 'string'}},\n", |
| 122 | + " 'Terminals': {'type': 'array',\n", |
| 123 | + " 'title': 'Terminals',\n", |
| 124 | + " 'description': 'The IDs of spaces which must match the codomain of the parent block.',\n", |
| 125 | + " 'items': {'type': 'string'}},\n", |
| 126 | + " 'Subsystem': {'type': 'object',\n", |
| 127 | + " 'title': 'Subsystem',\n", |
| 128 | + " 'description': 'The subsystem of the processor which is a system that the processor represents and passes its ports to and receives spaces to its terminals from.',\n", |
| 129 | + " 'properties': {'System ID': {'type': 'string',\n", |
| 130 | + " 'title': 'System ID',\n", |
| 131 | + " 'description': 'The ID of the system that the processor is a processor for.'},\n", |
| 132 | + " 'Port Mappings': {'type': 'array',\n", |
| 133 | + " 'title': 'Port Mappings',\n", |
| 134 | + " 'description': 'This array, which is equal in length to the number of ports on the processor, maps each port to an internal processor within the subsystem and its port index that the port should be passed on to.',\n", |
| 135 | + " 'items': {'type': 'object',\n", |
| 136 | + " 'properties': {'Processor': {'type': 'string',\n", |
| 137 | + " 'title': 'Processor',\n", |
| 138 | + " 'description': 'The ID of the processor in the system.'},\n", |
| 139 | + " 'Index': {'type': 'integer',\n", |
| 140 | + " 'title': 'Index',\n", |
| 141 | + " 'description': 'The index of the terminal.'}},\n", |
| 142 | + " 'required': ['Processor', 'Index']}},\n", |
| 143 | + " 'Terminal Mappings': {'type': 'array',\n", |
| 144 | + " 'title': 'Terminal Mappings',\n", |
| 145 | + " 'description': 'This array, which is equal in length to the number of terminals on the processor, maps terminal port to an internal processor within the subsystem and its terminal index that the outer terminal should receive output from.',\n", |
| 146 | + " 'items': {'type': 'object',\n", |
| 147 | + " 'properties': {'Processor': {'type': 'string',\n", |
| 148 | + " 'title': 'Processor',\n", |
| 149 | + " 'description': 'The ID of the processor in the system.'},\n", |
| 150 | + " 'Index': {'type': 'integer',\n", |
| 151 | + " 'title': 'Index',\n", |
| 152 | + " 'description': 'The index of the terminal.'}},\n", |
| 153 | + " 'required': ['Processor', 'Index']}}},\n", |
| 154 | + " 'required': ['System ID', 'Port Mappings', 'Terminal Mappings']}},\n", |
| 155 | + " 'required': ['ID', 'Name', 'Parent', 'Ports', 'Terminals']}}" |
| 156 | + ] |
| 157 | + }, |
| 158 | + "execution_count": 4, |
| 159 | + "metadata": {}, |
| 160 | + "output_type": "execute_result" |
| 161 | + } |
| 162 | + ], |
| 163 | + "source": [ |
| 164 | + "schema['properties'][\"Workbench\"][\"properties\"][\"Processors\"]" |
| 165 | + ] |
90 | 166 | },
|
91 | 167 | {
|
92 | 168 | "cell_type": "code",
|
|
0 commit comments