ECMWFCode4Earth / vAirify

code repository for 2024 Code for Earth project #16
MIT License
2 stars 1 forks source link

Create an API to query in situ data for summary page #32

Closed amehta-scottlogic closed 3 months ago

amehta-scottlogic commented 4 months ago

Description

The first screen in the dashboard is going to show 10 cities where the forecasted and in situ values are most different. This will be done for a specific forecast_base_time and forecast_valid_time

To do this we need to actually calculate this from the data in our database.

Acceptance Criteria

mwalker-scottlogic commented 3 months ago

Test Analysis

How this should work in practice, having confirmed with Ajay

Parameters:

Output:

Seed data for a specific city

Manually calculate pollutant level and overall AQI means and medians for a test dataset.

Interoperability:

Security:

Errors:

Data:

Test Charter:

Regression candidate:

mwalker-scottlogic commented 3 months ago

Finding - Pollutant median not calculated correctly on even dataset

Description:

Steps to reproduce:

  1. Design a Postman API query such as GET /air-pollutant/measurements/summary?measurement_base_time=2024-07-20T15%3A00%3A00.000%2B00%3A00&measurement_time_range=90&location_type=city
  2. Delete the data in the in_situ_data database
  3. Seed specific test data that in conjunction with the params of the API call above would provide 2 documents for one city to calculate the median
  4. Make the call and assess the pollutant level median

Expected:

Actual:

Test Data:

Image

API Response:

Image

mwalker-scottlogic commented 3 months ago

forecast_api_seeded_data_tests.py, forecast_api_validation_tests.py, cams_known_grib_test.py, forecast_calibration_tests.py & open_aq_etl_tests.py tests all passed.

Executed manual test cases, had to make some changes to test assertions, but expected behaviour was observed

mwalker-scottlogic commented 3 months ago

Findings - Charter 9 Test Execution