Skip to content

Commit 00251b0

Browse files
authored
Release 1.0.1 (#152)
* Update README and package.json * Re-generate server for API version 1.0.1 * Comment out required properties of pages to prevent UI issues * Fix annotation tests (confidence must be specified)
1 parent 8e84350 commit 00251b0

9 files changed

Lines changed: 63 additions & 11 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ This Data Node can be used to:
2626

2727
### Specification
2828

29-
- Data Node API version: 1.0.0
30-
- Data Node version: 1.0.0
29+
- Data Node API version: 1.0.1
30+
- Data Node version: 1.0.1
3131
- Docker image: [nlpsandbox/data-node]
3232

3333
## Usage

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ services:
1717
- "${MONGO_PORT}:27017"
1818

1919
data-node:
20-
image: nlpsandbox/data-node:1.0.0
20+
image: nlpsandbox/data-node:1.0.1
2121
build:
2222
context: server
2323
dockerfile: Dockerfile

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
},
55
"scripts": {
66
"generate:server": "openapi-generator-cli generate -g python-flask -o server -i $npm_config_specification",
7+
"generate:server:latest": "openapi-generator-cli generate -g python-flask -o server -i https://nlpsandbox.github.io/nlpsandbox-schemas/data-node/latest/openapi.json",
78
"lint": "cd server && flake8",
89
"test": "cd server && tox"
910
}

server/openapi_server/models/text_annotation.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,8 @@ def confidence(self, confidence):
152152
:param confidence: The confidence of this TextAnnotation.
153153
:type confidence: float
154154
"""
155+
if confidence is None:
156+
raise ValueError("Invalid value for `confidence`, must not be `None`") # noqa: E501
155157
if confidence is not None and confidence > 100: # noqa: E501
156158
raise ValueError("Invalid value for `confidence`, must be a value less than or equal to `100`") # noqa: E501
157159
if confidence is not None and confidence < 0: # noqa: E501

server/openapi_server/models/text_date_annotation.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,8 @@ def confidence(self, confidence):
161161
:param confidence: The confidence of this TextDateAnnotation.
162162
:type confidence: float
163163
"""
164+
if confidence is None:
165+
raise ValueError("Invalid value for `confidence`, must not be `None`") # noqa: E501
164166
if confidence is not None and confidence > 100: # noqa: E501
165167
raise ValueError("Invalid value for `confidence`, must be a value less than or equal to `100`") # noqa: E501
166168
if confidence is not None and confidence < 0: # noqa: E501

server/openapi_server/models/text_person_name_annotation.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,8 @@ def confidence(self, confidence):
154154
:param confidence: The confidence of this TextPersonNameAnnotation.
155155
:type confidence: float
156156
"""
157+
if confidence is None:
158+
raise ValueError("Invalid value for `confidence`, must not be `None`") # noqa: E501
157159
if confidence is not None and confidence > 100: # noqa: E501
158160
raise ValueError("Invalid value for `confidence`, must be a value less than or equal to `100`") # noqa: E501
159161
if confidence is not None and confidence < 0: # noqa: E501

server/openapi_server/models/text_physical_address_annotation.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,8 @@ def confidence(self, confidence):
161161
:param confidence: The confidence of this TextPhysicalAddressAnnotation.
162162
:type confidence: float
163163
"""
164+
if confidence is None:
165+
raise ValueError("Invalid value for `confidence`, must not be `None`") # noqa: E501
164166
if confidence is not None and confidence > 100: # noqa: E501
165167
raise ValueError("Invalid value for `confidence`, must be a value less than or equal to `100`") # noqa: E501
166168
if confidence is not None and confidence < 0: # noqa: E501

server/openapi_server/openapi/openapi.yaml

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ info:
88
# Overview
99
1010
The NLP Sandbox Data Node is a repository of data used to benchmark NLP
11-
Tools.
11+
Tools like the NLP Sandbox Date Annotator and Person Name Annotator.
1212
1313
The resources that can be stored in this Data Node and the operations
1414
supported are listed below:
@@ -23,7 +23,7 @@ info:
2323
name: Apache 2.0
2424
url: https://github.com/nlpsandbox/nlpsandbox-schemas/blob/develop/LICENSE
2525
title: NLP Sandbox Data Node API
26-
version: 1.0.0
26+
version: 1.0.1
2727
x-logo:
2828
url: https://nlpsandbox.github.io/nlpsandbox-schemas/logo.png
2929
servers:
@@ -1403,6 +1403,12 @@ components:
14031403
- $ref: '#/components/schemas/ResponsePageMetadata'
14041404
- $ref: '#/components/schemas/PageOfDatasets_allOf'
14051405
description: A page of datasets
1406+
# required:
1407+
# - datasets
1408+
# - limit
1409+
# - links
1410+
# - offset
1411+
# - totalResults
14061412
type: object
14071413
Error:
14081414
description: Problem details (tools.ietf.org/html/rfc7807)
@@ -1473,6 +1479,12 @@ components:
14731479
- $ref: '#/components/schemas/ResponsePageMetadata'
14741480
- $ref: '#/components/schemas/PageOfAnnotationStores_allOf'
14751481
description: A page of annotation stores
1482+
# required:
1483+
# - annotationStores
1484+
# - limit
1485+
# - links
1486+
# - offset
1487+
# - totalResults
14761488
type: object
14771489
AnnotationStoreId:
14781490
description: The ID of the annotation store
@@ -1549,6 +1561,7 @@ components:
15491561
minimum: 0
15501562
type: number
15511563
required:
1564+
- confidence
15521565
- length
15531566
- start
15541567
- text
@@ -1657,6 +1670,12 @@ components:
16571670
- $ref: '#/components/schemas/ResponsePageMetadata'
16581671
- $ref: '#/components/schemas/PageOfAnnotations_allOf'
16591672
description: A page of annotations
1673+
# required:
1674+
# - annotations
1675+
# - limit
1676+
# - links
1677+
# - offset
1678+
# - totalResults
16601679
type: object
16611680
AnnotationId:
16621681
description: The ID of the annotation
@@ -1766,6 +1785,12 @@ components:
17661785
- $ref: '#/components/schemas/ResponsePageMetadata'
17671786
- $ref: '#/components/schemas/PageOfFhirStores_allOf'
17681787
description: A page of FHIR stores
1788+
# required:
1789+
# - fhirStores
1790+
# - limit
1791+
# - links
1792+
# - offset
1793+
# - totalResults
17691794
type: object
17701795
FhirStoreCreateRequest:
17711796
description: An empty object
@@ -1819,6 +1844,12 @@ components:
18191844
- $ref: '#/components/schemas/ResponsePageMetadata'
18201845
- $ref: '#/components/schemas/PageOfPatients_allOf'
18211846
description: A page of FHIR patients
1847+
# required:
1848+
# - limit
1849+
# - links
1850+
# - offset
1851+
# - patients
1852+
# - totalResults
18221853
type: object
18231854
PatientCreateRequest:
18241855
description: A FHIR patient
@@ -1898,6 +1929,12 @@ components:
18981929
- $ref: '#/components/schemas/ResponsePageMetadata'
18991930
- $ref: '#/components/schemas/PageOfNotes_allOf'
19001931
description: A page of notes
1932+
# required:
1933+
# - limit
1934+
# - links
1935+
# - notes
1936+
# - offset
1937+
# - totalResults
19011938
type: object
19021939
NoteCreateRequest:
19031940
description: A clinical note

server/openapi_server/test/integration/test_annotation_controller.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,32 +37,38 @@ def test_create_annotation(self):
3737
"start": 42,
3838
"length": 10,
3939
"text": "10/26/2020",
40-
"dateFormat": "MM/DD/YYYY"
40+
"dateFormat": "MM/DD/YYYY",
41+
"confidence": 95.5
4142
}, {
4243
"start": 42,
4344
"length": 10,
4445
"text": "10/26/2020",
45-
"dateFormat": "MM/DD/YYYY"
46+
"dateFormat": "MM/DD/YYYY",
47+
"confidence": 95.5
4648
}],
4749
"textPersonNameAnnotations": [{
4850
"start": 42,
4951
"length": 11,
50-
"text": "Chloe Price"
52+
"text": "Chloe Price",
53+
"confidence": 95.5
5154
}, {
5255
"start": 42,
5356
"length": 11,
54-
"text": "Chloe Price"
57+
"text": "Chloe Price",
58+
"confidence": 95.5
5559
}],
5660
"textPhysicalAddressAnnotations": [{
5761
"start": 42,
5862
"length": 11,
5963
"text": "Seattle",
60-
"addressType": "city"
64+
"addressType": "city",
65+
"confidence": 95.5
6166
}, {
6267
"start": 42,
6368
"length": 11,
6469
"text": "Seattle",
65-
"addressType": "city"
70+
"addressType": "city",
71+
"confidence": 95.5
6672
}],
6773
"annotationSource": {
6874
"resourceSource": {

0 commit comments

Comments
 (0)