From 9ec96ade0f6bdd134eea275112bed7868252b7ed Mon Sep 17 00:00:00 2001 From: Mackenzie Grimes - NOAA Affiliate <mackenzie.grimes@noaa.gov> Date: Tue, 10 Dec 2024 13:02:57 -0700 Subject: [PATCH 1/2] add new testing subdir nwsc_gateway, copy one Criteria --- README.md | 6 +- python/idsse/testing/nwsc_gateway/__init__.py | 0 .../nwsc_gateway/criteria_single_point.json | 62 +++++++++++++++++++ python/setup.py | 12 ++-- 4 files changed, 72 insertions(+), 8 deletions(-) create mode 100644 python/idsse/testing/nwsc_gateway/__init__.py create mode 100644 python/idsse/testing/nwsc_gateway/criteria_single_point.json diff --git a/README.md b/README.md index 153f66f..c7e12f8 100644 --- a/README.md +++ b/README.md @@ -12,9 +12,9 @@ The complete twelve-factors methodologies that the IDSS Engine Project adheres t To support some standardization and best practices for IDSS Engine, developers should following the logging guide found under the docs directory [here](https://github.com/NOAA-GSL/idss-engine-commons) ## Build, Release, and Install -The subsections below outline how to build the package within this project. +The subsections below outline how to build the package within this project. #### Build -From the IDSS Engine Testing project python directory `idsse-testing/pythom/`: +From the IDSS Engine Testing project python directory `idsse-testing/python/`: -`$ pip imstall .` +`$ pip install .` diff --git a/python/idsse/testing/nwsc_gateway/__init__.py b/python/idsse/testing/nwsc_gateway/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/python/idsse/testing/nwsc_gateway/criteria_single_point.json b/python/idsse/testing/nwsc_gateway/criteria_single_point.json new file mode 100644 index 0000000..4c181f1 --- /dev/null +++ b/python/idsse/testing/nwsc_gateway/criteria_single_point.json @@ -0,0 +1,62 @@ +{ + "corrId": { + "originator": "IMS", + "uuid": "fd35adec-d2a0-49a9-a320-df20a7b6d681", + "issueDt": "2024-01-02T03:00:00.000Z" + }, + "location": { + "features": [ + { + "geometry": { + "coordinates": [-113.9595, 46.8571], + "type": "Point" + }, + "properties": { + "name": "Missoula" + }, + "type": "Feature" + } + ] + }, + "issueDt": "2024-01-02T03:00:00.000Z", + "validDt": [ + { + "times": ["2024-01-02T15:00:00.000Z", "2024-01-02T16:00:00.000Z"] + } + ], + "conditions": [ + { + "name": "Minor", + "severity": "MINOR", + "combined": "A", + "partsUsed": ["A"] + } + ], + "parts": [ + { + "name": "A", + "duration": 0, + "arealPercentage": 0, + "region": "CONUS", + "product": { + "fcst": ["NBM"] + }, + "field": "TEMP", + "units": "DEG F", + "relational": "LESS THAN", + "thresh": 32, + "mapping": { + "min": 17, + "max": 47, + "clip": "true" + } + } + ], + "tags": { + "values": [], + "keyValues": { + "name": "GSL Test 1", + "nwsOffice": "GSL" + } + } +} diff --git a/python/setup.py b/python/setup.py index 2afee72..11cad14 100644 --- a/python/setup.py +++ b/python/setup.py @@ -3,6 +3,7 @@ import os from setuptools import setup + def package_files(directory): paths = [] for (path, directories, filenames) in os.walk(directory): @@ -10,6 +11,7 @@ def package_files(directory): paths.append(os.path.join(path, filename)) return paths + setup(name='idsse-testing', version='1.0', description='IDSSe Common Test Data and External Proxies', @@ -28,6 +30,7 @@ def package_files(directory): 'idsse.testing.ims_request', 'idsse.testing.ims_response', 'idsse.testing.ims_service', + 'idsse.testing.nwsc_gateway', 'idsse.testing.risk_processor', 'idsse.testing.risk_processor.binghamton', 'idsse.testing.risk_processor.i87', @@ -40,12 +43,12 @@ def package_files(directory): ('idsse.testing.data_access.nbm_aws_grib', package_files('idsse/testing/data_access/nbm_aws_grib')), ('idsse.testing.data_access.validation', package_files('idsse/testing/data_access/validation'))], include_package_data=True, - package_data={'':['*.csv', '*.json', '*.nc', '*.grib2*']}, + package_data={'': ['*.csv', '*.json', '*.nc', '*.grib2*']}, install_requires=[ 'pika', 'jsonschema', - 'netcdf4', - 'h5netcdf', + 'netcdf4', + 'h5netcdf', 'python-logging-rabbitmq' ], extras_require={ @@ -54,5 +57,4 @@ def package_files(directory): 'pytest-cov', ] }, - zip_safe=False, -) + zip_safe=False) From e42a4b9a37fc67426c1b707b5d6466ff5eb6fd01 Mon Sep 17 00:00:00 2001 From: Mackenzie Grimes - NOAA Affiliate <mackenzie.grimes@noaa.gov> Date: Tue, 10 Dec 2024 13:30:03 -0700 Subject: [PATCH 2/2] add example SupportProfile from theoretical NWSC api --- .../support_profile_single_point.json | 78 +++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 python/idsse/testing/nwsc_gateway/support_profile_single_point.json diff --git a/python/idsse/testing/nwsc_gateway/support_profile_single_point.json b/python/idsse/testing/nwsc_gateway/support_profile_single_point.json new file mode 100644 index 0000000..393b007 --- /dev/null +++ b/python/idsse/testing/nwsc_gateway/support_profile_single_point.json @@ -0,0 +1,78 @@ +{ + "profiles": [ + { + "id": "fd35adec-d2a0-49a9-a320-df20a7b6d681", + "name": "GSL Test 1", + "associatedOfficeId": "GSL", + "profileType": "LIMITED_EPISODIC", + "lifecycleStatus": "UNDEF", + "submissionStatus": "APPROVED", + "setting": { + "id": "09acfa26-c2b4-4b8f-8dc8-8c9afc7c66e0", + "name": "Missoula", + "driverType": "EVENT", + "locations": [ + { + "createdAt": "2024-01-26T19:07:33.559672Z", + "creationMethod": "DRAWPOINT", + "editable": true, + "original": null, + "address": null, + "geometryType": "POINT", + "minElevation": 4124, + "maxElevation": 4124, + "lastModified": "2024-01-26T19:07:33.559675Z", + "name": "Missoula", + "notes": "", + "userData": null, + "validTime": null, + "geoShapeCreationMethod": "DRAWPOINT", + "geomAsString": "POINT (-113.9595 46.8571)" + } + ], + "timing": { + "start": null, + "duration": 0, + "rrule": "" + }, + "nationalSecurity": false, + "website": "", + "numberOfPeople": 1 + }, + "impacts": [], + "nonImpactThresholds": { + "phrasesForAllSeverities": { + "MINOR": { + "severity": "MINOR", + "encodedRepresentation": "A", + "map": { + "A": { + "type": "TYPE_AND_THRESH", + "phraseId": "A", + "probability": 0, + "environmentalConditionType": "COLD", + "wwaProduct": "UNDEF", + "condition": "LESS_THAN", + "value": "32", + "timeFrame": "PT0S", + "minDuration": "PT0S", + "units": "DEG_F", + "dataSource": "", + "dataParameter": "" + } + } + } + }, + "allTypesAsStrings": ["COLD"] + }, + "maxLeadTime": 168, + "isLive": true, + "requestedServices": [], + "timeBuffer": 0, + "geoBuffer": 5.0, + "profileLevelActionPlans": [], + "maxLeadTimeAsString": "7 d" + } + ], + "errors": [] +}