Skip to content

Commit

Permalink
Release 1.0.1 (#152)
Browse files Browse the repository at this point in the history
* 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)
  • Loading branch information
tschaffter authored Feb 26, 2021
1 parent 8e84350 commit 00251b0
Show file tree
Hide file tree
Showing 9 changed files with 63 additions and 11 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ This Data Node can be used to:

### Specification

- Data Node API version: 1.0.0
- Data Node version: 1.0.0
- Data Node API version: 1.0.1
- Data Node version: 1.0.1
- Docker image: [nlpsandbox/data-node]

## Usage
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ services:
- "${MONGO_PORT}:27017"

data-node:
image: nlpsandbox/data-node:1.0.0
image: nlpsandbox/data-node:1.0.1
build:
context: server
dockerfile: Dockerfile
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
},
"scripts": {
"generate:server": "openapi-generator-cli generate -g python-flask -o server -i $npm_config_specification",
"generate:server:latest": "openapi-generator-cli generate -g python-flask -o server -i https://nlpsandbox.github.io/nlpsandbox-schemas/data-node/latest/openapi.json",
"lint": "cd server && flake8",
"test": "cd server && tox"
}
Expand Down
2 changes: 2 additions & 0 deletions server/openapi_server/models/text_annotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ def confidence(self, confidence):
:param confidence: The confidence of this TextAnnotation.
:type confidence: float
"""
if confidence is None:
raise ValueError("Invalid value for `confidence`, must not be `None`") # noqa: E501
if confidence is not None and confidence > 100: # noqa: E501
raise ValueError("Invalid value for `confidence`, must be a value less than or equal to `100`") # noqa: E501
if confidence is not None and confidence < 0: # noqa: E501
Expand Down
2 changes: 2 additions & 0 deletions server/openapi_server/models/text_date_annotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ def confidence(self, confidence):
:param confidence: The confidence of this TextDateAnnotation.
:type confidence: float
"""
if confidence is None:
raise ValueError("Invalid value for `confidence`, must not be `None`") # noqa: E501
if confidence is not None and confidence > 100: # noqa: E501
raise ValueError("Invalid value for `confidence`, must be a value less than or equal to `100`") # noqa: E501
if confidence is not None and confidence < 0: # noqa: E501
Expand Down
2 changes: 2 additions & 0 deletions server/openapi_server/models/text_person_name_annotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ def confidence(self, confidence):
:param confidence: The confidence of this TextPersonNameAnnotation.
:type confidence: float
"""
if confidence is None:
raise ValueError("Invalid value for `confidence`, must not be `None`") # noqa: E501
if confidence is not None and confidence > 100: # noqa: E501
raise ValueError("Invalid value for `confidence`, must be a value less than or equal to `100`") # noqa: E501
if confidence is not None and confidence < 0: # noqa: E501
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ def confidence(self, confidence):
:param confidence: The confidence of this TextPhysicalAddressAnnotation.
:type confidence: float
"""
if confidence is None:
raise ValueError("Invalid value for `confidence`, must not be `None`") # noqa: E501
if confidence is not None and confidence > 100: # noqa: E501
raise ValueError("Invalid value for `confidence`, must be a value less than or equal to `100`") # noqa: E501
if confidence is not None and confidence < 0: # noqa: E501
Expand Down
41 changes: 39 additions & 2 deletions server/openapi_server/openapi/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ info:
# Overview
The NLP Sandbox Data Node is a repository of data used to benchmark NLP
Tools.
Tools like the NLP Sandbox Date Annotator and Person Name Annotator.
The resources that can be stored in this Data Node and the operations
supported are listed below:
Expand All @@ -23,7 +23,7 @@ info:
name: Apache 2.0
url: https://github.com/nlpsandbox/nlpsandbox-schemas/blob/develop/LICENSE
title: NLP Sandbox Data Node API
version: 1.0.0
version: 1.0.1
x-logo:
url: https://nlpsandbox.github.io/nlpsandbox-schemas/logo.png
servers:
Expand Down Expand Up @@ -1403,6 +1403,12 @@ components:
- $ref: '#/components/schemas/ResponsePageMetadata'
- $ref: '#/components/schemas/PageOfDatasets_allOf'
description: A page of datasets
# required:
# - datasets
# - limit
# - links
# - offset
# - totalResults
type: object
Error:
description: Problem details (tools.ietf.org/html/rfc7807)
Expand Down Expand Up @@ -1473,6 +1479,12 @@ components:
- $ref: '#/components/schemas/ResponsePageMetadata'
- $ref: '#/components/schemas/PageOfAnnotationStores_allOf'
description: A page of annotation stores
# required:
# - annotationStores
# - limit
# - links
# - offset
# - totalResults
type: object
AnnotationStoreId:
description: The ID of the annotation store
Expand Down Expand Up @@ -1549,6 +1561,7 @@ components:
minimum: 0
type: number
required:
- confidence
- length
- start
- text
Expand Down Expand Up @@ -1657,6 +1670,12 @@ components:
- $ref: '#/components/schemas/ResponsePageMetadata'
- $ref: '#/components/schemas/PageOfAnnotations_allOf'
description: A page of annotations
# required:
# - annotations
# - limit
# - links
# - offset
# - totalResults
type: object
AnnotationId:
description: The ID of the annotation
Expand Down Expand Up @@ -1766,6 +1785,12 @@ components:
- $ref: '#/components/schemas/ResponsePageMetadata'
- $ref: '#/components/schemas/PageOfFhirStores_allOf'
description: A page of FHIR stores
# required:
# - fhirStores
# - limit
# - links
# - offset
# - totalResults
type: object
FhirStoreCreateRequest:
description: An empty object
Expand Down Expand Up @@ -1819,6 +1844,12 @@ components:
- $ref: '#/components/schemas/ResponsePageMetadata'
- $ref: '#/components/schemas/PageOfPatients_allOf'
description: A page of FHIR patients
# required:
# - limit
# - links
# - offset
# - patients
# - totalResults
type: object
PatientCreateRequest:
description: A FHIR patient
Expand Down Expand Up @@ -1898,6 +1929,12 @@ components:
- $ref: '#/components/schemas/ResponsePageMetadata'
- $ref: '#/components/schemas/PageOfNotes_allOf'
description: A page of notes
# required:
# - limit
# - links
# - notes
# - offset
# - totalResults
type: object
NoteCreateRequest:
description: A clinical note
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,32 +37,38 @@ def test_create_annotation(self):
"start": 42,
"length": 10,
"text": "10/26/2020",
"dateFormat": "MM/DD/YYYY"
"dateFormat": "MM/DD/YYYY",
"confidence": 95.5
}, {
"start": 42,
"length": 10,
"text": "10/26/2020",
"dateFormat": "MM/DD/YYYY"
"dateFormat": "MM/DD/YYYY",
"confidence": 95.5
}],
"textPersonNameAnnotations": [{
"start": 42,
"length": 11,
"text": "Chloe Price"
"text": "Chloe Price",
"confidence": 95.5
}, {
"start": 42,
"length": 11,
"text": "Chloe Price"
"text": "Chloe Price",
"confidence": 95.5
}],
"textPhysicalAddressAnnotations": [{
"start": 42,
"length": 11,
"text": "Seattle",
"addressType": "city"
"addressType": "city",
"confidence": 95.5
}, {
"start": 42,
"length": 11,
"text": "Seattle",
"addressType": "city"
"addressType": "city",
"confidence": 95.5
}],
"annotationSource": {
"resourceSource": {
Expand Down

0 comments on commit 00251b0

Please sign in to comment.