The Climate Change Forecast tool provides an interactive graphical interface for analyzing climate change trends in a selected region. It enables users to visualize historical climate data and forecast potential changes influenced by global warming. This tool is designed to support informed decision-making and enhance climate awareness through predictive analytics.
Ensure the following are installed before proceeding:
- Enable Virtualization in your system's BIOS
- Docker Desktop (Download and sign in)
- VS Code with the following extensions:
- Docker
- Dev Containers
- Clone this repository:
git clone https://github.com/caleb-j-kim/climate-change-forecast.git cd climate-change-forecast - Install dependencies:
pip install -r requirements.txt
- Open VS Code and install the necessary extensions.
- Reopen the project in a Dev Container:
- Press
Ctrl+Shift+P(Windows/Linux) orCmd+Shift+P(Mac) - Type:
Remote-Containers: Reopen in Container
- Press
- Set up a terminal connection with Docker:
- Install Ubuntu and configure remote connections in VS Code.
- Run the following command in the terminal (Windows only):
wsl --install --no-distribution
Ensure Docker Desktop is running before executing the following command:
docker build -t climate-change-forecast .To force a fresh build (if dependencies or the Dockerfile have been updated):
docker build --no-cache -t climate-change-forecast .Run the application using one of the following methods:
- Standard execution:
docker run -p 5000:5000 climate-change-forecast
- Interactive mode:
Then, manually start Flask:
docker run -it -p 5000:5000 climate-change-forecast bash
python -m flask run --host=0.0.0.0
- Testing changes while developing:
docker run -p 5000:5000 -v "$(pwd)":/app climate-change-forecast - AWS Run
docker run -e AWS_ACCESS_KEY_ID=putKeyHere \
-e AWS_SECRET_ACCESS_KEY=putKeyHere \
-e AWS_DEFAULT_REGION=us-east-2 \
-p 5050:5000 climate-change-forecast- Docker Bash
docker run -it \
-e AWS_ACCESS_KEY_ID=putKeyHere
-e AWS_SECRET_ACCESS_KEY=putSecretKeyHere
-e AWS_DEFAULT_REGION=us-east-2
climate-change-forecast /bin/bash
---
## Git Workflow
### Committing and Pushing Changes
1. Stage changes:
```sh
git add .
- Commit changes:
git commit -m "Describe changes here" - Push to the remote repository:
git push
- Train models:
Invoke-RestMethod -Method GET -Uri "http://localhost:5000/train" - Test models:
Invoke-RestMethod -Method GET -Uri "http://localhost:5000/test" - Predict climate:
Invoke-RestMethod -Method POST -Uri "http://localhost:5000/predict" -Body '{"dataset": "country", "year": 2020, "month": 07, "location": "United States"}'
-ContentType "application/json"
Invoke-RestMethod -Method POST -Uri "http://localhost:5000/predict" `
-Body '{"dataset": "city", "year": 2000, "month": 7, "location": {"city": "New York", "country": "United States"}}' `
-ContentType "application/json"
``` sh
Invoke-RestMethod -Method POST -Uri "http://localhost:5000/predict" `
-Body '{"dataset": "state", "year": 2000, "month": 7, "location": {"state": "Virginia", "country": "United States"}}' `
-ContentType "application/json"
4. Tomorrow.io tests:
``` sh
Invoke-RestMethod http://localhost:5000/weather/forecast/random_country |
ConvertTo-Json -Depth 5
``` sh
Invoke-RestMethod http://localhost:5000/weather/forecast/random_city |
ConvertTo-Json -Depth 5
``` sh
Invoke-RestMethod http://localhost:5000/weather/forecast/random_state |
ConvertTo-Json -Depth 5