-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Minor refactor to accommodate sample weighting csv generation.
- Loading branch information
Showing
4 changed files
with
25 additions
and
7 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from forecast import fetch_and_clean_data | ||
from weights import apply_weights_simple | ||
|
||
|
||
OUTPUT_FILEPATH = "./tmp/sample.csv" | ||
|
||
|
||
def generate_csv_sample() -> None: | ||
# Generate a sample csv file that can be ingested by the weighting algorithm. | ||
forecasts = fetch_and_clean_data() | ||
single_forecast = {"012": forecasts["012"]} | ||
weighted_forecast = apply_weights_simple(single_forecast) | ||
|
||
weighted_forecast["012"].to_csv(OUTPUT_FILEPATH, columns=["y", "x", "latitude", "longitude", "weight"], index=False) | ||
|
||
|
||
if __name__ == "__main__": | ||
generate_csv_sample() |
This file contains 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