Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ repos:
rev: v2.4.1
hooks:
- id: codespell
exclude: "skills/optislang-wdf/json-schema/|skills/optislang-wdf/references/all_nodes.wdf|skills/optislang-wdf/references/osl_components.md"

- repo: https://github.com/pycqa/pydocstyle
rev: 6.3.0
Expand Down
254 changes: 254 additions & 0 deletions skills/optislang-wdf/SKILL.md

Large diffs are not rendered by default.

37 changes: 37 additions & 0 deletions skills/optislang-wdf/json-schema/connections.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"$id": "https://ldl-laki.docs.ansys.com/schema/rev00/connections",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Laki Definition Language connections schema",
"description": "Defines connections between data pins.",
"$defs": {
"RelativeDataPinReference": {
"$comment": "A reference to a datapin using a relative reference in the user visible namespace (after instantiating) using dotted notation",
"type": "string"
},
"Assignment": {
"type": "object",
"$comment": "A simple assignment where one value is read and one is written",
"properties": {
"type": {
"enum": [
"Assignment"
]
},
"readFrom": {
"$comment": "The value that is read, or the right side of the equality",
"$ref": "#/$defs/RelativeDataPinReference"
},
"writeTo": {
"$comment": "The value that is written, or the left side of the equality",
"$ref": "#/$defs/RelativeDataPinReference"
}
},
"required": ["readFrom", "writeTo"]
}
},
"type": "array",
"items": {
"$comment": "Only directional assignment is supported in this version. A future version may support other types of connections.",
"$ref": "#/$defs/Assignment"
}
}
75 changes: 75 additions & 0 deletions skills/optislang-wdf/json-schema/datapin_metadata.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{
"$id": "https://ldl-laki.docs.ansys.com/schema/rev00/datapin_metadata",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Laki datapin metadata definition",
"description": "Defines the common metadata for datapins, plus a place to store arbitrary metadata.",
"$defs": {
"children": {
"$comment": "Defines a map of name to datapins where each datapin can be any type.",
"type": "object",
"$comment": "DRY would say this regex should not be cut-n-pasted. Not sure how to achieve that in JSON-Schema reasonably.",
"patternProperties": {
"^[^~!@#$%^&*()+=\\-0-9\\`\\\"\\';:?/.,><\\s][^~!@#$%^&*()+=\\-\\`\\\"\\';:?/.,><\\s]*$": { "$ref": "#"}
Comment thread
rfahlberg marked this conversation as resolved.
},
"additionalProperties": false
}
},
"type": "object",
"properties": {
"type": {
"type": "string",
"$comment": "The variable type as per the allowed types from the type library in use."
},
"direction": {
"$comment": "component_input - the component consumes this external value when it is run.",
"$comment": "component_result - the component produces this external value when it is run.",
"$comment": "control_statement_to_component - Only valid on inner_datapins. Indicates that this is a value that the control statement produces before running the sub-workflow.",
"$comment": "control_statement_from_component - Only valid on inner_datapins. Indicates that this is a value that the control statement consumes after running the sub-workflow.",
"enum": [ "component_input", "component_result", "control_statement_to_component", "control_statement_from_component" ]
},
"additionalMetadata": {
"type": "object",
"$comment": "Arbitrary additional metadata, that is serialized JSON of the specified type."
},
"$ref": {
"$comment": "Reference a type defined elsewhere.",
"$comment": "TODO: Need to define precendence or legality of having $ref and conflicting local defs.",
"type": "string",
"format": "uri-reference"
}
},
"required": [ "type" ],
"additionalProperties": true,
"if": {
"$comment": "If it is of type Struct",
"properties": {
"type": { "enum": [ "Struct", "Struct[]"] }
}
},
"then": {
"$comment": "then create the children properties",
"properties": {
"children": {
"if": {
"required": [ "$ref" ]
},
"then": {
"$comment": "Having a $ref at the children level only makes sense for Struct[], where you might want to declare an array of an already existing struct. The if statements to make it only valid in Struct[] feel like overkill to me.",
"properties": {
"$ref": {
"type": "string",
"format": "uri-reference"
}
}
},
"else": {
"$ref": "#/$defs/children"
}
}
}
},
"else": {
"$comment": "disallow 'children' property if not type Struct",
"not": { "required": [ "children" ] }
}
}
62 changes: 62 additions & 0 deletions skills/optislang-wdf/json-schema/metadata.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"$id": "https://ldl-laki.docs.ansys.com/schema/rev00/metadata",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Laki Definition Language metadata schema",
"description": "Defines a common set of metadata that can be attached to any file.",
"$defs": {
},
"type": "object",
"properties": {
"description": {
"description": "Gives a human readable description of what the document contains.",
"type": "string"
},
"creator": {
"description": "Who created this document.",
"type": "string"
},
"authors": {
"description": "All the authors that have edited this document.",
"type": "array",
"items": {
"type": "string"
}
},
"thumbnail": {
"description": "A reference to a thumbnail view of the contained file.",
"type": "string",
"format": "uri-reference"
},
"version": {
"description": "The version of this document. It is RECOMMENDED that semantic versioning be used, but not required.",
"type": "string"
},
"helpUrl": {
"description": "A link to help documentation for whatever this document contains.",
"type": "string",
"format": "uri-reference"
},
"displayName": {
"description": "A short display name or title for use when listing multiple workflows together.",
"type": "string"
},
"agent": {
"description": "The tool or user agent which generated this content",
"$comment": "Should we define this more precisely?",
"type": "string"
},
"typeLibrary": {
"description": "What type library this workflow uses",
"$comment": "Each workflow must use a single type library system where the type library system provides validation, conversion, and transport rules for data as it is handled by the workflow engine. The URI defined here is merely used as an identifier for the type library. A workflow engine MUST NOT try to execute a workflow that uses a type library that it does not understand. A workflow engine MAY reject to load a file that uses a type library system that it does not understand.",
"type": "string",
"format": "uri"
},
"resetTimeout": {
"type": "integer",
"description": "Specifies the amount of time, in seconds, that the reset command will wait for the reset response before failing.",
"minimum": 1,
"default": 60
}
},
"required": ["agent", "typeLibrary"]
}
24 changes: 24 additions & 0 deletions skills/optislang-wdf/json-schema/properties.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"$id": "https://ldl-laki.docs.ansys.com/schema/rev00/properties",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Laki Definition Language properties schema",
"description": "Defines an object of arbitrary properties that can be attached to nodes on the workflow tree.",
"$defs": {
"labeledType": {
"type": "object",
"minProperties": 1,
"maxProperties": 1
}
},
"type": "object",
"$comment": "TODO: Do we want array types?",
"$comment": "TODO: Do we want to put restrictions on the property names like we did for tree elements?",
Comment thread
rfahlberg marked this conversation as resolved.
"additionalProperties": {
"oneOf": [
{ "$ref": "#/$defs/labeledType" },
Comment thread
rfahlberg marked this conversation as resolved.
{ "type": "boolean" },
{ "type": "string" },
{ "type": "number"}
]
}
}
17 changes: 17 additions & 0 deletions skills/optislang-wdf/json-schema/settings.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$id": "https://ldl-laki.docs.ansys.com/schema/rev00/settings",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Laki Definition Language workflow settings schema",
"description": "Defines a common set of workflow configurations that can be applied to any workflow.",
"$defs": {
},
"type": "object",
"properties": {
"resetTimeout": {
"type": "integer",
"description": "Specifies the amount of time, in seconds, that the reset command will wait for the reset response before failing.",
"minimum": 1,
"default": 60
}
}
}
Loading
Loading