299 lines
9.8 KiB
JSON
299 lines
9.8 KiB
JSON
{
|
||
"capability": "origin.analysis@v1",
|
||
"display_name": "Origin 科研分析",
|
||
"default_enrollment": false,
|
||
"output_namespace": "origin_analysis",
|
||
"input_policy": {
|
||
"suffixes": [".csv", ".xlsx", ".json"],
|
||
"max_count": 1,
|
||
"max_bytes": 104857600,
|
||
"max_total_bytes": 104857600
|
||
},
|
||
"outputs": {
|
||
"project": {
|
||
"filename": "analysis.opju",
|
||
"media_type": "application/x-origin-project",
|
||
"relative_path": "analysis.opju",
|
||
"publish": true,
|
||
"required": true
|
||
},
|
||
"result_table": {
|
||
"filename": "result-table.csv",
|
||
"media_type": "text/csv",
|
||
"relative_path": "result-table.csv",
|
||
"publish": true,
|
||
"required": true
|
||
},
|
||
"result_workbook": {
|
||
"filename": "result-table.xlsx",
|
||
"media_type": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
||
"relative_path": "result-table.xlsx",
|
||
"publish": true,
|
||
"required": false
|
||
},
|
||
"diagnostics": {
|
||
"filename": "diagnostics.json",
|
||
"media_type": "application/json",
|
||
"relative_path": "diagnostics.json",
|
||
"publish": true,
|
||
"required": true
|
||
},
|
||
"analysis_spec": {
|
||
"filename": "analysis-spec.json",
|
||
"media_type": "application/json",
|
||
"relative_path": ".meta/analysis-spec.json",
|
||
"publish": false,
|
||
"required": true
|
||
},
|
||
"provenance": {
|
||
"filename": "provenance.json",
|
||
"media_type": "application/json",
|
||
"relative_path": ".meta/provenance.json",
|
||
"publish": false,
|
||
"required": true
|
||
}
|
||
},
|
||
"feature_path": ["operation", "analysis", "type"],
|
||
"features": {
|
||
"data_check": "0.1.0",
|
||
"normalize": "0.1.0",
|
||
"smooth": "0.1.0",
|
||
"differentiate": "0.1.0",
|
||
"integrate": "0.1.0",
|
||
"linear_fit": "0.1.0"
|
||
},
|
||
"summary": {
|
||
"title_path": ["operation", "analysis", "title"]
|
||
},
|
||
"legacy_runtime": null,
|
||
"workspace": null,
|
||
"request_schema": {
|
||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||
"type": "object",
|
||
"x-maxBytes": 65536,
|
||
"required": ["schema_version", "inputs", "operation", "outputs"],
|
||
"additionalProperties": false,
|
||
"properties": {
|
||
"schema_version": {"const": 1},
|
||
"inputs": {
|
||
"type": "array",
|
||
"minItems": 1,
|
||
"maxItems": 1,
|
||
"items": {
|
||
"type": "object",
|
||
"required": ["key", "artifact_id"],
|
||
"additionalProperties": false,
|
||
"properties": {
|
||
"key": {"type": "string", "pattern": "^[a-z][a-z0-9_]{0,31}$"},
|
||
"artifact_id": {"type": "string", "format": "uuid"},
|
||
"selector": {
|
||
"type": "object",
|
||
"required": ["sheet"],
|
||
"additionalProperties": false,
|
||
"properties": {
|
||
"sheet": {"type": "string", "minLength": 1, "maxLength": 128}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"operation": {
|
||
"type": "object",
|
||
"required": ["analysis"],
|
||
"additionalProperties": false,
|
||
"properties": {
|
||
"analysis": {
|
||
"type": "object",
|
||
"required": ["type", "title", "data", "parameters"],
|
||
"additionalProperties": false,
|
||
"properties": {
|
||
"type": {
|
||
"enum": [
|
||
"data_check",
|
||
"normalize",
|
||
"smooth",
|
||
"differentiate",
|
||
"integrate",
|
||
"linear_fit"
|
||
]
|
||
},
|
||
"title": {"type": "string", "minLength": 1, "maxLength": 200},
|
||
"data": {"$ref": "#/$defs/data_binding"},
|
||
"parameters": {"type": "object"}
|
||
},
|
||
"allOf": [
|
||
{
|
||
"if": {"properties": {"type": {"const": "data_check"}}},
|
||
"then": {
|
||
"properties": {
|
||
"parameters": {"$ref": "#/$defs/data_check_parameters"}
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"if": {"properties": {"type": {"const": "normalize"}}},
|
||
"then": {
|
||
"properties": {
|
||
"data": {"$ref": "#/$defs/xy_binding"},
|
||
"parameters": {"$ref": "#/$defs/normalize_parameters"}
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"if": {"properties": {"type": {"const": "smooth"}}},
|
||
"then": {
|
||
"properties": {
|
||
"data": {"$ref": "#/$defs/xy_binding"},
|
||
"parameters": {"$ref": "#/$defs/smooth_parameters"}
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"if": {"properties": {"type": {"const": "differentiate"}}},
|
||
"then": {
|
||
"properties": {
|
||
"data": {"$ref": "#/$defs/xy_binding"},
|
||
"parameters": {"$ref": "#/$defs/differentiate_parameters"}
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"if": {"properties": {"type": {"const": "integrate"}}},
|
||
"then": {
|
||
"properties": {
|
||
"data": {"$ref": "#/$defs/xy_binding"},
|
||
"parameters": {"$ref": "#/$defs/integrate_parameters"}
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"if": {"properties": {"type": {"const": "linear_fit"}}},
|
||
"then": {
|
||
"properties": {
|
||
"data": {"$ref": "#/$defs/xy_binding"},
|
||
"parameters": {"$ref": "#/$defs/linear_fit_parameters"}
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
},
|
||
"outputs": {
|
||
"type": "array",
|
||
"maxItems": 1,
|
||
"uniqueItems": true,
|
||
"items": {
|
||
"type": "object",
|
||
"required": ["key", "type", "format"],
|
||
"additionalProperties": false,
|
||
"properties": {
|
||
"key": {"const": "result_workbook"},
|
||
"type": {"const": "table"},
|
||
"format": {"const": "xlsx"}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"$defs": {
|
||
"data_binding": {
|
||
"type": "object",
|
||
"required": ["input"],
|
||
"additionalProperties": false,
|
||
"properties": {
|
||
"input": {"type": "string", "pattern": "^[a-z][a-z0-9_]{0,31}$"},
|
||
"x": {"type": "string", "minLength": 1, "maxLength": 128},
|
||
"y": {"type": "string", "minLength": 1, "maxLength": 128}
|
||
}
|
||
},
|
||
"xy_binding": {
|
||
"type": "object",
|
||
"required": ["input", "x", "y"],
|
||
"additionalProperties": false,
|
||
"properties": {
|
||
"input": {"type": "string", "pattern": "^[a-z][a-z0-9_]{0,31}$"},
|
||
"x": {"type": "string", "minLength": 1, "maxLength": 128},
|
||
"y": {"type": "string", "minLength": 1, "maxLength": 128}
|
||
}
|
||
},
|
||
"data_check_parameters": {
|
||
"type": "object",
|
||
"description": "数据体检始终返回诊断产物;命中 fail_on 时 diagnostics.passed=false,但 Job 本身成功完成,供调用方决定是否继续分析。",
|
||
"required": ["fail_on"],
|
||
"additionalProperties": false,
|
||
"properties": {
|
||
"fail_on": {
|
||
"type": "array",
|
||
"uniqueItems": true,
|
||
"items": {
|
||
"enum": [
|
||
"missing",
|
||
"non_finite",
|
||
"duplicate_x",
|
||
"non_monotonic_x",
|
||
"uneven_spacing"
|
||
]
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"normalize_parameters": {
|
||
"type": "object",
|
||
"description": "max_abs 使用最大绝对值;area 使用有符号梯形积分;reference 在数据范围内按 X 线性插值得到归一化除数。",
|
||
"required": ["method"],
|
||
"additionalProperties": false,
|
||
"properties": {
|
||
"method": {"enum": ["max_abs", "area", "reference"]},
|
||
"reference_x": {"type": "number"}
|
||
},
|
||
"allOf": [
|
||
{
|
||
"if": {"properties": {"method": {"const": "reference"}}},
|
||
"then": {"required": ["reference_x"]},
|
||
"else": {"not": {"required": ["reference_x"]}}
|
||
}
|
||
]
|
||
},
|
||
"smooth_parameters": {
|
||
"type": "object",
|
||
"description": "固定局部多项式平滑;窗口必须为奇数,边界使用平移后的完整窗口,不补造数据点。",
|
||
"required": ["method", "window", "polynomial_order"],
|
||
"additionalProperties": false,
|
||
"properties": {
|
||
"method": {"const": "savitzky_golay"},
|
||
"window": {"type": "integer", "minimum": 5, "maximum": 101},
|
||
"polynomial_order": {"type": "integer", "minimum": 2, "maximum": 5}
|
||
}
|
||
},
|
||
"differentiate_parameters": {
|
||
"type": "object",
|
||
"description": "使用支持非等间距 X 的二阶边界数值梯度,按 order 重复求导。",
|
||
"required": ["order"],
|
||
"additionalProperties": false,
|
||
"properties": {
|
||
"order": {"type": "integer", "enum": [1, 2]}
|
||
}
|
||
},
|
||
"integrate_parameters": {
|
||
"type": "object",
|
||
"description": "使用梯形积分输出从首个 X 开始的累计积分;from/to 省略时报告完整范围积分。",
|
||
"additionalProperties": false,
|
||
"properties": {
|
||
"from": {"type": "number"},
|
||
"to": {"type": "number"}
|
||
}
|
||
},
|
||
"linear_fit_parameters": {
|
||
"type": "object",
|
||
"description": "固定最小二乘线性拟合并输出 95% t 置信区间、R²、RMSE 和残差;同时在 OPJU 中生成 Origin 原生线性拟合报告。",
|
||
"required": ["include_intercept", "confidence_level"],
|
||
"additionalProperties": false,
|
||
"properties": {
|
||
"include_intercept": {"type": "boolean"},
|
||
"confidence_level": {"const": 0.95}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|