Skip to content

Commit 0fa18cd

Browse files
committed
logger and minor changes
1 parent f73ab62 commit 0fa18cd

File tree

11 files changed

+1698
-44
lines changed

11 files changed

+1698
-44
lines changed

README.md

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,26 @@ The goal of this project is to automate the process of obtaining weather data, a
1010

1111
## Key Features
1212

13-
- **Automated Data Collection**: A GitHub Action periodically collects weather data from the [wttr.in](https://github.com/chubin/wttr.in) api and stores it in the `data` branch of this repository.v
13+
- **Automated Data Collection**: A GitHub Action periodically collects weather data from the [wttr.in](https://github.com/chubin/wttr.in) api and stores it in the `data` branch of this repository.
1414
- **AI-based Weather Forecasting**: The collected data is used to train a machine learning model, which predicts future weather conditions.
1515
- **Organized Data Management**: The `main` branch contains the core code, while the `data` branch stores all the weather data, keeping the repository clean and efficient.
1616
- **Customizable Workflow**: The project is designed to be flexible and easily customizable to suit different weather APIs, data analysis methods, and machine learning models.
1717

1818
## How It Works
19+
1920
### GitHub Actions Workflow
2021
1. **Data Collection**: The [`action.yml`](.github/workflows/collect_weather_data.yml) is triggered every one hour. It performs the following steps:
2122

2223
- Checks out the main branch to run the Python script for collecting weather data.
2324
- Checks out the data branch to store the collected data.
24-
- Commits and pushes the new data to the data branch.
25-
2. **Data Analysis and Forecasting**: `still in development...`
25+
- Commits and pushes the updated database to the data branch.
26+
2. **Data Analysis and Forecasting**:
27+
28+
`still in development...`
2629
<!-- An optional GitHub Action (examine-data.yml) can be set up to analyze the data and generate weather forecasts based on the collected data. -->
27-
28-
## Next Features
29-
30-
1. **Garbage Collector**: A procedure for evaluating data after it has been collected, to avoid data duplications
30+
3. **Forecasting Website**: a static website for weather forecasts using GitHub Pages
31+
32+
`still in development...`
3133

3234
## Repository Structure
3335

@@ -58,11 +60,8 @@ The goal of this project is to automate the process of obtaining weather data, a
5860
#### Data Branch
5961

6062
```python
61-
├── collected/ # The folder containing all the data collected up to now, saved in folders, and divided by city
62-
│ ├── YYYY--MM-DD_hh-mm-ss/
63-
| ├── New York.json # An example file containing data in json format
64-
| ...
65-
...
63+
├───...
64+
└───database.db # Database containing all the weather data collected by the GitHub Actions
6665
```
6766

6867
## Setup Instructions
@@ -76,12 +75,11 @@ The goal of this project is to automate the process of obtaining weather data, a
7675
1. **Clone the repository:**
7776

7877
```bash
79-
git clone GitGinocchio/weather-prediction-with-github-actions.git
80-
cd weather-prediction-with-github-actions
78+
git clone GitGinocchio/WeatherPredictionWithGithubActions.git
79+
cd WeatherPredictionWithGithubActions
8180
```
8281

8382
2. **Install dependencies:**
84-
8583
```bash
8684
pip install -r action-requirements.txt
8785
pip install -r dev-requirements.txt
@@ -98,7 +96,7 @@ The goal of this project is to automate the process of obtaining weather data, a
9896

9997
to run the data collection script locally:
10098
```bash
101-
python src/actions/collect_weather_data.py
99+
python src/collect_weather_data.py
102100
```
103101
#### Data Storage
104102

config/database.sql

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,14 @@ BEGIN;
22

33
CREATE TABLE IF NOT EXISTS info (
44
lastUpdate DATETIME PRIMARY KEY,
5-
numReports BIGINT,
6-
numDailies BIGINT,
7-
numHourly BIGINT
5+
6+
numNewReports INT,
7+
numNewDailies INT,
8+
numNewHourlies INT,
9+
10+
numTotalReports BIGINT,
11+
numTotalDailies BIGINT,
12+
numTotalHourlies BIGINT
813
);
914

1015
CREATE TABLE IF NOT EXISTS weather (

notes.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
? Eliminare il branch data e utilizzare solo il branch main con il database nel branch main
33
- Creare un sistema di backup automatico del database
44
- !! Convertire tutte le date in formato UTC
5-
- ! Creare un pool di esecuzione su diversi branch per ottenere i dati meteo in modo parallelo
5+
- ! Creare un pool di esecuzione su diversi branch per ottenere i dati meteo in modo parallelo
6+
- !!! Convertire tutte le date rimanenti relative alla luna e al sole in formato numerico

0 commit comments

Comments
 (0)