diff --git a/schema.json b/schema.json index ce0b2b58..28172c36 100644 --- a/schema.json +++ b/schema.json @@ -1 +1,2071 @@ -{"openapi": "3.1.0", "info": {"title": "FastAPI", "version": "0.1.1"}, "paths": {"/valid": {"post": {"summary": "Valid", "description": "Validate wether a ScanSpec[str] can produce a viable scan.\n\nArgs:\n spec: The scanspec to validate\n\nReturns:\n ValidResponse: A canonical version of the spec if it is valid.\n An error otherwise.", "operationId": "valid_valid_post", "requestBody": {"content": {"application/json": {"schema": {"allOf": [{"$ref": "#/components/schemas/Spec-Input"}], "title": "Spec", "examples": [{"outer": {"axis": "y", "start": 0.0, "stop": 10.0, "num": 3, "type": "Line"}, "inner": {"axis": "x", "start": 0.0, "stop": 10.0, "num": 4, "type": "Line"}, "type": "Product"}]}}}, "required": true}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ValidResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/midpoints": {"post": {"summary": "Midpoints", "description": "Generate midpoints from a scanspec.\n\nA scanspec can produce bounded points (i.e. a point is valid if an\naxis is between a minimum and and a maximum, see /bounds). The midpoints\nare the middle of each set of bounds.\n\nArgs:\n request: Scanspec and formatting info.\n\nReturns:\n MidpointsResponse: Midpoints of the scan", "operationId": "midpoints_midpoints_post", "requestBody": {"content": {"application/json": {"schema": {"allOf": [{"$ref": "#/components/schemas/PointsRequest"}], "title": "Request", "examples": [{"spec": {"outer": {"axis": "y", "start": 0.0, "stop": 10.0, "num": 3, "type": "Line"}, "inner": {"axis": "x", "start": 0.0, "stop": 10.0, "num": 4, "type": "Line"}, "type": "Product"}, "max_frames": 1024, "format": "FLOAT_LIST"}]}}}, "required": true}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/MidpointsResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/bounds": {"post": {"summary": "Bounds", "description": "Generate bounds from a scanspec.\n\nA scanspec can produce points with lower and upper bounds.\n\nArgs:\n request: Scanspec and formatting info.\n\nReturns:\n BoundsResponse: Bounds of the scan", "operationId": "bounds_bounds_post", "requestBody": {"content": {"application/json": {"schema": {"allOf": [{"$ref": "#/components/schemas/PointsRequest"}], "title": "Request", "examples": [{"spec": {"outer": {"axis": "y", "start": 0.0, "stop": 10.0, "num": 3, "type": "Line"}, "inner": {"axis": "x", "start": 0.0, "stop": 10.0, "num": 4, "type": "Line"}, "type": "Product"}, "max_frames": 1024, "format": "FLOAT_LIST"}]}}}, "required": true}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BoundsResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/gap": {"post": {"summary": "Gap", "description": "Generate gaps from a scanspec.\n\nA scanspec may indicate if there is a gap between two frames.\nThe array returned corresponds to whether or not there is a gap\nafter each frame.\n\nArgs:\n request: Scanspec and formatting info.\n\nReturns:\n GapResponse: Bounds of the scan", "operationId": "gap_gap_post", "requestBody": {"content": {"application/json": {"schema": {"allOf": [{"$ref": "#/components/schemas/Spec-Input"}], "title": "Spec", "examples": [{"outer": {"axis": "y", "start": 0.0, "stop": 10.0, "num": 3, "type": "Line"}, "inner": {"axis": "x", "start": 0.0, "stop": 10.0, "num": 4, "type": "Line"}, "type": "Product"}]}}}, "required": true}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GapResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/smalleststep": {"post": {"summary": "Smallest Step", "description": "Calculate the smallest step in a scan, both absolutely and per-axis.\n\nIgnore any steps of size 0.\n\nArgs:\n spec: The spec of the scan\n\nReturns:\n SmallestStepResponse: A description of the smallest steps in the spec", "operationId": "smallest_step_smalleststep_post", "requestBody": {"content": {"application/json": {"schema": {"allOf": [{"$ref": "#/components/schemas/Spec-Input"}], "title": "Spec", "examples": [{"outer": {"axis": "y", "start": 0.0, "stop": 10.0, "num": 3, "type": "Line"}, "inner": {"axis": "x", "start": 0.0, "stop": 10.0, "num": 4, "type": "Line"}, "type": "Product"}]}}}, "required": true}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SmallestStepResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}}, "components": {"schemas": {"BoundsResponse": {"properties": {"total_frames": {"type": "integer", "title": "Total Frames", "description": "Total number of frames in spec"}, "returned_frames": {"type": "integer", "title": "Returned Frames", "description": "Total of number of frames in this response, may be less than total_frames due to downsampling etc."}, "format": {"allOf": [{"$ref": "#/components/schemas/PointsFormat"}], "description": "Format of returned point data"}, "lower": {"additionalProperties": {"anyOf": [{"type": "string"}, {"items": {"type": "number"}, "type": "array"}]}, "type": "object", "title": "Lower", "description": "Lower bounds of scan frames if different from midpoints"}, "upper": {"additionalProperties": {"anyOf": [{"type": "string"}, {"items": {"type": "number"}, "type": "array"}]}, "type": "object", "title": "Upper", "description": "Upper bounds of scan frames if different from midpoints"}}, "type": "object", "required": ["total_frames", "returned_frames", "format", "lower", "upper"], "title": "BoundsResponse", "description": "Bounds of a generated scan."}, "Circle": {"properties": {"x_axis": {"title": "X Axis", "description": "The name matching the x axis of the spec"}, "y_axis": {"title": "Y Axis", "description": "The name matching the y axis of the spec"}, "x_middle": {"type": "number", "title": "X Middle", "description": "The central x point of the circle"}, "y_middle": {"type": "number", "title": "Y Middle", "description": "The central y point of the circle"}, "radius": {"type": "number", "exclusiveMinimum": 0.0, "title": "Radius", "description": "Radius of the circle"}, "type": {"type": "string", "enum": ["Circle"], "const": "Circle", "title": "Type", "default": "Circle"}}, "additionalProperties": false, "type": "object", "required": ["x_axis", "y_axis", "x_middle", "y_middle", "radius"], "title": "Circle", "description": "Mask contains points of axis within an xy circle of given radius.\n\n.. example_spec::\n\n from scanspec.regions import Circle\n from scanspec.specs import Line\n\n grid = Line(\"y\", 1, 3, 10) * ~Line(\"x\", 0, 2, 10)\n spec = grid & Circle(\"x\", \"y\", 1, 2, 0.9)"}, "CombinationOf-Input": {"properties": {"left": {"allOf": [{"$ref": "#/components/schemas/Region-Input"}], "description": "The left-hand Region to combine"}, "right": {"allOf": [{"$ref": "#/components/schemas/Region-Input"}], "description": "The right-hand Region to combine"}, "type": {"type": "string", "enum": ["CombinationOf"], "const": "CombinationOf", "title": "Type", "default": "CombinationOf"}}, "additionalProperties": false, "type": "object", "required": ["left", "right"], "title": "CombinationOf", "description": "Abstract baseclass for a combination of two regions, left and right."}, "CombinationOf-Output": {"properties": {"left": {"allOf": [{"$ref": "#/components/schemas/Region-Output"}], "description": "The left-hand Region to combine"}, "right": {"allOf": [{"$ref": "#/components/schemas/Region-Output"}], "description": "The right-hand Region to combine"}, "type": {"type": "string", "enum": ["CombinationOf"], "const": "CombinationOf", "title": "Type", "default": "CombinationOf"}}, "additionalProperties": false, "type": "object", "required": ["left", "right"], "title": "CombinationOf", "description": "Abstract baseclass for a combination of two regions, left and right."}, "Concat-Input": {"properties": {"left": {"allOf": [{"$ref": "#/components/schemas/Spec-Input"}], "description": "The left-hand Spec to Concat, midpoints will appear earlier"}, "right": {"allOf": [{"$ref": "#/components/schemas/Spec-Input"}], "description": "The right-hand Spec to Concat, midpoints will appear later"}, "gap": {"type": "boolean", "title": "Gap", "description": "If True, force a gap in the output at the join", "default": false}, "check_path_changes": {"type": "boolean", "title": "Check Path Changes", "description": "If True path through scan will not be modified by squash", "default": true}, "type": {"type": "string", "enum": ["Concat"], "const": "Concat", "title": "Type", "default": "Concat"}}, "additionalProperties": false, "type": "object", "required": ["left", "right"], "title": "Concat", "description": "Concatenate two Specs together, running one after the other.\n\nEach Dimension of left and right must contain the same axes. Typically\nformed using `Spec.concat`.\n\n.. example_spec::\n\n from scanspec.specs import Line\n\n spec = Line(\"x\", 1, 3, 3).concat(Line(\"x\", 4, 5, 5))"}, "Concat-Output": {"properties": {"left": {"allOf": [{"$ref": "#/components/schemas/Spec-Output"}], "description": "The left-hand Spec to Concat, midpoints will appear earlier"}, "right": {"allOf": [{"$ref": "#/components/schemas/Spec-Output"}], "description": "The right-hand Spec to Concat, midpoints will appear later"}, "gap": {"type": "boolean", "title": "Gap", "description": "If True, force a gap in the output at the join", "default": false}, "check_path_changes": {"type": "boolean", "title": "Check Path Changes", "description": "If True path through scan will not be modified by squash", "default": true}, "type": {"type": "string", "enum": ["Concat"], "const": "Concat", "title": "Type", "default": "Concat"}}, "additionalProperties": false, "type": "object", "required": ["left", "right"], "title": "Concat", "description": "Concatenate two Specs together, running one after the other.\n\nEach Dimension of left and right must contain the same axes. Typically\nformed using `Spec.concat`.\n\n.. example_spec::\n\n from scanspec.specs import Line\n\n spec = Line(\"x\", 1, 3, 3).concat(Line(\"x\", 4, 5, 5))"}, "DifferenceOf-Input": {"properties": {"left": {"allOf": [{"$ref": "#/components/schemas/Region-Input"}], "description": "The left-hand Region to combine"}, "right": {"allOf": [{"$ref": "#/components/schemas/Region-Input"}], "description": "The right-hand Region to combine"}, "type": {"type": "string", "enum": ["DifferenceOf"], "const": "DifferenceOf", "title": "Type", "default": "DifferenceOf"}}, "additionalProperties": false, "type": "object", "required": ["left", "right"], "title": "DifferenceOf", "description": "A point is in DifferenceOf(a, b) if in a and not in b.\n\nTypically created with the ``-`` operator.\n\n>>> r = Range(\"x\", 0.5, 2.5) - Range(\"x\", 1.5, 3.5)\n>>> r.mask({\"x\": np.array([0, 1, 2, 3, 4])})\narray([False, True, False, False, False])"}, "DifferenceOf-Output": {"properties": {"left": {"allOf": [{"$ref": "#/components/schemas/Region-Output"}], "description": "The left-hand Region to combine"}, "right": {"allOf": [{"$ref": "#/components/schemas/Region-Output"}], "description": "The right-hand Region to combine"}, "type": {"type": "string", "enum": ["DifferenceOf"], "const": "DifferenceOf", "title": "Type", "default": "DifferenceOf"}}, "additionalProperties": false, "type": "object", "required": ["left", "right"], "title": "DifferenceOf", "description": "A point is in DifferenceOf(a, b) if in a and not in b.\n\nTypically created with the ``-`` operator.\n\n>>> r = Range(\"x\", 0.5, 2.5) - Range(\"x\", 1.5, 3.5)\n>>> r.mask({\"x\": np.array([0, 1, 2, 3, 4])})\narray([False, True, False, False, False])"}, "Ellipse": {"properties": {"x_axis": {"title": "X Axis", "description": "The name matching the x axis of the spec"}, "y_axis": {"title": "Y Axis", "description": "The name matching the y axis of the spec"}, "x_middle": {"type": "number", "title": "X Middle", "description": "The central x point of the ellipse"}, "y_middle": {"type": "number", "title": "Y Middle", "description": "The central y point of the ellipse"}, "x_radius": {"type": "number", "exclusiveMinimum": 0.0, "title": "X Radius", "description": "The radius along the x axis of the ellipse"}, "y_radius": {"type": "number", "exclusiveMinimum": 0.0, "title": "Y Radius", "description": "The radius along the y axis of the ellipse"}, "angle": {"type": "number", "title": "Angle", "description": "The angle of the ellipse (degrees)", "default": 0.0}, "type": {"type": "string", "enum": ["Ellipse"], "const": "Ellipse", "title": "Type", "default": "Ellipse"}}, "additionalProperties": false, "type": "object", "required": ["x_axis", "y_axis", "x_middle", "y_middle", "x_radius", "y_radius"], "title": "Ellipse", "description": "Mask contains points of axis within an xy ellipse of given radius.\n\n.. example_spec::\n\n from scanspec.regions import Ellipse\n from scanspec.specs import Line\n\n grid = Line(\"y\", 3, 8, 10) * ~Line(\"x\", 1 ,8, 10)\n spec = grid & Ellipse(\"x\", \"y\", 5, 5, 2, 3, 75)"}, "GapResponse": {"properties": {"gap": {"items": {"type": "boolean"}, "type": "array", "title": "Gap", "description": "Boolean array indicating if there is a gap between each frame"}}, "type": "object", "required": ["gap"], "title": "GapResponse", "description": "Presence of gaps in a generated scan."}, "HTTPValidationError": {"properties": {"detail": {"items": {"$ref": "#/components/schemas/ValidationError"}, "type": "array", "title": "Detail"}}, "type": "object", "title": "HTTPValidationError"}, "IntersectionOf-Input": {"properties": {"left": {"allOf": [{"$ref": "#/components/schemas/Region-Input"}], "description": "The left-hand Region to combine"}, "right": {"allOf": [{"$ref": "#/components/schemas/Region-Input"}], "description": "The right-hand Region to combine"}, "type": {"type": "string", "enum": ["IntersectionOf"], "const": "IntersectionOf", "title": "Type", "default": "IntersectionOf"}}, "additionalProperties": false, "type": "object", "required": ["left", "right"], "title": "IntersectionOf", "description": "A point is in IntersectionOf(a, b) if in both a and b.\n\nTypically created with the ``&`` operator.\n\n>>> r = Range(\"x\", 0.5, 2.5) & Range(\"x\", 1.5, 3.5)\n>>> r.mask({\"x\": np.array([0, 1, 2, 3, 4])})\narray([False, False, True, False, False])"}, "IntersectionOf-Output": {"properties": {"left": {"allOf": [{"$ref": "#/components/schemas/Region-Output"}], "description": "The left-hand Region to combine"}, "right": {"allOf": [{"$ref": "#/components/schemas/Region-Output"}], "description": "The right-hand Region to combine"}, "type": {"type": "string", "enum": ["IntersectionOf"], "const": "IntersectionOf", "title": "Type", "default": "IntersectionOf"}}, "additionalProperties": false, "type": "object", "required": ["left", "right"], "title": "IntersectionOf", "description": "A point is in IntersectionOf(a, b) if in both a and b.\n\nTypically created with the ``&`` operator.\n\n>>> r = Range(\"x\", 0.5, 2.5) & Range(\"x\", 1.5, 3.5)\n>>> r.mask({\"x\": np.array([0, 1, 2, 3, 4])})\narray([False, False, True, False, False])"}, "Line": {"properties": {"axis": {"title": "Axis", "description": "An identifier for what to move"}, "start": {"type": "number", "title": "Start", "description": "Midpoint of the first point of the line"}, "stop": {"type": "number", "title": "Stop", "description": "Midpoint of the last point of the line"}, "num": {"type": "integer", "minimum": 1.0, "title": "Num", "description": "Number of frames to produce"}, "type": {"type": "string", "enum": ["Line"], "const": "Line", "title": "Type", "default": "Line"}}, "additionalProperties": false, "type": "object", "required": ["axis", "start", "stop", "num"], "title": "Line", "description": "Linearly spaced frames with start and stop as first and last midpoints.\n\n.. example_spec::\n\n from scanspec.specs import Line\n\n spec = Line(\"x\", 1, 2, 5)"}, "Mask-Input": {"properties": {"spec": {"allOf": [{"$ref": "#/components/schemas/Spec-Input"}], "description": "The Spec containing the source midpoints"}, "region": {"allOf": [{"$ref": "#/components/schemas/Region-Input"}], "description": "The Region that midpoints will be inside"}, "check_path_changes": {"type": "boolean", "title": "Check Path Changes", "description": "If True path through scan will not be modified by squash", "default": true}, "type": {"type": "string", "enum": ["Mask"], "const": "Mask", "title": "Type", "default": "Mask"}}, "additionalProperties": false, "type": "object", "required": ["spec", "region"], "title": "Mask", "description": "Restrict Spec to only midpoints that fall inside the given Region.\n\nTypically created with the ``&`` operator. It also pushes down the\n``& | ^ -`` operators to its `Region` to avoid the need for brackets on\ncombinations of Regions.\n\nIf a Region spans multiple Frames objects, they will be squashed together.\n\n.. example_spec::\n\n from scanspec.regions import Circle\n from scanspec.specs import Line\n\n spec = Line(\"y\", 1, 3, 3) * Line(\"x\", 3, 5, 5) & Circle(\"x\", \"y\", 4, 2, 1.2)\n\nSee Also: `why-squash-can-change-path`"}, "Mask-Output": {"properties": {"spec": {"allOf": [{"$ref": "#/components/schemas/Spec-Output"}], "description": "The Spec containing the source midpoints"}, "region": {"allOf": [{"$ref": "#/components/schemas/Region-Output"}], "description": "The Region that midpoints will be inside"}, "check_path_changes": {"type": "boolean", "title": "Check Path Changes", "description": "If True path through scan will not be modified by squash", "default": true}, "type": {"type": "string", "enum": ["Mask"], "const": "Mask", "title": "Type", "default": "Mask"}}, "additionalProperties": false, "type": "object", "required": ["spec", "region"], "title": "Mask", "description": "Restrict Spec to only midpoints that fall inside the given Region.\n\nTypically created with the ``&`` operator. It also pushes down the\n``& | ^ -`` operators to its `Region` to avoid the need for brackets on\ncombinations of Regions.\n\nIf a Region spans multiple Frames objects, they will be squashed together.\n\n.. example_spec::\n\n from scanspec.regions import Circle\n from scanspec.specs import Line\n\n spec = Line(\"y\", 1, 3, 3) * Line(\"x\", 3, 5, 5) & Circle(\"x\", \"y\", 4, 2, 1.2)\n\nSee Also: `why-squash-can-change-path`"}, "MidpointsResponse": {"properties": {"total_frames": {"type": "integer", "title": "Total Frames", "description": "Total number of frames in spec"}, "returned_frames": {"type": "integer", "title": "Returned Frames", "description": "Total of number of frames in this response, may be less than total_frames due to downsampling etc."}, "format": {"allOf": [{"$ref": "#/components/schemas/PointsFormat"}], "description": "Format of returned point data"}, "midpoints": {"additionalProperties": {"anyOf": [{"type": "string"}, {"items": {"type": "number"}, "type": "array"}]}, "type": "object", "title": "Midpoints", "description": "The midpoints of scan frames for each axis"}}, "type": "object", "required": ["total_frames", "returned_frames", "format", "midpoints"], "title": "MidpointsResponse", "description": "Midpoints of a generated scan."}, "PointsFormat": {"type": "string", "enum": ["STRING", "FLOAT_LIST", "BASE64_ENCODED"], "title": "PointsFormat", "description": "Formats in which we can return points."}, "PointsRequest": {"properties": {"spec": {"allOf": [{"$ref": "#/components/schemas/Spec-Input"}], "description": "The spec from which to generate points"}, "max_frames": {"anyOf": [{"type": "integer"}, {"type": "null"}], "title": "Max Frames", "description": "The maximum number of points to return, if None will return as many as calculated", "default": 100000}, "format": {"allOf": [{"$ref": "#/components/schemas/PointsFormat"}], "description": "The format in which to output the points data", "default": "FLOAT_LIST"}}, "type": "object", "required": ["spec"], "title": "PointsRequest", "description": "A request for generated scan points."}, "Polygon": {"properties": {"x_axis": {"title": "X Axis", "description": "The name matching the x axis of the spec"}, "y_axis": {"title": "Y Axis", "description": "The name matching the y axis of the spec"}, "x_verts": {"items": {"type": "number"}, "type": "array", "minItems": 3, "title": "X Verts", "description": "The Nx1 x coordinates of the polygons vertices"}, "y_verts": {"items": {"type": "number"}, "type": "array", "minItems": 3, "title": "Y Verts", "description": "The Nx1 y coordinates of the polygons vertices"}, "type": {"type": "string", "enum": ["Polygon"], "const": "Polygon", "title": "Type", "default": "Polygon"}}, "additionalProperties": false, "type": "object", "required": ["x_axis", "y_axis", "x_verts", "y_verts"], "title": "Polygon", "description": "Mask contains points of axis within a rotated xy polygon.\n\n.. example_spec::\n\n from scanspec.regions import Polygon\n from scanspec.specs import Line\n\n grid = Line(\"y\", 3, 8, 10) * ~Line(\"x\", 1 ,8, 10)\n spec = grid & Polygon(\"x\", \"y\", [1.0, 6.0, 8.0, 2.0], [4.0, 10.0, 6.0, 1.0])"}, "Product-Input": {"properties": {"outer": {"allOf": [{"$ref": "#/components/schemas/Spec-Input"}], "description": "Will be executed once"}, "inner": {"allOf": [{"$ref": "#/components/schemas/Spec-Input"}], "description": "Will be executed len(outer) times"}, "type": {"type": "string", "enum": ["Product"], "const": "Product", "title": "Type", "default": "Product"}}, "additionalProperties": false, "type": "object", "required": ["outer", "inner"], "title": "Product", "description": "Outer product of two Specs, nesting inner within outer.\n\nThis means that inner will run in its entirety at each point in outer.\n\n.. example_spec::\n\n from scanspec.specs import Line\n\n spec = Line(\"y\", 1, 2, 3) * Line(\"x\", 3, 4, 12)"}, "Product-Output": {"properties": {"outer": {"allOf": [{"$ref": "#/components/schemas/Spec-Output"}], "description": "Will be executed once"}, "inner": {"allOf": [{"$ref": "#/components/schemas/Spec-Output"}], "description": "Will be executed len(outer) times"}, "type": {"type": "string", "enum": ["Product"], "const": "Product", "title": "Type", "default": "Product"}}, "additionalProperties": false, "type": "object", "required": ["outer", "inner"], "title": "Product", "description": "Outer product of two Specs, nesting inner within outer.\n\nThis means that inner will run in its entirety at each point in outer.\n\n.. example_spec::\n\n from scanspec.specs import Line\n\n spec = Line(\"y\", 1, 2, 3) * Line(\"x\", 3, 4, 12)"}, "Range": {"properties": {"axis": {"title": "Axis", "description": "The name matching the axis to mask in spec"}, "min": {"type": "number", "title": "Min", "description": "The minimum inclusive value in the region"}, "max": {"type": "number", "title": "Max", "description": "The minimum inclusive value in the region"}, "type": {"type": "string", "enum": ["Range"], "const": "Range", "title": "Type", "default": "Range"}}, "additionalProperties": false, "type": "object", "required": ["axis", "min", "max"], "title": "Range", "description": "Mask contains points of axis >= min and <= max.\n\n>>> r = Range(\"x\", 1, 2)\n>>> r.mask({\"x\": np.array([0, 1, 2, 3, 4])})\narray([False, True, True, False, False])"}, "Rectangle": {"properties": {"x_axis": {"title": "X Axis", "description": "The name matching the x axis of the spec"}, "y_axis": {"title": "Y Axis", "description": "The name matching the y axis of the spec"}, "x_min": {"type": "number", "title": "X Min", "description": "Minimum inclusive x value in the region"}, "y_min": {"type": "number", "title": "Y Min", "description": "Minimum inclusive y value in the region"}, "x_max": {"type": "number", "title": "X Max", "description": "Maximum inclusive x value in the region"}, "y_max": {"type": "number", "title": "Y Max", "description": "Maximum inclusive y value in the region"}, "angle": {"type": "number", "title": "Angle", "description": "Clockwise rotation angle of the rectangle", "default": 0.0}, "type": {"type": "string", "enum": ["Rectangle"], "const": "Rectangle", "title": "Type", "default": "Rectangle"}}, "additionalProperties": false, "type": "object", "required": ["x_axis", "y_axis", "x_min", "y_min", "x_max", "y_max"], "title": "Rectangle", "description": "Mask contains points of axis within a rotated xy rectangle.\n\n.. example_spec::\n\n from scanspec.regions import Rectangle\n from scanspec.specs import Line\n\n grid = Line(\"y\", 1, 3, 10) * ~Line(\"x\", 0, 2, 10)\n spec = grid & Rectangle(\"x\", \"y\", 0, 1.1, 1.5, 2.1, 30)"}, "Region-Input": {"oneOf": [{"$ref": "#/components/schemas/CombinationOf-Input"}, {"$ref": "#/components/schemas/UnionOf-Input"}, {"$ref": "#/components/schemas/IntersectionOf-Input"}, {"$ref": "#/components/schemas/DifferenceOf-Input"}, {"$ref": "#/components/schemas/SymmetricDifferenceOf-Input"}, {"$ref": "#/components/schemas/Range"}, {"$ref": "#/components/schemas/Rectangle"}, {"$ref": "#/components/schemas/Polygon"}, {"$ref": "#/components/schemas/Circle"}, {"$ref": "#/components/schemas/Ellipse"}], "discriminator": {"propertyName": "type", "mapping": {"Circle": "#/components/schemas/Circle", "CombinationOf": "#/components/schemas/CombinationOf-Input", "DifferenceOf": "#/components/schemas/DifferenceOf-Input", "Ellipse": "#/components/schemas/Ellipse", "IntersectionOf": "#/components/schemas/IntersectionOf-Input", "Polygon": "#/components/schemas/Polygon", "Range": "#/components/schemas/Range", "Rectangle": "#/components/schemas/Rectangle", "SymmetricDifferenceOf": "#/components/schemas/SymmetricDifferenceOf-Input", "UnionOf": "#/components/schemas/UnionOf-Input"}}}, "Region-Output": {"oneOf": [{"$ref": "#/components/schemas/CombinationOf-Output"}, {"$ref": "#/components/schemas/UnionOf-Output"}, {"$ref": "#/components/schemas/IntersectionOf-Output"}, {"$ref": "#/components/schemas/DifferenceOf-Output"}, {"$ref": "#/components/schemas/SymmetricDifferenceOf-Output"}, {"$ref": "#/components/schemas/Range"}, {"$ref": "#/components/schemas/Rectangle"}, {"$ref": "#/components/schemas/Polygon"}, {"$ref": "#/components/schemas/Circle"}, {"$ref": "#/components/schemas/Ellipse"}], "discriminator": {"propertyName": "type", "mapping": {"Circle": "#/components/schemas/Circle", "CombinationOf": "#/components/schemas/CombinationOf-Output", "DifferenceOf": "#/components/schemas/DifferenceOf-Output", "Ellipse": "#/components/schemas/Ellipse", "IntersectionOf": "#/components/schemas/IntersectionOf-Output", "Polygon": "#/components/schemas/Polygon", "Range": "#/components/schemas/Range", "Rectangle": "#/components/schemas/Rectangle", "SymmetricDifferenceOf": "#/components/schemas/SymmetricDifferenceOf-Output", "UnionOf": "#/components/schemas/UnionOf-Output"}}}, "Repeat": {"properties": {"num": {"type": "integer", "minimum": 1.0, "title": "Num", "description": "Number of frames to produce"}, "gap": {"type": "boolean", "title": "Gap", "description": "If False and the slowest of the stack of Frames is snaked then the end and start of consecutive iterations of Spec will have no gap", "default": true}, "type": {"type": "string", "enum": ["Repeat"], "const": "Repeat", "title": "Type", "default": "Repeat"}}, "additionalProperties": false, "type": "object", "required": ["num"], "title": "Repeat", "description": "Repeat an empty frame num times.\n\nCan be used on the outside of a scan to repeat the same scan many times.\n\n.. example_spec::\n\n from scanspec.specs import Line\n\n spec = 2 * ~Line.bounded(\"x\", 3, 4, 1)\n\nIf you want snaked axes to have no gap between iterations you can do:\n\n.. example_spec::\n\n from scanspec.specs import Line, Repeat\n\n spec = Repeat(2, gap=False) * ~Line.bounded(\"x\", 3, 4, 1)\n\n.. note:: There is no turnaround arrow at x=4"}, "SmallestStepResponse": {"properties": {"absolute": {"type": "number", "title": "Absolute", "description": "Absolute smallest distance between two points on a single axis"}, "per_axis": {"additionalProperties": {"type": "number"}, "type": "object", "title": "Per Axis", "description": "Smallest distance between two points on each axis"}}, "type": "object", "required": ["absolute", "per_axis"], "title": "SmallestStepResponse", "description": "Information about the smallest steps between points in a spec."}, "Snake-Input": {"properties": {"spec": {"allOf": [{"$ref": "#/components/schemas/Spec-Input"}], "description": "The Spec to run in reverse every other iteration"}, "type": {"type": "string", "enum": ["Snake"], "const": "Snake", "title": "Type", "default": "Snake"}}, "additionalProperties": false, "type": "object", "required": ["spec"], "title": "Snake", "description": "Run the Spec in reverse on every other iteration when nested.\n\nTypically created with the ``~`` operator.\n\n.. example_spec::\n\n from scanspec.specs import Line\n\n spec = Line(\"y\", 1, 3, 3) * ~Line(\"x\", 3, 5, 5)"}, "Snake-Output": {"properties": {"spec": {"allOf": [{"$ref": "#/components/schemas/Spec-Output"}], "description": "The Spec to run in reverse every other iteration"}, "type": {"type": "string", "enum": ["Snake"], "const": "Snake", "title": "Type", "default": "Snake"}}, "additionalProperties": false, "type": "object", "required": ["spec"], "title": "Snake", "description": "Run the Spec in reverse on every other iteration when nested.\n\nTypically created with the ``~`` operator.\n\n.. example_spec::\n\n from scanspec.specs import Line\n\n spec = Line(\"y\", 1, 3, 3) * ~Line(\"x\", 3, 5, 5)"}, "Spec-Input": {"oneOf": [{"$ref": "#/components/schemas/Product-Input"}, {"$ref": "#/components/schemas/Repeat"}, {"$ref": "#/components/schemas/Zip-Input"}, {"$ref": "#/components/schemas/Mask-Input"}, {"$ref": "#/components/schemas/Snake-Input"}, {"$ref": "#/components/schemas/Concat-Input"}, {"$ref": "#/components/schemas/Squash-Input"}, {"$ref": "#/components/schemas/Line"}, {"$ref": "#/components/schemas/Static"}, {"$ref": "#/components/schemas/Spiral"}], "discriminator": {"propertyName": "type", "mapping": {"Concat": "#/components/schemas/Concat-Input", "Line": "#/components/schemas/Line", "Mask": "#/components/schemas/Mask-Input", "Product": "#/components/schemas/Product-Input", "Repeat": "#/components/schemas/Repeat", "Snake": "#/components/schemas/Snake-Input", "Spiral": "#/components/schemas/Spiral", "Squash": "#/components/schemas/Squash-Input", "Static": "#/components/schemas/Static", "Zip": "#/components/schemas/Zip-Input"}}}, "Spec-Output": {"oneOf": [{"$ref": "#/components/schemas/Product-Output"}, {"$ref": "#/components/schemas/Repeat"}, {"$ref": "#/components/schemas/Zip-Output"}, {"$ref": "#/components/schemas/Mask-Output"}, {"$ref": "#/components/schemas/Snake-Output"}, {"$ref": "#/components/schemas/Concat-Output"}, {"$ref": "#/components/schemas/Squash-Output"}, {"$ref": "#/components/schemas/Line"}, {"$ref": "#/components/schemas/Static"}, {"$ref": "#/components/schemas/Spiral"}], "discriminator": {"propertyName": "type", "mapping": {"Concat": "#/components/schemas/Concat-Output", "Line": "#/components/schemas/Line", "Mask": "#/components/schemas/Mask-Output", "Product": "#/components/schemas/Product-Output", "Repeat": "#/components/schemas/Repeat", "Snake": "#/components/schemas/Snake-Output", "Spiral": "#/components/schemas/Spiral", "Squash": "#/components/schemas/Squash-Output", "Static": "#/components/schemas/Static", "Zip": "#/components/schemas/Zip-Output"}}}, "Spiral": {"properties": {"x_axis": {"title": "X Axis", "description": "An identifier for what to move for x"}, "y_axis": {"title": "Y Axis", "description": "An identifier for what to move for y"}, "x_start": {"type": "number", "title": "X Start", "description": "x centre of the spiral"}, "y_start": {"type": "number", "title": "Y Start", "description": "y centre of the spiral"}, "x_range": {"type": "number", "title": "X Range", "description": "x width of the spiral"}, "y_range": {"type": "number", "title": "Y Range", "description": "y width of the spiral"}, "num": {"type": "integer", "minimum": 1.0, "title": "Num", "description": "Number of frames to produce"}, "rotate": {"type": "number", "title": "Rotate", "description": "How much to rotate the angle of the spiral", "default": 0.0}, "type": {"type": "string", "enum": ["Spiral"], "const": "Spiral", "title": "Type", "default": "Spiral"}}, "additionalProperties": false, "type": "object", "required": ["x_axis", "y_axis", "x_start", "y_start", "x_range", "y_range", "num"], "title": "Spiral", "description": "Archimedean spiral of \"x_axis\" and \"y_axis\".\n\nStarts at centre point (\"x_start\", \"y_start\") with angle \"rotate\". Produces\n\"num\" points in a spiral spanning width of \"x_range\" and height of \"y_range\"\n\n.. example_spec::\n\n from scanspec.specs import Spiral\n\n spec = Spiral(\"x\", \"y\", 1, 5, 10, 50, 30)"}, "Squash-Input": {"properties": {"spec": {"allOf": [{"$ref": "#/components/schemas/Spec-Input"}], "description": "The Spec to squash the dimensions of"}, "check_path_changes": {"type": "boolean", "title": "Check Path Changes", "description": "If True path through scan will not be modified by squash", "default": true}, "type": {"type": "string", "enum": ["Squash"], "const": "Squash", "title": "Type", "default": "Squash"}}, "additionalProperties": false, "type": "object", "required": ["spec"], "title": "Squash", "description": "Squash a stack of Frames together into a single expanded Frames object.\n\nSee Also:\n `why-squash-can-change-path`\n\n.. example_spec::\n\n from scanspec.specs import Line, Squash\n\n spec = Squash(Line(\"y\", 1, 2, 3) * Line(\"x\", 0, 1, 4))"}, "Squash-Output": {"properties": {"spec": {"allOf": [{"$ref": "#/components/schemas/Spec-Output"}], "description": "The Spec to squash the dimensions of"}, "check_path_changes": {"type": "boolean", "title": "Check Path Changes", "description": "If True path through scan will not be modified by squash", "default": true}, "type": {"type": "string", "enum": ["Squash"], "const": "Squash", "title": "Type", "default": "Squash"}}, "additionalProperties": false, "type": "object", "required": ["spec"], "title": "Squash", "description": "Squash a stack of Frames together into a single expanded Frames object.\n\nSee Also:\n `why-squash-can-change-path`\n\n.. example_spec::\n\n from scanspec.specs import Line, Squash\n\n spec = Squash(Line(\"y\", 1, 2, 3) * Line(\"x\", 0, 1, 4))"}, "Static": {"properties": {"axis": {"title": "Axis", "description": "An identifier for what to move"}, "value": {"type": "number", "title": "Value", "description": "The value at each point"}, "num": {"type": "integer", "minimum": 1.0, "title": "Num", "description": "Number of frames to produce", "default": 1}, "type": {"type": "string", "enum": ["Static"], "const": "Static", "title": "Type", "default": "Static"}}, "additionalProperties": false, "type": "object", "required": ["axis", "value"], "title": "Static", "description": "A static frame, repeated num times, with axis at value.\n\nCan be used to set axis=value at every point in a scan.\n\n.. example_spec::\n\n from scanspec.specs import Line, Static\n\n spec = Line(\"y\", 1, 2, 3).zip(Static(\"x\", 3))"}, "SymmetricDifferenceOf-Input": {"properties": {"left": {"allOf": [{"$ref": "#/components/schemas/Region-Input"}], "description": "The left-hand Region to combine"}, "right": {"allOf": [{"$ref": "#/components/schemas/Region-Input"}], "description": "The right-hand Region to combine"}, "type": {"type": "string", "enum": ["SymmetricDifferenceOf"], "const": "SymmetricDifferenceOf", "title": "Type", "default": "SymmetricDifferenceOf"}}, "additionalProperties": false, "type": "object", "required": ["left", "right"], "title": "SymmetricDifferenceOf", "description": "A point is in SymmetricDifferenceOf(a, b) if in either a or b, but not both.\n\nTypically created with the ``^`` operator.\n\n>>> r = Range(\"x\", 0.5, 2.5) ^ Range(\"x\", 1.5, 3.5)\n>>> r.mask({\"x\": np.array([0, 1, 2, 3, 4])})\narray([False, True, False, True, False])"}, "SymmetricDifferenceOf-Output": {"properties": {"left": {"allOf": [{"$ref": "#/components/schemas/Region-Output"}], "description": "The left-hand Region to combine"}, "right": {"allOf": [{"$ref": "#/components/schemas/Region-Output"}], "description": "The right-hand Region to combine"}, "type": {"type": "string", "enum": ["SymmetricDifferenceOf"], "const": "SymmetricDifferenceOf", "title": "Type", "default": "SymmetricDifferenceOf"}}, "additionalProperties": false, "type": "object", "required": ["left", "right"], "title": "SymmetricDifferenceOf", "description": "A point is in SymmetricDifferenceOf(a, b) if in either a or b, but not both.\n\nTypically created with the ``^`` operator.\n\n>>> r = Range(\"x\", 0.5, 2.5) ^ Range(\"x\", 1.5, 3.5)\n>>> r.mask({\"x\": np.array([0, 1, 2, 3, 4])})\narray([False, True, False, True, False])"}, "UnionOf-Input": {"properties": {"left": {"allOf": [{"$ref": "#/components/schemas/Region-Input"}], "description": "The left-hand Region to combine"}, "right": {"allOf": [{"$ref": "#/components/schemas/Region-Input"}], "description": "The right-hand Region to combine"}, "type": {"type": "string", "enum": ["UnionOf"], "const": "UnionOf", "title": "Type", "default": "UnionOf"}}, "additionalProperties": false, "type": "object", "required": ["left", "right"], "title": "UnionOf", "description": "A point is in UnionOf(a, b) if in either a or b.\n\nTypically created with the ``|`` operator\n\n>>> r = Range(\"x\", 0.5, 2.5) | Range(\"x\", 1.5, 3.5)\n>>> r.mask({\"x\": np.array([0, 1, 2, 3, 4])})\narray([False, True, True, True, False])"}, "UnionOf-Output": {"properties": {"left": {"allOf": [{"$ref": "#/components/schemas/Region-Output"}], "description": "The left-hand Region to combine"}, "right": {"allOf": [{"$ref": "#/components/schemas/Region-Output"}], "description": "The right-hand Region to combine"}, "type": {"type": "string", "enum": ["UnionOf"], "const": "UnionOf", "title": "Type", "default": "UnionOf"}}, "additionalProperties": false, "type": "object", "required": ["left", "right"], "title": "UnionOf", "description": "A point is in UnionOf(a, b) if in either a or b.\n\nTypically created with the ``|`` operator\n\n>>> r = Range(\"x\", 0.5, 2.5) | Range(\"x\", 1.5, 3.5)\n>>> r.mask({\"x\": np.array([0, 1, 2, 3, 4])})\narray([False, True, True, True, False])"}, "ValidResponse": {"properties": {"input_spec": {"allOf": [{"$ref": "#/components/schemas/Spec-Output"}], "description": "The input scanspec"}, "valid_spec": {"allOf": [{"$ref": "#/components/schemas/Spec-Output"}], "description": "The validated version of the spec"}}, "type": "object", "required": ["input_spec", "valid_spec"], "title": "ValidResponse", "description": "Response model for spec validation."}, "ValidationError": {"properties": {"loc": {"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]}, "type": "array", "title": "Location"}, "msg": {"type": "string", "title": "Message"}, "type": {"type": "string", "title": "Error Type"}}, "type": "object", "required": ["loc", "msg", "type"], "title": "ValidationError"}, "Zip-Input": {"properties": {"left": {"allOf": [{"$ref": "#/components/schemas/Spec-Input"}], "description": "The left-hand Spec to Zip, will appear earlier in axes"}, "right": {"allOf": [{"$ref": "#/components/schemas/Spec-Input"}], "description": "The right-hand Spec to Zip, will appear later in axes"}, "type": {"type": "string", "enum": ["Zip"], "const": "Zip", "title": "Type", "default": "Zip"}}, "additionalProperties": false, "type": "object", "required": ["left", "right"], "title": "Zip", "description": "Run two Specs in parallel, merging their midpoints together.\n\nTypically formed using `Spec.zip`.\n\nStacks of Frames are merged by:\n\n- If right creates a stack of a single Frames object of size 1, expand it to\n the size of the fastest Frames object created by left\n- Merge individual Frames objects together from fastest to slowest\n\nThis means that Zipping a Spec producing stack [l2, l1] with a Spec\nproducing stack [r1] will assert len(l1)==len(r1), and produce\nstack [l2, l1.zip(r1)].\n\n.. example_spec::\n\n from scanspec.specs import Line\n\n spec = Line(\"z\", 1, 2, 3) * Line(\"y\", 3, 4, 5).zip(Line(\"x\", 4, 5, 5))"}, "Zip-Output": {"properties": {"left": {"allOf": [{"$ref": "#/components/schemas/Spec-Output"}], "description": "The left-hand Spec to Zip, will appear earlier in axes"}, "right": {"allOf": [{"$ref": "#/components/schemas/Spec-Output"}], "description": "The right-hand Spec to Zip, will appear later in axes"}, "type": {"type": "string", "enum": ["Zip"], "const": "Zip", "title": "Type", "default": "Zip"}}, "additionalProperties": false, "type": "object", "required": ["left", "right"], "title": "Zip", "description": "Run two Specs in parallel, merging their midpoints together.\n\nTypically formed using `Spec.zip`.\n\nStacks of Frames are merged by:\n\n- If right creates a stack of a single Frames object of size 1, expand it to\n the size of the fastest Frames object created by left\n- Merge individual Frames objects together from fastest to slowest\n\nThis means that Zipping a Spec producing stack [l2, l1] with a Spec\nproducing stack [r1] will assert len(l1)==len(r1), and produce\nstack [l2, l1.zip(r1)].\n\n.. example_spec::\n\n from scanspec.specs import Line\n\n spec = Line(\"z\", 1, 2, 3) * Line(\"y\", 3, 4, 5).zip(Line(\"x\", 4, 5, 5))"}}}} +{ + "openapi": "3.1.0", + "info": { + "title": "FastAPI", + "version": "0.1.1" + }, + "paths": { + "/valid": { + "post": { + "summary": "Valid", + "description": "Validate wether a ScanSpec[str] can produce a viable scan.\n\nArgs:\n spec: The scanspec to validate\n\nReturns:\n ValidResponse: A canonical version of the spec if it is valid.\n An error otherwise.", + "operationId": "valid_valid_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/Spec-Input" + } + ], + "title": "Spec", + "examples": [ + { + "outer": { + "axis": "y", + "start": 0, + "stop": 10, + "num": 3, + "type": "Line" + }, + "inner": { + "axis": "x", + "start": 0, + "stop": 10, + "num": 4, + "type": "Line" + }, + "type": "Product" + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValidResponse" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/midpoints": { + "post": { + "summary": "Midpoints", + "description": "Generate midpoints from a scanspec.\n\nA scanspec can produce bounded points (i.e. a point is valid if an\naxis is between a minimum and and a maximum, see /bounds). The midpoints\nare the middle of each set of bounds.\n\nArgs:\n request: Scanspec and formatting info.\n\nReturns:\n MidpointsResponse: Midpoints of the scan", + "operationId": "midpoints_midpoints_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PointsRequest" + } + ], + "title": "Request", + "examples": [ + { + "spec": { + "outer": { + "axis": "y", + "start": 0, + "stop": 10, + "num": 3, + "type": "Line" + }, + "inner": { + "axis": "x", + "start": 0, + "stop": 10, + "num": 4, + "type": "Line" + }, + "type": "Product" + }, + "max_frames": 1024, + "format": "FLOAT_LIST" + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MidpointsResponse" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/bounds": { + "post": { + "summary": "Bounds", + "description": "Generate bounds from a scanspec.\n\nA scanspec can produce points with lower and upper bounds.\n\nArgs:\n request: Scanspec and formatting info.\n\nReturns:\n BoundsResponse: Bounds of the scan", + "operationId": "bounds_bounds_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PointsRequest" + } + ], + "title": "Request", + "examples": [ + { + "spec": { + "outer": { + "axis": "y", + "start": 0, + "stop": 10, + "num": 3, + "type": "Line" + }, + "inner": { + "axis": "x", + "start": 0, + "stop": 10, + "num": 4, + "type": "Line" + }, + "type": "Product" + }, + "max_frames": 1024, + "format": "FLOAT_LIST" + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BoundsResponse" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/gap": { + "post": { + "summary": "Gap", + "description": "Generate gaps from a scanspec.\n\nA scanspec may indicate if there is a gap between two frames.\nThe array returned corresponds to whether or not there is a gap\nafter each frame.\n\nArgs:\n request: Scanspec and formatting info.\n\nReturns:\n GapResponse: Bounds of the scan", + "operationId": "gap_gap_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/Spec-Input" + } + ], + "title": "Spec", + "examples": [ + { + "outer": { + "axis": "y", + "start": 0, + "stop": 10, + "num": 3, + "type": "Line" + }, + "inner": { + "axis": "x", + "start": 0, + "stop": 10, + "num": 4, + "type": "Line" + }, + "type": "Product" + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GapResponse" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/smalleststep": { + "post": { + "summary": "Smallest Step", + "description": "Calculate the smallest step in a scan, both absolutely and per-axis.\n\nIgnore any steps of size 0.\n\nArgs:\n spec: The spec of the scan\n\nReturns:\n SmallestStepResponse: A description of the smallest steps in the spec", + "operationId": "smallest_step_smalleststep_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/Spec-Input" + } + ], + "title": "Spec", + "examples": [ + { + "outer": { + "axis": "y", + "start": 0, + "stop": 10, + "num": 3, + "type": "Line" + }, + "inner": { + "axis": "x", + "start": 0, + "stop": 10, + "num": 4, + "type": "Line" + }, + "type": "Product" + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SmallestStepResponse" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "BoundsResponse": { + "properties": { + "total_frames": { + "type": "integer", + "title": "Total Frames", + "description": "Total number of frames in spec" + }, + "returned_frames": { + "type": "integer", + "title": "Returned Frames", + "description": "Total of number of frames in this response, may be less than total_frames due to downsampling etc." + }, + "format": { + "allOf": [ + { + "$ref": "#/components/schemas/PointsFormat" + } + ], + "description": "Format of returned point data" + }, + "lower": { + "additionalProperties": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "type": "number" + }, + "type": "array" + } + ] + }, + "type": "object", + "title": "Lower", + "description": "Lower bounds of scan frames if different from midpoints" + }, + "upper": { + "additionalProperties": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "type": "number" + }, + "type": "array" + } + ] + }, + "type": "object", + "title": "Upper", + "description": "Upper bounds of scan frames if different from midpoints" + } + }, + "type": "object", + "required": [ + "total_frames", + "returned_frames", + "format", + "lower", + "upper" + ], + "title": "BoundsResponse", + "description": "Bounds of a generated scan." + }, + "Circle": { + "properties": { + "x_axis": { + "title": "X Axis", + "description": "The name matching the x axis of the spec" + }, + "y_axis": { + "title": "Y Axis", + "description": "The name matching the y axis of the spec" + }, + "x_middle": { + "type": "number", + "title": "X Middle", + "description": "The central x point of the circle" + }, + "y_middle": { + "type": "number", + "title": "Y Middle", + "description": "The central y point of the circle" + }, + "radius": { + "type": "number", + "exclusiveMinimum": 0, + "title": "Radius", + "description": "Radius of the circle" + }, + "type": { + "type": "string", + "enum": [ + "Circle" + ], + "const": "Circle", + "title": "Type", + "default": "Circle" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "x_axis", + "y_axis", + "x_middle", + "y_middle", + "radius" + ], + "title": "Circle", + "description": "Mask contains points of axis within an xy circle of given radius.\n\n.. example_spec::\n\n from scanspec.regions import Circle\n from scanspec.specs import Line\n\n grid = Line(\"y\", 1, 3, 10) * ~Line(\"x\", 0, 2, 10)\n spec = grid & Circle(\"x\", \"y\", 1, 2, 0.9)" + }, + "CombinationOf-Input": { + "properties": { + "left": { + "allOf": [ + { + "$ref": "#/components/schemas/Region-Input" + } + ], + "description": "The left-hand Region to combine" + }, + "right": { + "allOf": [ + { + "$ref": "#/components/schemas/Region-Input" + } + ], + "description": "The right-hand Region to combine" + }, + "type": { + "type": "string", + "enum": [ + "CombinationOf" + ], + "const": "CombinationOf", + "title": "Type", + "default": "CombinationOf" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "left", + "right" + ], + "title": "CombinationOf", + "description": "Abstract baseclass for a combination of two regions, left and right." + }, + "CombinationOf-Output": { + "properties": { + "left": { + "allOf": [ + { + "$ref": "#/components/schemas/Region-Output" + } + ], + "description": "The left-hand Region to combine" + }, + "right": { + "allOf": [ + { + "$ref": "#/components/schemas/Region-Output" + } + ], + "description": "The right-hand Region to combine" + }, + "type": { + "type": "string", + "enum": [ + "CombinationOf" + ], + "const": "CombinationOf", + "title": "Type", + "default": "CombinationOf" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "left", + "right" + ], + "title": "CombinationOf", + "description": "Abstract baseclass for a combination of two regions, left and right." + }, + "Concat-Input": { + "properties": { + "left": { + "allOf": [ + { + "$ref": "#/components/schemas/Spec-Input" + } + ], + "description": "The left-hand Spec to Concat, midpoints will appear earlier" + }, + "right": { + "allOf": [ + { + "$ref": "#/components/schemas/Spec-Input" + } + ], + "description": "The right-hand Spec to Concat, midpoints will appear later" + }, + "gap": { + "type": "boolean", + "title": "Gap", + "description": "If True, force a gap in the output at the join", + "default": false + }, + "check_path_changes": { + "type": "boolean", + "title": "Check Path Changes", + "description": "If True path through scan will not be modified by squash", + "default": true + }, + "type": { + "type": "string", + "enum": [ + "Concat" + ], + "const": "Concat", + "title": "Type", + "default": "Concat" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "left", + "right" + ], + "title": "Concat", + "description": "Concatenate two Specs together, running one after the other.\n\nEach Dimension of left and right must contain the same axes. Typically\nformed using `Spec.concat`.\n\n.. example_spec::\n\n from scanspec.specs import Line\n\n spec = Line(\"x\", 1, 3, 3).concat(Line(\"x\", 4, 5, 5))" + }, + "Concat-Output": { + "properties": { + "left": { + "allOf": [ + { + "$ref": "#/components/schemas/Spec-Output" + } + ], + "description": "The left-hand Spec to Concat, midpoints will appear earlier" + }, + "right": { + "allOf": [ + { + "$ref": "#/components/schemas/Spec-Output" + } + ], + "description": "The right-hand Spec to Concat, midpoints will appear later" + }, + "gap": { + "type": "boolean", + "title": "Gap", + "description": "If True, force a gap in the output at the join", + "default": false + }, + "check_path_changes": { + "type": "boolean", + "title": "Check Path Changes", + "description": "If True path through scan will not be modified by squash", + "default": true + }, + "type": { + "type": "string", + "enum": [ + "Concat" + ], + "const": "Concat", + "title": "Type", + "default": "Concat" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "left", + "right" + ], + "title": "Concat", + "description": "Concatenate two Specs together, running one after the other.\n\nEach Dimension of left and right must contain the same axes. Typically\nformed using `Spec.concat`.\n\n.. example_spec::\n\n from scanspec.specs import Line\n\n spec = Line(\"x\", 1, 3, 3).concat(Line(\"x\", 4, 5, 5))" + }, + "DifferenceOf-Input": { + "properties": { + "left": { + "allOf": [ + { + "$ref": "#/components/schemas/Region-Input" + } + ], + "description": "The left-hand Region to combine" + }, + "right": { + "allOf": [ + { + "$ref": "#/components/schemas/Region-Input" + } + ], + "description": "The right-hand Region to combine" + }, + "type": { + "type": "string", + "enum": [ + "DifferenceOf" + ], + "const": "DifferenceOf", + "title": "Type", + "default": "DifferenceOf" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "left", + "right" + ], + "title": "DifferenceOf", + "description": "A point is in DifferenceOf(a, b) if in a and not in b.\n\nTypically created with the ``-`` operator.\n\n>>> r = Range(\"x\", 0.5, 2.5) - Range(\"x\", 1.5, 3.5)\n>>> r.mask({\"x\": np.array([0, 1, 2, 3, 4])})\narray([False, True, False, False, False])" + }, + "DifferenceOf-Output": { + "properties": { + "left": { + "allOf": [ + { + "$ref": "#/components/schemas/Region-Output" + } + ], + "description": "The left-hand Region to combine" + }, + "right": { + "allOf": [ + { + "$ref": "#/components/schemas/Region-Output" + } + ], + "description": "The right-hand Region to combine" + }, + "type": { + "type": "string", + "enum": [ + "DifferenceOf" + ], + "const": "DifferenceOf", + "title": "Type", + "default": "DifferenceOf" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "left", + "right" + ], + "title": "DifferenceOf", + "description": "A point is in DifferenceOf(a, b) if in a and not in b.\n\nTypically created with the ``-`` operator.\n\n>>> r = Range(\"x\", 0.5, 2.5) - Range(\"x\", 1.5, 3.5)\n>>> r.mask({\"x\": np.array([0, 1, 2, 3, 4])})\narray([False, True, False, False, False])" + }, + "Ellipse": { + "properties": { + "x_axis": { + "title": "X Axis", + "description": "The name matching the x axis of the spec" + }, + "y_axis": { + "title": "Y Axis", + "description": "The name matching the y axis of the spec" + }, + "x_middle": { + "type": "number", + "title": "X Middle", + "description": "The central x point of the ellipse" + }, + "y_middle": { + "type": "number", + "title": "Y Middle", + "description": "The central y point of the ellipse" + }, + "x_radius": { + "type": "number", + "exclusiveMinimum": 0, + "title": "X Radius", + "description": "The radius along the x axis of the ellipse" + }, + "y_radius": { + "type": "number", + "exclusiveMinimum": 0, + "title": "Y Radius", + "description": "The radius along the y axis of the ellipse" + }, + "angle": { + "type": "number", + "title": "Angle", + "description": "The angle of the ellipse (degrees)", + "default": 0 + }, + "type": { + "type": "string", + "enum": [ + "Ellipse" + ], + "const": "Ellipse", + "title": "Type", + "default": "Ellipse" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "x_axis", + "y_axis", + "x_middle", + "y_middle", + "x_radius", + "y_radius" + ], + "title": "Ellipse", + "description": "Mask contains points of axis within an xy ellipse of given radius.\n\n.. example_spec::\n\n from scanspec.regions import Ellipse\n from scanspec.specs import Line\n\n grid = Line(\"y\", 3, 8, 10) * ~Line(\"x\", 1 ,8, 10)\n spec = grid & Ellipse(\"x\", \"y\", 5, 5, 2, 3, 75)" + }, + "GapResponse": { + "properties": { + "gap": { + "items": { + "type": "boolean" + }, + "type": "array", + "title": "Gap", + "description": "Boolean array indicating if there is a gap between each frame" + } + }, + "type": "object", + "required": [ + "gap" + ], + "title": "GapResponse", + "description": "Presence of gaps in a generated scan." + }, + "HTTPValidationError": { + "properties": { + "detail": { + "items": { + "$ref": "#/components/schemas/ValidationError" + }, + "type": "array", + "title": "Detail" + } + }, + "type": "object", + "title": "HTTPValidationError" + }, + "IntersectionOf-Input": { + "properties": { + "left": { + "allOf": [ + { + "$ref": "#/components/schemas/Region-Input" + } + ], + "description": "The left-hand Region to combine" + }, + "right": { + "allOf": [ + { + "$ref": "#/components/schemas/Region-Input" + } + ], + "description": "The right-hand Region to combine" + }, + "type": { + "type": "string", + "enum": [ + "IntersectionOf" + ], + "const": "IntersectionOf", + "title": "Type", + "default": "IntersectionOf" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "left", + "right" + ], + "title": "IntersectionOf", + "description": "A point is in IntersectionOf(a, b) if in both a and b.\n\nTypically created with the ``&`` operator.\n\n>>> r = Range(\"x\", 0.5, 2.5) & Range(\"x\", 1.5, 3.5)\n>>> r.mask({\"x\": np.array([0, 1, 2, 3, 4])})\narray([False, False, True, False, False])" + }, + "IntersectionOf-Output": { + "properties": { + "left": { + "allOf": [ + { + "$ref": "#/components/schemas/Region-Output" + } + ], + "description": "The left-hand Region to combine" + }, + "right": { + "allOf": [ + { + "$ref": "#/components/schemas/Region-Output" + } + ], + "description": "The right-hand Region to combine" + }, + "type": { + "type": "string", + "enum": [ + "IntersectionOf" + ], + "const": "IntersectionOf", + "title": "Type", + "default": "IntersectionOf" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "left", + "right" + ], + "title": "IntersectionOf", + "description": "A point is in IntersectionOf(a, b) if in both a and b.\n\nTypically created with the ``&`` operator.\n\n>>> r = Range(\"x\", 0.5, 2.5) & Range(\"x\", 1.5, 3.5)\n>>> r.mask({\"x\": np.array([0, 1, 2, 3, 4])})\narray([False, False, True, False, False])" + }, + "Line": { + "properties": { + "axis": { + "title": "Axis", + "description": "An identifier for what to move" + }, + "start": { + "type": "number", + "title": "Start", + "description": "Midpoint of the first point of the line" + }, + "stop": { + "type": "number", + "title": "Stop", + "description": "Midpoint of the last point of the line" + }, + "num": { + "type": "integer", + "minimum": 1, + "title": "Num", + "description": "Number of frames to produce" + }, + "type": { + "type": "string", + "enum": [ + "Line" + ], + "const": "Line", + "title": "Type", + "default": "Line" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "axis", + "start", + "stop", + "num" + ], + "title": "Line", + "description": "Linearly spaced frames with start and stop as first and last midpoints.\n\n.. example_spec::\n\n from scanspec.specs import Line\n\n spec = Line(\"x\", 1, 2, 5)" + }, + "Mask-Input": { + "properties": { + "spec": { + "allOf": [ + { + "$ref": "#/components/schemas/Spec-Input" + } + ], + "description": "The Spec containing the source midpoints" + }, + "region": { + "allOf": [ + { + "$ref": "#/components/schemas/Region-Input" + } + ], + "description": "The Region that midpoints will be inside" + }, + "check_path_changes": { + "type": "boolean", + "title": "Check Path Changes", + "description": "If True path through scan will not be modified by squash", + "default": true + }, + "type": { + "type": "string", + "enum": [ + "Mask" + ], + "const": "Mask", + "title": "Type", + "default": "Mask" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "spec", + "region" + ], + "title": "Mask", + "description": "Restrict Spec to only midpoints that fall inside the given Region.\n\nTypically created with the ``&`` operator. It also pushes down the\n``& | ^ -`` operators to its `Region` to avoid the need for brackets on\ncombinations of Regions.\n\nIf a Region spans multiple Frames objects, they will be squashed together.\n\n.. example_spec::\n\n from scanspec.regions import Circle\n from scanspec.specs import Line\n\n spec = Line(\"y\", 1, 3, 3) * Line(\"x\", 3, 5, 5) & Circle(\"x\", \"y\", 4, 2, 1.2)\n\nSee Also: `why-squash-can-change-path`" + }, + "Mask-Output": { + "properties": { + "spec": { + "allOf": [ + { + "$ref": "#/components/schemas/Spec-Output" + } + ], + "description": "The Spec containing the source midpoints" + }, + "region": { + "allOf": [ + { + "$ref": "#/components/schemas/Region-Output" + } + ], + "description": "The Region that midpoints will be inside" + }, + "check_path_changes": { + "type": "boolean", + "title": "Check Path Changes", + "description": "If True path through scan will not be modified by squash", + "default": true + }, + "type": { + "type": "string", + "enum": [ + "Mask" + ], + "const": "Mask", + "title": "Type", + "default": "Mask" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "spec", + "region" + ], + "title": "Mask", + "description": "Restrict Spec to only midpoints that fall inside the given Region.\n\nTypically created with the ``&`` operator. It also pushes down the\n``& | ^ -`` operators to its `Region` to avoid the need for brackets on\ncombinations of Regions.\n\nIf a Region spans multiple Frames objects, they will be squashed together.\n\n.. example_spec::\n\n from scanspec.regions import Circle\n from scanspec.specs import Line\n\n spec = Line(\"y\", 1, 3, 3) * Line(\"x\", 3, 5, 5) & Circle(\"x\", \"y\", 4, 2, 1.2)\n\nSee Also: `why-squash-can-change-path`" + }, + "MidpointsResponse": { + "properties": { + "total_frames": { + "type": "integer", + "title": "Total Frames", + "description": "Total number of frames in spec" + }, + "returned_frames": { + "type": "integer", + "title": "Returned Frames", + "description": "Total of number of frames in this response, may be less than total_frames due to downsampling etc." + }, + "format": { + "allOf": [ + { + "$ref": "#/components/schemas/PointsFormat" + } + ], + "description": "Format of returned point data" + }, + "midpoints": { + "additionalProperties": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "type": "number" + }, + "type": "array" + } + ] + }, + "type": "object", + "title": "Midpoints", + "description": "The midpoints of scan frames for each axis" + } + }, + "type": "object", + "required": [ + "total_frames", + "returned_frames", + "format", + "midpoints" + ], + "title": "MidpointsResponse", + "description": "Midpoints of a generated scan." + }, + "PointsFormat": { + "type": "string", + "enum": [ + "STRING", + "FLOAT_LIST", + "BASE64_ENCODED" + ], + "title": "PointsFormat", + "description": "Formats in which we can return points." + }, + "PointsRequest": { + "properties": { + "spec": { + "allOf": [ + { + "$ref": "#/components/schemas/Spec-Input" + } + ], + "description": "The spec from which to generate points" + }, + "max_frames": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Max Frames", + "description": "The maximum number of points to return, if None will return as many as calculated", + "default": 100000 + }, + "format": { + "allOf": [ + { + "$ref": "#/components/schemas/PointsFormat" + } + ], + "description": "The format in which to output the points data", + "default": "FLOAT_LIST" + } + }, + "type": "object", + "required": [ + "spec" + ], + "title": "PointsRequest", + "description": "A request for generated scan points." + }, + "Polygon": { + "properties": { + "x_axis": { + "title": "X Axis", + "description": "The name matching the x axis of the spec" + }, + "y_axis": { + "title": "Y Axis", + "description": "The name matching the y axis of the spec" + }, + "x_verts": { + "items": { + "type": "number" + }, + "type": "array", + "minItems": 3, + "title": "X Verts", + "description": "The Nx1 x coordinates of the polygons vertices" + }, + "y_verts": { + "items": { + "type": "number" + }, + "type": "array", + "minItems": 3, + "title": "Y Verts", + "description": "The Nx1 y coordinates of the polygons vertices" + }, + "type": { + "type": "string", + "enum": [ + "Polygon" + ], + "const": "Polygon", + "title": "Type", + "default": "Polygon" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "x_axis", + "y_axis", + "x_verts", + "y_verts" + ], + "title": "Polygon", + "description": "Mask contains points of axis within a rotated xy polygon.\n\n.. example_spec::\n\n from scanspec.regions import Polygon\n from scanspec.specs import Line\n\n grid = Line(\"y\", 3, 8, 10) * ~Line(\"x\", 1 ,8, 10)\n spec = grid & Polygon(\"x\", \"y\", [1.0, 6.0, 8.0, 2.0], [4.0, 10.0, 6.0, 1.0])" + }, + "Product-Input": { + "properties": { + "outer": { + "allOf": [ + { + "$ref": "#/components/schemas/Spec-Input" + } + ], + "description": "Will be executed once" + }, + "inner": { + "allOf": [ + { + "$ref": "#/components/schemas/Spec-Input" + } + ], + "description": "Will be executed len(outer) times" + }, + "type": { + "type": "string", + "enum": [ + "Product" + ], + "const": "Product", + "title": "Type", + "default": "Product" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "outer", + "inner" + ], + "title": "Product", + "description": "Outer product of two Specs, nesting inner within outer.\n\nThis means that inner will run in its entirety at each point in outer.\n\n.. example_spec::\n\n from scanspec.specs import Line\n\n spec = Line(\"y\", 1, 2, 3) * Line(\"x\", 3, 4, 12)" + }, + "Product-Output": { + "properties": { + "outer": { + "allOf": [ + { + "$ref": "#/components/schemas/Spec-Output" + } + ], + "description": "Will be executed once" + }, + "inner": { + "allOf": [ + { + "$ref": "#/components/schemas/Spec-Output" + } + ], + "description": "Will be executed len(outer) times" + }, + "type": { + "type": "string", + "enum": [ + "Product" + ], + "const": "Product", + "title": "Type", + "default": "Product" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "outer", + "inner" + ], + "title": "Product", + "description": "Outer product of two Specs, nesting inner within outer.\n\nThis means that inner will run in its entirety at each point in outer.\n\n.. example_spec::\n\n from scanspec.specs import Line\n\n spec = Line(\"y\", 1, 2, 3) * Line(\"x\", 3, 4, 12)" + }, + "Range": { + "properties": { + "axis": { + "title": "Axis", + "description": "The name matching the axis to mask in spec" + }, + "min": { + "type": "number", + "title": "Min", + "description": "The minimum inclusive value in the region" + }, + "max": { + "type": "number", + "title": "Max", + "description": "The minimum inclusive value in the region" + }, + "type": { + "type": "string", + "enum": [ + "Range" + ], + "const": "Range", + "title": "Type", + "default": "Range" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "axis", + "min", + "max" + ], + "title": "Range", + "description": "Mask contains points of axis >= min and <= max.\n\n>>> r = Range(\"x\", 1, 2)\n>>> r.mask({\"x\": np.array([0, 1, 2, 3, 4])})\narray([False, True, True, False, False])" + }, + "Rectangle": { + "properties": { + "x_axis": { + "title": "X Axis", + "description": "The name matching the x axis of the spec" + }, + "y_axis": { + "title": "Y Axis", + "description": "The name matching the y axis of the spec" + }, + "x_min": { + "type": "number", + "title": "X Min", + "description": "Minimum inclusive x value in the region" + }, + "y_min": { + "type": "number", + "title": "Y Min", + "description": "Minimum inclusive y value in the region" + }, + "x_max": { + "type": "number", + "title": "X Max", + "description": "Maximum inclusive x value in the region" + }, + "y_max": { + "type": "number", + "title": "Y Max", + "description": "Maximum inclusive y value in the region" + }, + "angle": { + "type": "number", + "title": "Angle", + "description": "Clockwise rotation angle of the rectangle", + "default": 0 + }, + "type": { + "type": "string", + "enum": [ + "Rectangle" + ], + "const": "Rectangle", + "title": "Type", + "default": "Rectangle" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "x_axis", + "y_axis", + "x_min", + "y_min", + "x_max", + "y_max" + ], + "title": "Rectangle", + "description": "Mask contains points of axis within a rotated xy rectangle.\n\n.. example_spec::\n\n from scanspec.regions import Rectangle\n from scanspec.specs import Line\n\n grid = Line(\"y\", 1, 3, 10) * ~Line(\"x\", 0, 2, 10)\n spec = grid & Rectangle(\"x\", \"y\", 0, 1.1, 1.5, 2.1, 30)" + }, + "Region-Input": { + "oneOf": [ + { + "$ref": "#/components/schemas/CombinationOf-Input" + }, + { + "$ref": "#/components/schemas/UnionOf-Input" + }, + { + "$ref": "#/components/schemas/IntersectionOf-Input" + }, + { + "$ref": "#/components/schemas/DifferenceOf-Input" + }, + { + "$ref": "#/components/schemas/SymmetricDifferenceOf-Input" + }, + { + "$ref": "#/components/schemas/Range" + }, + { + "$ref": "#/components/schemas/Rectangle" + }, + { + "$ref": "#/components/schemas/Polygon" + }, + { + "$ref": "#/components/schemas/Circle" + }, + { + "$ref": "#/components/schemas/Ellipse" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "Circle": "#/components/schemas/Circle", + "CombinationOf": "#/components/schemas/CombinationOf-Input", + "DifferenceOf": "#/components/schemas/DifferenceOf-Input", + "Ellipse": "#/components/schemas/Ellipse", + "IntersectionOf": "#/components/schemas/IntersectionOf-Input", + "Polygon": "#/components/schemas/Polygon", + "Range": "#/components/schemas/Range", + "Rectangle": "#/components/schemas/Rectangle", + "SymmetricDifferenceOf": "#/components/schemas/SymmetricDifferenceOf-Input", + "UnionOf": "#/components/schemas/UnionOf-Input" + } + } + }, + "Region-Output": { + "oneOf": [ + { + "$ref": "#/components/schemas/CombinationOf-Output" + }, + { + "$ref": "#/components/schemas/UnionOf-Output" + }, + { + "$ref": "#/components/schemas/IntersectionOf-Output" + }, + { + "$ref": "#/components/schemas/DifferenceOf-Output" + }, + { + "$ref": "#/components/schemas/SymmetricDifferenceOf-Output" + }, + { + "$ref": "#/components/schemas/Range" + }, + { + "$ref": "#/components/schemas/Rectangle" + }, + { + "$ref": "#/components/schemas/Polygon" + }, + { + "$ref": "#/components/schemas/Circle" + }, + { + "$ref": "#/components/schemas/Ellipse" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "Circle": "#/components/schemas/Circle", + "CombinationOf": "#/components/schemas/CombinationOf-Output", + "DifferenceOf": "#/components/schemas/DifferenceOf-Output", + "Ellipse": "#/components/schemas/Ellipse", + "IntersectionOf": "#/components/schemas/IntersectionOf-Output", + "Polygon": "#/components/schemas/Polygon", + "Range": "#/components/schemas/Range", + "Rectangle": "#/components/schemas/Rectangle", + "SymmetricDifferenceOf": "#/components/schemas/SymmetricDifferenceOf-Output", + "UnionOf": "#/components/schemas/UnionOf-Output" + } + } + }, + "Repeat": { + "properties": { + "num": { + "type": "integer", + "minimum": 1, + "title": "Num", + "description": "Number of frames to produce" + }, + "gap": { + "type": "boolean", + "title": "Gap", + "description": "If False and the slowest of the stack of Frames is snaked then the end and start of consecutive iterations of Spec will have no gap", + "default": true + }, + "type": { + "type": "string", + "enum": [ + "Repeat" + ], + "const": "Repeat", + "title": "Type", + "default": "Repeat" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "num" + ], + "title": "Repeat", + "description": "Repeat an empty frame num times.\n\nCan be used on the outside of a scan to repeat the same scan many times.\n\n.. example_spec::\n\n from scanspec.specs import Line\n\n spec = 2 * ~Line.bounded(\"x\", 3, 4, 1)\n\nIf you want snaked axes to have no gap between iterations you can do:\n\n.. example_spec::\n\n from scanspec.specs import Line, Repeat\n\n spec = Repeat(2, gap=False) * ~Line.bounded(\"x\", 3, 4, 1)\n\n.. note:: There is no turnaround arrow at x=4" + }, + "SmallestStepResponse": { + "properties": { + "absolute": { + "type": "number", + "title": "Absolute", + "description": "Absolute smallest distance between two points on a single axis" + }, + "per_axis": { + "additionalProperties": { + "type": "number" + }, + "type": "object", + "title": "Per Axis", + "description": "Smallest distance between two points on each axis" + } + }, + "type": "object", + "required": [ + "absolute", + "per_axis" + ], + "title": "SmallestStepResponse", + "description": "Information about the smallest steps between points in a spec." + }, + "Snake-Input": { + "properties": { + "spec": { + "allOf": [ + { + "$ref": "#/components/schemas/Spec-Input" + } + ], + "description": "The Spec to run in reverse every other iteration" + }, + "type": { + "type": "string", + "enum": [ + "Snake" + ], + "const": "Snake", + "title": "Type", + "default": "Snake" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "spec" + ], + "title": "Snake", + "description": "Run the Spec in reverse on every other iteration when nested.\n\nTypically created with the ``~`` operator.\n\n.. example_spec::\n\n from scanspec.specs import Line\n\n spec = Line(\"y\", 1, 3, 3) * ~Line(\"x\", 3, 5, 5)" + }, + "Snake-Output": { + "properties": { + "spec": { + "allOf": [ + { + "$ref": "#/components/schemas/Spec-Output" + } + ], + "description": "The Spec to run in reverse every other iteration" + }, + "type": { + "type": "string", + "enum": [ + "Snake" + ], + "const": "Snake", + "title": "Type", + "default": "Snake" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "spec" + ], + "title": "Snake", + "description": "Run the Spec in reverse on every other iteration when nested.\n\nTypically created with the ``~`` operator.\n\n.. example_spec::\n\n from scanspec.specs import Line\n\n spec = Line(\"y\", 1, 3, 3) * ~Line(\"x\", 3, 5, 5)" + }, + "Spec-Input": { + "oneOf": [ + { + "$ref": "#/components/schemas/Product-Input" + }, + { + "$ref": "#/components/schemas/Repeat" + }, + { + "$ref": "#/components/schemas/Zip-Input" + }, + { + "$ref": "#/components/schemas/Mask-Input" + }, + { + "$ref": "#/components/schemas/Snake-Input" + }, + { + "$ref": "#/components/schemas/Concat-Input" + }, + { + "$ref": "#/components/schemas/Squash-Input" + }, + { + "$ref": "#/components/schemas/Line" + }, + { + "$ref": "#/components/schemas/Static" + }, + { + "$ref": "#/components/schemas/Spiral" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "Concat": "#/components/schemas/Concat-Input", + "Line": "#/components/schemas/Line", + "Mask": "#/components/schemas/Mask-Input", + "Product": "#/components/schemas/Product-Input", + "Repeat": "#/components/schemas/Repeat", + "Snake": "#/components/schemas/Snake-Input", + "Spiral": "#/components/schemas/Spiral", + "Squash": "#/components/schemas/Squash-Input", + "Static": "#/components/schemas/Static", + "Zip": "#/components/schemas/Zip-Input" + } + } + }, + "Spec-Output": { + "oneOf": [ + { + "$ref": "#/components/schemas/Product-Output" + }, + { + "$ref": "#/components/schemas/Repeat" + }, + { + "$ref": "#/components/schemas/Zip-Output" + }, + { + "$ref": "#/components/schemas/Mask-Output" + }, + { + "$ref": "#/components/schemas/Snake-Output" + }, + { + "$ref": "#/components/schemas/Concat-Output" + }, + { + "$ref": "#/components/schemas/Squash-Output" + }, + { + "$ref": "#/components/schemas/Line" + }, + { + "$ref": "#/components/schemas/Static" + }, + { + "$ref": "#/components/schemas/Spiral" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "Concat": "#/components/schemas/Concat-Output", + "Line": "#/components/schemas/Line", + "Mask": "#/components/schemas/Mask-Output", + "Product": "#/components/schemas/Product-Output", + "Repeat": "#/components/schemas/Repeat", + "Snake": "#/components/schemas/Snake-Output", + "Spiral": "#/components/schemas/Spiral", + "Squash": "#/components/schemas/Squash-Output", + "Static": "#/components/schemas/Static", + "Zip": "#/components/schemas/Zip-Output" + } + } + }, + "Spiral": { + "properties": { + "x_axis": { + "title": "X Axis", + "description": "An identifier for what to move for x" + }, + "y_axis": { + "title": "Y Axis", + "description": "An identifier for what to move for y" + }, + "x_start": { + "type": "number", + "title": "X Start", + "description": "x centre of the spiral" + }, + "y_start": { + "type": "number", + "title": "Y Start", + "description": "y centre of the spiral" + }, + "x_range": { + "type": "number", + "title": "X Range", + "description": "x width of the spiral" + }, + "y_range": { + "type": "number", + "title": "Y Range", + "description": "y width of the spiral" + }, + "num": { + "type": "integer", + "minimum": 1, + "title": "Num", + "description": "Number of frames to produce" + }, + "rotate": { + "type": "number", + "title": "Rotate", + "description": "How much to rotate the angle of the spiral", + "default": 0 + }, + "type": { + "type": "string", + "enum": [ + "Spiral" + ], + "const": "Spiral", + "title": "Type", + "default": "Spiral" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "x_axis", + "y_axis", + "x_start", + "y_start", + "x_range", + "y_range", + "num" + ], + "title": "Spiral", + "description": "Archimedean spiral of \"x_axis\" and \"y_axis\".\n\nStarts at centre point (\"x_start\", \"y_start\") with angle \"rotate\". Produces\n\"num\" points in a spiral spanning width of \"x_range\" and height of \"y_range\"\n\n.. example_spec::\n\n from scanspec.specs import Spiral\n\n spec = Spiral(\"x\", \"y\", 1, 5, 10, 50, 30)" + }, + "Squash-Input": { + "properties": { + "spec": { + "allOf": [ + { + "$ref": "#/components/schemas/Spec-Input" + } + ], + "description": "The Spec to squash the dimensions of" + }, + "check_path_changes": { + "type": "boolean", + "title": "Check Path Changes", + "description": "If True path through scan will not be modified by squash", + "default": true + }, + "type": { + "type": "string", + "enum": [ + "Squash" + ], + "const": "Squash", + "title": "Type", + "default": "Squash" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "spec" + ], + "title": "Squash", + "description": "Squash a stack of Frames together into a single expanded Frames object.\n\nSee Also:\n `why-squash-can-change-path`\n\n.. example_spec::\n\n from scanspec.specs import Line, Squash\n\n spec = Squash(Line(\"y\", 1, 2, 3) * Line(\"x\", 0, 1, 4))" + }, + "Squash-Output": { + "properties": { + "spec": { + "allOf": [ + { + "$ref": "#/components/schemas/Spec-Output" + } + ], + "description": "The Spec to squash the dimensions of" + }, + "check_path_changes": { + "type": "boolean", + "title": "Check Path Changes", + "description": "If True path through scan will not be modified by squash", + "default": true + }, + "type": { + "type": "string", + "enum": [ + "Squash" + ], + "const": "Squash", + "title": "Type", + "default": "Squash" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "spec" + ], + "title": "Squash", + "description": "Squash a stack of Frames together into a single expanded Frames object.\n\nSee Also:\n `why-squash-can-change-path`\n\n.. example_spec::\n\n from scanspec.specs import Line, Squash\n\n spec = Squash(Line(\"y\", 1, 2, 3) * Line(\"x\", 0, 1, 4))" + }, + "Static": { + "properties": { + "axis": { + "title": "Axis", + "description": "An identifier for what to move" + }, + "value": { + "type": "number", + "title": "Value", + "description": "The value at each point" + }, + "num": { + "type": "integer", + "minimum": 1, + "title": "Num", + "description": "Number of frames to produce", + "default": 1 + }, + "type": { + "type": "string", + "enum": [ + "Static" + ], + "const": "Static", + "title": "Type", + "default": "Static" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "axis", + "value" + ], + "title": "Static", + "description": "A static frame, repeated num times, with axis at value.\n\nCan be used to set axis=value at every point in a scan.\n\n.. example_spec::\n\n from scanspec.specs import Line, Static\n\n spec = Line(\"y\", 1, 2, 3).zip(Static(\"x\", 3))" + }, + "SymmetricDifferenceOf-Input": { + "properties": { + "left": { + "allOf": [ + { + "$ref": "#/components/schemas/Region-Input" + } + ], + "description": "The left-hand Region to combine" + }, + "right": { + "allOf": [ + { + "$ref": "#/components/schemas/Region-Input" + } + ], + "description": "The right-hand Region to combine" + }, + "type": { + "type": "string", + "enum": [ + "SymmetricDifferenceOf" + ], + "const": "SymmetricDifferenceOf", + "title": "Type", + "default": "SymmetricDifferenceOf" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "left", + "right" + ], + "title": "SymmetricDifferenceOf", + "description": "A point is in SymmetricDifferenceOf(a, b) if in either a or b, but not both.\n\nTypically created with the ``^`` operator.\n\n>>> r = Range(\"x\", 0.5, 2.5) ^ Range(\"x\", 1.5, 3.5)\n>>> r.mask({\"x\": np.array([0, 1, 2, 3, 4])})\narray([False, True, False, True, False])" + }, + "SymmetricDifferenceOf-Output": { + "properties": { + "left": { + "allOf": [ + { + "$ref": "#/components/schemas/Region-Output" + } + ], + "description": "The left-hand Region to combine" + }, + "right": { + "allOf": [ + { + "$ref": "#/components/schemas/Region-Output" + } + ], + "description": "The right-hand Region to combine" + }, + "type": { + "type": "string", + "enum": [ + "SymmetricDifferenceOf" + ], + "const": "SymmetricDifferenceOf", + "title": "Type", + "default": "SymmetricDifferenceOf" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "left", + "right" + ], + "title": "SymmetricDifferenceOf", + "description": "A point is in SymmetricDifferenceOf(a, b) if in either a or b, but not both.\n\nTypically created with the ``^`` operator.\n\n>>> r = Range(\"x\", 0.5, 2.5) ^ Range(\"x\", 1.5, 3.5)\n>>> r.mask({\"x\": np.array([0, 1, 2, 3, 4])})\narray([False, True, False, True, False])" + }, + "UnionOf-Input": { + "properties": { + "left": { + "allOf": [ + { + "$ref": "#/components/schemas/Region-Input" + } + ], + "description": "The left-hand Region to combine" + }, + "right": { + "allOf": [ + { + "$ref": "#/components/schemas/Region-Input" + } + ], + "description": "The right-hand Region to combine" + }, + "type": { + "type": "string", + "enum": [ + "UnionOf" + ], + "const": "UnionOf", + "title": "Type", + "default": "UnionOf" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "left", + "right" + ], + "title": "UnionOf", + "description": "A point is in UnionOf(a, b) if in either a or b.\n\nTypically created with the ``|`` operator\n\n>>> r = Range(\"x\", 0.5, 2.5) | Range(\"x\", 1.5, 3.5)\n>>> r.mask({\"x\": np.array([0, 1, 2, 3, 4])})\narray([False, True, True, True, False])" + }, + "UnionOf-Output": { + "properties": { + "left": { + "allOf": [ + { + "$ref": "#/components/schemas/Region-Output" + } + ], + "description": "The left-hand Region to combine" + }, + "right": { + "allOf": [ + { + "$ref": "#/components/schemas/Region-Output" + } + ], + "description": "The right-hand Region to combine" + }, + "type": { + "type": "string", + "enum": [ + "UnionOf" + ], + "const": "UnionOf", + "title": "Type", + "default": "UnionOf" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "left", + "right" + ], + "title": "UnionOf", + "description": "A point is in UnionOf(a, b) if in either a or b.\n\nTypically created with the ``|`` operator\n\n>>> r = Range(\"x\", 0.5, 2.5) | Range(\"x\", 1.5, 3.5)\n>>> r.mask({\"x\": np.array([0, 1, 2, 3, 4])})\narray([False, True, True, True, False])" + }, + "ValidResponse": { + "properties": { + "input_spec": { + "allOf": [ + { + "$ref": "#/components/schemas/Spec-Output" + } + ], + "description": "The input scanspec" + }, + "valid_spec": { + "allOf": [ + { + "$ref": "#/components/schemas/Spec-Output" + } + ], + "description": "The validated version of the spec" + } + }, + "type": "object", + "required": [ + "input_spec", + "valid_spec" + ], + "title": "ValidResponse", + "description": "Response model for spec validation." + }, + "ValidationError": { + "properties": { + "loc": { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "type": "array", + "title": "Location" + }, + "msg": { + "type": "string", + "title": "Message" + }, + "type": { + "type": "string", + "title": "Error Type" + } + }, + "type": "object", + "required": [ + "loc", + "msg", + "type" + ], + "title": "ValidationError" + }, + "Zip-Input": { + "properties": { + "left": { + "allOf": [ + { + "$ref": "#/components/schemas/Spec-Input" + } + ], + "description": "The left-hand Spec to Zip, will appear earlier in axes" + }, + "right": { + "allOf": [ + { + "$ref": "#/components/schemas/Spec-Input" + } + ], + "description": "The right-hand Spec to Zip, will appear later in axes" + }, + "type": { + "type": "string", + "enum": [ + "Zip" + ], + "const": "Zip", + "title": "Type", + "default": "Zip" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "left", + "right" + ], + "title": "Zip", + "description": "Run two Specs in parallel, merging their midpoints together.\n\nTypically formed using `Spec.zip`.\n\nStacks of Frames are merged by:\n\n- If right creates a stack of a single Frames object of size 1, expand it to\n the size of the fastest Frames object created by left\n- Merge individual Frames objects together from fastest to slowest\n\nThis means that Zipping a Spec producing stack [l2, l1] with a Spec\nproducing stack [r1] will assert len(l1)==len(r1), and produce\nstack [l2, l1.zip(r1)].\n\n.. example_spec::\n\n from scanspec.specs import Line\n\n spec = Line(\"z\", 1, 2, 3) * Line(\"y\", 3, 4, 5).zip(Line(\"x\", 4, 5, 5))" + }, + "Zip-Output": { + "properties": { + "left": { + "allOf": [ + { + "$ref": "#/components/schemas/Spec-Output" + } + ], + "description": "The left-hand Spec to Zip, will appear earlier in axes" + }, + "right": { + "allOf": [ + { + "$ref": "#/components/schemas/Spec-Output" + } + ], + "description": "The right-hand Spec to Zip, will appear later in axes" + }, + "type": { + "type": "string", + "enum": [ + "Zip" + ], + "const": "Zip", + "title": "Type", + "default": "Zip" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "left", + "right" + ], + "title": "Zip", + "description": "Run two Specs in parallel, merging their midpoints together.\n\nTypically formed using `Spec.zip`.\n\nStacks of Frames are merged by:\n\n- If right creates a stack of a single Frames object of size 1, expand it to\n the size of the fastest Frames object created by left\n- Merge individual Frames objects together from fastest to slowest\n\nThis means that Zipping a Spec producing stack [l2, l1] with a Spec\nproducing stack [r1] will assert len(l1)==len(r1), and produce\nstack [l2, l1.zip(r1)].\n\n.. example_spec::\n\n from scanspec.specs import Line\n\n spec = Line(\"z\", 1, 2, 3) * Line(\"y\", 3, 4, 5).zip(Line(\"x\", 4, 5, 5))" + } + } + } + } \ No newline at end of file