Feat: Add free weather module using Meteostat (and fix dependencies)#49
Merged
harshitaphadtare merged 1 commit intoharshitaphadtare:mainfrom Oct 24, 2025
Conversation
✅ Deploy Preview for gopredict ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for storied-fudge-a7595c canceled.
|
Contributor
Author
|
@harshitaphadtareI have made a PR please read the description for a full breakdown of the changes and testing instructions. |
Contributor
Author
|
@harshitaphadtare Please reply! |
Owner
|
hey @AyushAnand413 sorry for the delay. loved the way you implemented it! Thankyou for contributing :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes: #47
This PR adds a new, independent feature for fetching rich historical weather data using the free Meteostat library. This solves the core problem of relying on a limited, static
precipitation.csvfile.This PR is purely additive and does not change the existing training pipeline. It also fixes critical bugs in the project's setup.
Changes Made
src/features/weather_api.py- A new module with a functionget_weather_for_trip()to get weather for a single, specific time and location.src/get_historical_weather.py- A bulk-download script to get the entire 2016 weather dataset for NYC in one command, saving it todata/processed/historical_weather.csv.meteostattorequirements.txt.config.pyto include a new path for'historical_weather'in theDATA_PATHSdictionary.Testing
pnpm test)python src/features/weather_api.pySuccess! Received data: ...python src/get_historical_weather.pySuccess! Saved 4368 hourly records to data/processed/historical_weather.csvpython main.pyScreenshots
N/A. This is a backend data pipeline enhancement.
Checklist
.env.examplewith any new environment variables. (No .env file was needed).💡 How to Evolve the Model with This Data
This PR adds the tools to improve the model. To see the new results, the pipeline needs to be restructured as follows:
Get the Data:
First, run the new bulk-download script one time to create the
historical_weather.csvfile:Modify
src/feature_pipe.py:precipitation.csv.historical_weather.csv:Modify
config.py:FEATURE_COLUMNSdictionary.'precipitation'line.Re-Run and Compare:
Finally, run
python main.py. The pipeline will re-build the features and re-train the models. The new RMSE scores can then be compared to the old ones to see the improvement.