Skip to content

Commit

Permalink
Add ANGLE and MULTIPLE_ANGLE answer schemas (#135)
Browse files Browse the repository at this point in the history
  • Loading branch information
HarmvZ authored Jul 14, 2022
1 parent 3be9f11 commit 13225ec
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 1 deletion.
5 changes: 5 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# History

## 0.8.0 (2022-07-14)

- Dropped reader study answer POST data validation
- Added support for angle answer types

## 0.7.0 (2022-05-02)

- `page()` now returns a `PageResponse(list)` object rather than a `list`, which adds the attributes `offset`, `limit` and `total_count`
Expand Down
66 changes: 66 additions & 0 deletions gcapi/schemas/answer.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,31 @@
},
"required": ["seed_points", "path_point_lists"]
},
"angle-object": {
"type": "object",
"properties": {
"name": {"type": "string"},
"type": {"enum": ["Angle"]},
"lines": {
"type": "array",
"items": {
"type": "array",
"items": {
"type": "array",
"items": {"type": "number"},
"minItems": 3,
"maxItems": 3
},
"minItems": 2,
"maxItems": 2
},
"minItems": 2,
"maxItems": 2
},
"probability": {"type": "number", "minimum": 0, "maximum": 1}
},
"required": ["lines"]
},
"2DBB": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -323,6 +348,45 @@
},
"required": ["type", "version", "lines"]
},
"ANGL": {
"type": "object",
"properties": {
"name": {"type": "string"},
"type": {"enum": ["Angle"]},
"lines": {
"type": "array",
"items": {
"type": "array",
"items": {
"type": "array",
"items": {"type": "number"},
"minItems": 3,
"maxItems": 3
},
"minItems": 2,
"maxItems": 2
},
"minItems": 2,
"maxItems": 2
},
"version": {"$ref": "#/definitions/version"},
"probability": {"type": "number", "minimum": 0, "maximum": 1}
},
"required": ["lines", "version"]
},
"MANG": {
"type": "object",
"properties": {
"type": {"enum": ["Multiple angles"]},
"name": {"type": "string"},
"angles": {
"type": "array",
"items": {"$ref": "#/definitions/angle-object"}
},
"version": {"$ref": "#/definitions/version"}
},
"required": ["type", "version", "angles"]
},
"CHOI": {"type": "number"},
"MCHO": {"type": "array", "items": {"type": "number"}},
"MASK": {
Expand Down Expand Up @@ -350,6 +414,8 @@
{"$ref": "#/definitions/MCHO"},
{"$ref": "#/definitions/LINE"},
{"$ref": "#/definitions/MLIN"},
{"$ref": "#/definitions/ANGL"},
{"$ref": "#/definitions/MANG"},
{"$ref": "#/definitions/MASK"}
]
}
Expand Down
2 changes: 2 additions & 0 deletions gcapi/schemas/reader-study.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@
"Multiple polygons",
"Line",
"Multiple lines",
"Angle",
"Multiple angles",
"Mask"
]
},
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "gcapi"
version = "0.7.0"
version = "0.8.0"
description = "Python client for the grand-challenge.org REST API"
authors = ["James Meakin <[email protected]>"]
license = "Apache-2.0"
Expand Down

0 comments on commit 13225ec

Please sign in to comment.