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

Handle new wind variables in API #40

Closed
Aariq opened this issue Feb 22, 2023 · 5 comments · Fixed by #52
Closed

Handle new wind variables in API #40

Aariq opened this issue Feb 22, 2023 · 5 comments · Fixed by #52
Labels
bug Something isn't working

Comments

@Aariq
Copy link
Member

Aariq commented Feb 22, 2023

While testing code in #39, I noticed it seems like there are some new columns in the hourly data on the API that are causing a couple tests to fail. I can modify code/tests accordingly, but are these new columns here to stay?

az_hourly() |> select(starts_with("wind_2")) |> colnames()
#[1] "wind_2min_spd_max_mph"  "wind_2min_spd_max_mps"  "wind_2min_spd_mean_mph"
#[4] "wind_2min_spd_mean_mps" "wind_2min_timestamp"    "wind_2min_vector_dir" 
@jeremylweiss
Copy link
Member

Nice catch! We just added "wind_2" data fields this afternoon to both hourly and daily data. These are permanent columns. We have yet to start updating the datalogger program at individual stations, so values right now in the database should be 'nodata' values.

This is good to know for any future addition of variables to the database.

@Aariq Aariq changed the title New wind variables in API? Handle new wind variables in API Jul 17, 2023
@Aariq
Copy link
Member Author

Aariq commented Jul 17, 2023

Looks like to handle these we'll need to

  1. Convert wind_2min_timestamp to a datetime (currently converted to NAs by as.numeric())
  2. Double-check that they are picked up by az_add_units()

@Aariq
Copy link
Member Author

Aariq commented Jul 17, 2023

This is where the warnings are coming from:

azmetr/R/az_daily.R

Lines 83 to 86 in 61582f9

dplyr::mutate(dplyr::across(
c(-"meta_station_id", -"meta_station_name", -"datetime"),
as.numeric
)) %>%

@Aariq Aariq added the bug Something isn't working label Jul 21, 2023
@jeremylweiss
Copy link
Member

jeremylweiss commented Jul 25, 2023

wind_2min_timestamp values now come in as type 'character'

@jeremylweiss
Copy link
Member

use of lubridate::with_tz() with your earlier code of lubridate::parse_date_time() seems to fix this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants