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

keyword "i_row" does not seem to work #75

Open
stephancb opened this issue Jan 3, 2024 · 3 comments
Open

keyword "i_row" does not seem to work #75

stephancb opened this issue Jan 3, 2024 · 3 comments

Comments

@stephancb
Copy link

julia> show_current("Montreal", i_row=4)
ERROR: MethodError: no method matching show_current(::String; i_row::Int64)

Closest candidates are:
  show_current(::String, ::Int64) got unsupported keyword argument "i_row"
   @ WeatherReport ~/.julia/packages/WeatherReport/TBQPY/src/plots_forecast.jl:163
  show_current(::String) got unsupported keyword argument "i_row"
   @ WeatherReport ~/.julia/packages/WeatherReport/TBQPY/src/plots_forecast.jl:163

Stacktrace:
 [1] top-level scope
julia> show_current("Montreal")
[ Info: More than one match found, showing report for location in row 1.
[ Info: You can select another location by its row index.
4×4 DataFrame
 Row │ CITY      TIMEZONE         LATITUDE  LONGITUDE 
     │ String?   String31         Float64   Float64   
─────┼────────────────────────────────────────────────
   1 │ Montreal  America/Toronto   45.5088  -73.5878
   2 │ Montreal  Europe/Paris      43.9502    0.20217
   3 │ Montreal  Europe/Paris      43.1998    2.14122
   4 │ Montreal  America/Chicago   46.428   -90.246
┌─────────────────┬───────────┬────────────┬─────────────┬───────────┬─────────┬─────────┐
│        Timezone │ Elevation │ Wind speed │ Temperature │ Condition │      🌅 │      🌆 │
│           [EST] │       [m] │     [km/h] │        [°C] │        [] │ [hh:mm] │ [hh:mm] │
├─────────────────┼───────────┼────────────┼─────────────┼───────────┼─────────┼─────────┤
│ America/Toronto │     226.014.5-0.3 │  Overcast │   07:3416:22

and

help?> show_current
search: show_current

  show_current(city::String, i_row::Int64 = 1)


  Shows the current weather conditions for a given city.

  Arguments
  ≡≡≡≡≡≡≡≡≡

    •  city::String : Valid city name, e.g. "Oslo", "Paris", "Amsterdam" etc.

    •  i_row::Int64 : In case of more than one match for a given location, select the desired timezone by providing the row index from the printed DataFrame. Default is set to 1.
@vnegi10
Copy link
Owner

vnegi10 commented Jan 3, 2024

Hi @stephancb, i_row is not a keyword but a positional argument. I have listed keywords usually under the Optional Keywords section in the help text.

In your case, you should do the following:

julia> show_current("Montreal", 4)
[ Info: More than one match found, showing report for location in row 4.
[ Info: You can select another location by its row index.
4×4 DataFrame
 Row │ CITY      TIMEZONE         LATITUDE  LONGITUDE 
     │ String?   String31         Float64   Float64   
─────┼────────────────────────────────────────────────
   1 │ Montreal  America/Toronto   45.5088  -73.5878
   2 │ Montreal  Europe/Paris      43.9502    0.20217
   3 │ Montreal  Europe/Paris      43.1998    2.14122
   4 │ Montreal  America/Chicago   46.428   -90.246
┌─────────────────┬───────────┬────────────┬─────────────┬───────────┬─────────┬─────────┐
│        Timezone │ Elevation │ Wind speed │ Temperature │ Condition │      🌅 │      🌆 │
│           [CST] │       [m] │     [km/h] │        [°C] │        [] │ [hh:mm] │ [hh:mm] │
├─────────────────┼───────────┼────────────┼─────────────┼───────────┼─────────┼─────────┤
│ America/Chicago │     489.0 │       15.3 │        -4.6 │  Overcast │   07:44 │   16:26 │
└─────────────────┴───────────┴────────────┴─────────────┴───────────┴─────────┴─────────┘
[Weather data by Open-Meteo.com]

@stephancb
Copy link
Author

I see, thanks. Perhaps in the docstring ...the row index from the printed DataFrame... could be expanded to ...the row index from the printed DataFrame as the 2nd argument...?

@vnegi10
Copy link
Owner

vnegi10 commented Jan 4, 2024

Yes, that can easily be done. Maybe there are more locations where the description can be improved? Also, PRs are most welcome! 😃

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

No branches or pull requests

2 participants