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

get_receivers() no longer returns unique receiver_id #251

Open
peterdesmet opened this issue Sep 14, 2022 · 4 comments
Open

get_receivers() no longer returns unique receiver_id #251

peterdesmet opened this issue Sep 14, 2022 · 4 comments
Assignees
Labels
database Related to ETN database question Further information is requested

Comments

@peterdesmet
Copy link
Member

get_receivers() used to return rows with a unique receiver_id(). That is no longer the case:

library(etn)
library(dplyr)
#> 
#> Attaching package: 'dplyr'
con <- connect_to_etn()
df <- get_acoustic_receivers(con)
df %>% group_by(receiver_id) %>% filter(n() > 1)
#> # A tibble: 1,048 × 23
#> # Groups:   receiver_id [448]
#>    receiver_id manufacturer receiver_model receiver_serial… modem_address status
#>    <chr>       <chr>        <chr>          <chr>            <chr>         <chr> 
#>  1 TBR700-1166 THELMA BIOT… TBR700         1166             <NA>          <NA>  
#>  2 TBR700-1166 VEMCO        TBR700         1166             <NA>          avail…
#>  3 TBR700-1167 THELMA BIOT… TBR700         1167             <NA>          <NA>  
#>  4 TBR700-1167 VEMCO        TBR700         1167             <NA>          avail…
#>  5 TBR700-1173 THELMA BIOT… TBR700         1173             <NA>          <NA>  
#>  6 TBR700-1173 VEMCO        TBR700         1173             <NA>          avail…
#>  7 TBR700-1305 THELMA BIOT… TBR700         1305             <NA>          <NA>  
#>  8 TBR700-1305 VEMCO        TBR700         1305             <NA>          avail…
#>  9 TBR700-1312 THELMA BIOT… TBR700         1312             <NA>          <NA>  
#> 10 TBR700-1312 VEMCO        TBR700         1312             <NA>          avail…
#> # … with 1,038 more rows, and 17 more variables: battery_estimated_life <chr>,
#> #   owner_organization <chr>, financing_project <chr>,
#> #   built_in_acoustic_tag_id <chr>, ar_model <chr>, ar_serial_number <chr>,
#> #   ar_battery_estimated_life <chr>, ar_voltage_at_deploy <chr>,
#> #   ar_interrogate_code <chr>, ar_receive_frequency <chr>,
#> #   ar_reply_frequency <chr>, ar_ping_rate <chr>, ar_enable_code_address <chr>,
#> #   ar_release_code <chr>, ar_disable_code <chr>, ar_tilt_code <chr>, …

Created on 2022-09-14 by the reprex package (v2.0.0)

@aubrivliz @jreubens is this no longer expected? Doesn't this affect how detections can then be connected to the correct receiver (location)?

@peterdesmet peterdesmet added question Further information is requested database Related to ETN database labels Sep 14, 2022
@aubrivliz
Copy link
Collaborator

This was a mistake. I've added "id" back to the view.

@peterdesmet
Copy link
Member Author

@PietrH can you verify this issue and close if solved?

@PietrH
Copy link
Member

PietrH commented Jan 2, 2023

Seems ok to me!

library(etn)
library(dplyr)
> df <- get_acoustic_receivers(connect_to_etn())
> df %>% filter(duplicated(.))
# A tibble: 0 × 23
# … with 23 variables: receiver_id <chr>, manufacturer <chr>, receiver_model <chr>,
#   receiver_serial_number <chr>, modem_address <chr>, status <chr>, battery_estimated_life <chr>,
#   owner_organization <chr>, financing_project <chr>, built_in_acoustic_tag_id <chr>, ar_model <chr>,
#   ar_serial_number <chr>, ar_battery_estimated_life <chr>, ar_voltage_at_deploy <chr>,
#   ar_interrogate_code <chr>, ar_receive_frequency <chr>, ar_reply_frequency <chr>, ar_ping_rate <chr>,
#   ar_enable_code_address <chr>, ar_release_code <chr>, ar_disable_code <chr>, ar_tilt_code <chr>,
#   ar_tilt_after_deploy <chr>
# ℹ Use `colnames()` to see all variable names

@PietrH PietrH closed this as completed Jan 2, 2023
@peterdesmet
Copy link
Member Author

Thanks for testing, can you re-enable this test:

# TODO: re-enable after https://github.com/inbo/etn/issues/251
# test_that("get_acoustic_receivers() returns unique receiver_id", {
# df <- get_acoustic_receivers(con)
# expect_equal(nrow(df), nrow(df %>% distinct(receiver_id)))
# })

@peterdesmet peterdesmet reopened this Jan 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
database Related to ETN database question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants