Skip to content

Commit

Permalink
Update to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
david-i-berry committed Dec 22, 2024
1 parent 8f8a99f commit c30fb72
Show file tree
Hide file tree
Showing 3 changed files with 500 additions and 26 deletions.
28 changes: 11 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,22 @@
#
###############################################################################

#FROM ubuntu:latest
FROM wmoim/dim_eccodes_baseimage:2.28.0

FROM wmoim/dim_eccodes_baseimage:jammy-2.36.0
ENV DEBIAN_FRONTEND="noninteractive" \
TZ="Etc/UTC" \
ECCODES_DIR=/opt/eccodes \
ECCODES_DEFINITION_PATH=/opt/eccodes/share/eccodes/definitions \
PATH="${PATH}:/opt/eccodes/bin"

RUN echo "Acquire::Check-Valid-Until \"false\";\nAcquire::Check-Date \"false\";" | cat > /etc/apt/apt.conf.d/10no--check-valid-until \
&& apt-get update -y \
&& apt-get install -y ${BUILD_PACKAGES} libudunits2-0 \
&& apt-get remove --purge -y ${BUILD_PACKAGES} \
&& apt autoremove -y \
&& apt-get -q clean \
&& rm -rf /var/lib/apt/lists/*


COPY . /tmp/bufr2geojson
# Install additional packges
RUN echo apt-get update -y \
&& apt-get upgrade -y \
&& apt-get install -y libudunits2-0 curl

RUN cd /tmp/bufr2geojson && python3 setup.py install
# clean up
RUN cd /tmp && rm -r bufr2geojson
WORKDIR /tmp
COPY . /tmp
RUN cd /tmp && python3 setup.py install
RUN cd /tmp && rm -r ./*

WORKDIR /
WORKDIR /local

320 changes: 320 additions & 0 deletions bufr2geojson/resources/schemas/wccdm-obs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,320 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "http://schemas.wmo.int/cdm-obs/2024/wccdm-obs.json",
"title": "WCCDM-OBS record definition",
"description": "JSON schema for the representation of WCCDM-OBS",
"definitions": {
"TM_Period": {
"type": "string",
"pattern": "^(\\d{4}-\\d{2}-\\d{2}[ tT]{1}\\d{2}:\\d{2}:\\d{2}[zZ]{0,1})/(\\d{4}-\\d{2}-\\d{2}[ tT]{1}\\d{2}:\\d{2}:\\d{2}[zZ]{0,1})$"
},
"TM_Instant": {
"anyOf": [
{
"type": "string",
"format": "date-time"
},
{
"type": "string",
"format": "date"
}
]
},
"httpURI": {
"oneOf": [
{
"type": "string",
"format": "uri"
},
{
"type": "null"
}
]
},
"Collection": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"FeatureCollection"
]
},
"features": {
"type": "array",
"items": {
"$ref": "#/definitions/Observation"
}
}
}
},
"Observation": {
"type": "object",
"required": [
"conformsTo",
"id",
"type",
"geometry",
"properties"
],
"properties": {
"conformsTo": {
"type": "array",
"items": {
"$ref": "#/definitions/httpURI"
},
"minItems": 1
},
"id": {
"$ref": "#/definitions/httpURI"
},
"type": {
"type": "string",
"enum": [
"Feature"
]
},
"geometry": {
"$ref": "#/definitions/Geometry"
},
"properties": {
"$ref": "#/definitions/Properties"
}
}
},
"Geometry": {
"type": "object",
"required": [
"type",
"coordinates"
],
"properties": {
"type": {
"type": "string",
"enum": [
"Point"
]
},
"coordinates": {
"type": "array",
"items": {
"type": "number"
},
"minItems": 2
}
}
},
"QualityFlag": {
"type": "object",
"required": [
"inScheme",
"flag",
"flagValue"
],
"properties": {
"flag": {
"$ref": "#/definitions/httpURI"
},
"flagValue": {
"$ref": "#/definitions/httpURI"
},
"inScheme": {
"$ref": "#/definitions/httpURI"
}
}
},
"Properties": {
"type": "object",
"required": [
"host",
"observedProperty",
"observingProcedure",
"phenomenonTime",
"resultTime",
"resultQuality",
"result",
"parameter",
"featureOfInterest"
],
"properties": {
"host": {
"$ref": "#/definitions/httpURI"
},
"observer": {
"$ref": "#/definitions/httpURI"
},
"observationType": {
"$ref": "#/definitions/httpURI"
},
"observedProperty": {
"$ref": "#/definitions/httpURI"
},
"observingProcedure": {
"$ref": "#/definitions/httpURI"
},
"phenomenonTime": {
"anyOf": [
{
"$ref": "#/definitions/TM_Period"
},
{
"$ref": "#/definitions/TM_Instant"
}
]
},
"resultTime": {
"$ref": "#/definitions/TM_Instant"
},
"validTime": {
"oneOf": [
{"$ref": "#/definitions/TM_Period"},
{ "type": "null"}
]
},
"resultQuality": {
"type": "array",
"items": {
"$ref": "#/definitions/QualityFlag"
},
"minItems": 1
},
"result": {
"$ref": "#/definitions/Result"
},
"parameter": {
"$ref": "#/definitions/Parameter"
},
"featureOfInterest": {
"type": "array",
"items": {
"$ref": "#/definitions/Feature"
},
"minItems": 1
}
}
},
"Result": {
"type": "object",
"required": [
"value",
"units"
],
"properties": {
"value": {},
"units": {
"$ref": "#/definitions/httpURI"
},
"standardUncertainty": {
"oneOf": [
{"type": "number"},
{"type": "null"}
]
}
}
},
"Parameter": {
"type": "object",
"required": [
"status",
"version",
"isMemberOf"
],
"properties": {
"hasProvenance": {
"oneOf": [
{"$ref": "#/definitions/httpURI"},
{"type": "object"}
]
},
"status": {
"$ref": "#/definitions/httpURI"
},
"version": {
"type": "integer"
},
"comment": {
"oneOf": [
{"type": "string"},
{"type": "null"}
]
},
"reportType": {
"$ref": "#/definitions/httpURI"
},
"reportIdentifier": {
"$ref": "#/definitions/httpURI"
},
"isMemberOf": {
"$ref": "#/definitions/httpURI"
},
"additionalProperties": {}
}
},
"Feature": {
"type": "object",
"required": [
"id",
"label",
"relation"
],
"properties": {
"id": {
"$ref": "#/definitions/httpURI"
},
"label": {
"oneOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"relation": {
"oneOf": [
{
"type": "string",
"enum": ["proximate", "ultimate"]
},
{
"type": "null"
}
]
}
}
}
},
"type": "object",
"required": [
"conformsTo",
"id",
"type",
"geometry",
"properties"
],
"properties": {
"conformsTo": {
"type": "array",
"items": {
"$ref": "#/definitions/httpURI"
},
"minItems": 1
},
"id": {
"$ref": "#/definitions/httpURI"
},
"type": {
"type": "string",
"enum": [
"Feature"
]
},
"geometry": {
"$ref": "#/definitions/Geometry"
},
"properties": {
"$ref": "#/definitions/Properties"
}
}
}
Loading

0 comments on commit c30fb72

Please sign in to comment.