Skip to content

Latest commit

 

History

History
35 lines (24 loc) · 1.01 KB

README.md

File metadata and controls

35 lines (24 loc) · 1.01 KB

Corteva Coding Challenge

Setup

The application is fully containerized so we will want to first bring up the containers

docker compose up

Run the database migrations

docker exec -it corteva_code_challenge-api-1 python manage.py migrate

Import sample data and calculate the statistics

docker exec -it corteva_code_challenge-api-1 python manage.py ingest_weather_data
docker exec -it corteva_code_challenge-api-1 python manage.py ingest_yield_data
docker exec -it corteva_code_challenge-api-1 python manage.py calculate_weather_stats
docker exec -it corteva_code_challenge-api-1 python manage.py correlations_weather_yield # Optional

Note: Both of these processes may take a while as it is going through over a million records.

API calls/docs

Once the containers come up, you can navigate to http://localhost:8000/api/docs/ and see a full set of the APIs available and all their documentations

Unit Tests

docker exec -it corteva_code_challenge-api-1 python manage.py test