Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: improve error message for not yet archived historical weather #188

Merged
merged 4 commits into from
Oct 20, 2023

Conversation

ttytm
Copy link
Owner

@ttytm ttytm commented Jul 23, 2023

An improved error message for historical weather data that is not yet available in open-meteo's archives.

Resolves #135

@github-actions
Copy link

github-actions bot commented Jul 23, 2023

Filename                              Stmts    Miss  Cover    Missing
----------------------------------  -------  ------  -------  ------------------------------------------------------------
src/modules/display/border.rs            47      47  0.00%    17-106
src/modules/display/current.rs          124     124  0.00%    37-243
src/modules/display/day.rs               92      92  0.00%    29-164
src/modules/display/graph.rs            175     170  2.86%    65-368
src/modules/display/gui_config.rs        15      12  20.00%   46-61
src/modules/display/historical.rs        98      98  0.00%    35-201
src/modules/display/hourly.rs           211     211  0.00%    40-396
src/modules/display/product.rs           21      21  0.00%    24-64
src/modules/display/utils.rs             46      46  0.00%    6-85
src/modules/display/weathercode.rs       34      34  0.00%    11-46
src/modules/display/week.rs              68      68  0.00%    30-137
src/modules/display/wind.rs              22      22  0.00%    17-42
src/modules/api.rs                       24      13  45.83%   26-29, 38, 49-88
src/modules/args.rs                       4       4  0.00%    91-95
src/modules/config.rs                    32      26  18.75%   52-97
src/modules/forecast.rs                  20       6  70.00%   7-8, 24-25, 27-28
src/modules/localization.rs             108      44  59.26%   162-203, 230-265
src/modules/location.rs                  55      28  49.09%   25-29, 59-63, 75, 89, 95-104, 109, 118-126, 131-132, 142-143
src/modules/params.rs                    67      67  0.00%    24-137
src/modules/units.rs                     13       0  100.00%
src/modules/weather.rs                   28      28  0.00%    83-154
src/main.rs                              17      17  0.00%    26-49
TOTAL                                  1321    1178  10.83%

@github-actions
Copy link

github-actions bot commented Jul 23, 2023

Test Results

  3 files  ±0    3 suites  ±0   3s ⏱️ ±0s
  9 tests ±0    9 ✔️ ±0  0 💤 ±0  0 ±0 
27 runs  ±0  27 ✔️ ±0  0 💤 ±0  0 ±0 

Results for commit ace2bd7. ± Comparison against base commit e404f13.

♻️ This comment has been updated with latest results.

Copy link
Collaborator

@kevinmatthes kevinmatthes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your work on this, @tobealive! I had a look on your changes and found two minor issues which might need to be adjusted.

src/modules/weather.rs Outdated Show resolved Hide resolved
src/modules/weather.rs Outdated Show resolved Hide resolved
@ttytm
Copy link
Owner Author

ttytm commented Jul 26, 2023

Thank you @kevinmatthes
I'm gonna add a test case before merging to follow a good practice here.

@ttytm ttytm force-pushed the main branch 3 times, most recently from 42e3f7d to 67bffd2 Compare August 13, 2023 23:26
@ttytm ttytm force-pushed the main branch 2 times, most recently from 664c406 to 42c698f Compare September 12, 2023 15:47
@ttytm ttytm force-pushed the fix/historical-temp-unavail-error branch from 9fc2d11 to ace2bd7 Compare October 20, 2023 13:01
@ttytm
Copy link
Owner Author

ttytm commented Oct 20, 2023

Now it just became an different API request if the requested date is younger than 5 days, instead additionally needing to check for null values. I would therefore merge this without adding a test for this function.

@ttytm ttytm merged commit c8c5f1d into main Oct 20, 2023
13 checks passed
@ttytm ttytm deleted the fix/historical-temp-unavail-error branch October 20, 2023 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug Report] Historical Data not Available
2 participants