From 64e93b602e3482b8853dd44eed5be7077bbcaa9c Mon Sep 17 00:00:00 2001 From: david-i-berry Date: Mon, 15 Jan 2024 15:33:19 +0100 Subject: [PATCH] Update to tests.yml to install templates before testing. --- .github/workflows/tests.yml | 2 + .../resources/mappings/mapping_schema.json | 102 ------------------ 2 files changed, 2 insertions(+), 102 deletions(-) delete mode 100644 csv2bufr/resources/mappings/mapping_schema.json diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f09deda..cf7fbf1 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -31,6 +31,8 @@ jobs: pip3 install -r requirements.txt pip3 install -r requirements-dev.txt python3 setup.py install + mkdir -p /opt/csv2bufr + git clone https://github.com/wmo-im/csv2bufr-templates.git -b refactor /opt/csv2bufr - name: run tests ⚙️ run: | pytest diff --git a/csv2bufr/resources/mappings/mapping_schema.json b/csv2bufr/resources/mappings/mapping_schema.json deleted file mode 100644 index 0600078..0000000 --- a/csv2bufr/resources/mappings/mapping_schema.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "$id": "csv2bufr.wis2.0.node.wis", - "$schema": "https://json-schema.org/draft/2020-12/schema", - "type": "object", - "properties": { - "inputShortDelayedDescriptorReplicationFactor": { - "type": "array", - "items": {"type": "integer"} - }, - "inputDelayedDescriptorReplicationFactor": { - "type": "array", - "items": {"type": "integer"} - }, - "inputExtendedDelayedDescriptorReplicationFactor": { - "type": "array", - "items": {"type": "integer"} - }, - "number_header_rows": { - "type": "integer", - "description": "Number of header rows in file before the data" - }, - "column_names_row": { - "type": "integer", - "description": "Which header line the column names is given on" - - }, - "wigos_station_identifier": { - "type": "string", - "description": "Either the WIGOS station identifier for the data or the column in the CSV file containing the identifier" - }, - "delimiter": { - "type": "string", - "description": "The delimiter used to separate fields in the input csv file, must be one of ',', ';'. '|' or [tab]" - }, - "quoting": { - "type": "string", - "description": "CSV quoting method to use, must be one of QUOTE_NONNUMERIC, QUOTE_ALL, QUOTE_MINIMAL or QUOTE_NONE" - }, - "quotechar": { - "type": "string", - "description": "quote character to use, e.g. \", ' etc" - }, - "header":{ - "type": "array", - "items": {"$ref": "#/$defs/bufr_element"}, - "description": "Contents of header sections of BUFR message" - }, - "data": { - "type": "array", - "items": {"$ref": "#/$defs/bufr_element"}, - "description": "mapping from CSV file (or metadata json file) to BUFR" - } - }, - "required" : [ - "inputShortDelayedDescriptorReplicationFactor", - "inputDelayedDescriptorReplicationFactor", - "inputExtendedDelayedDescriptorReplicationFactor", - "column_names_row","number_header_rows","header","data"], - - "$defs":{ - "bufr_element": { - "type": "object", - "properties": { - "eccodes_key": { - "type": "string", - "descripition": "eccodes key used to set the value in the BUFR data" - }, - "value": { - "type": [ - "string" - ], - "description": "where to extract the value from, can be one off 'data','metadata','const','array' followed by the value or column header" - }, - "valid_min": { - "type": "string", - "description": "Minimum valid value for parameter if set" - }, - "valid_max": { - "type": "string", - "description": "Maximum value for for the parameter if set" - }, - "scale": { - "type": "string", - "description": "Value used to scale the data by before encoding using the same conventions as in BUFR" - }, - "offset": { - "type": "string", - "description": "Value added to the data before encoding to BUFR following the same conventions as BUFR" - } - }, - "required": ["eccodes_key", "value"], - "allOf": [ - { - "dependentRequired": {"scale": ["offset"]} - }, - { - "dependentRequired": {"offset": ["scale"]} - } - ] - } - } -}