Skip to content

Test validity of IMEI installs over time #31

@efcaguab

Description

@efcaguab

pt_validate_vms_installs() used to check that an IMEI was uniquely associated with a single boat. However, it later became evident that some devices were moved between boats, particularly early in the installation period. Consequently, this test (see code below) was deactivated.

v <- vms_installs_table %>%
    dplyr::mutate(device_event_date = lubridate::as_date(.data$device_event_date),
                  createdTime = lubridate::ymd_hms(.data$createdTime),
                  created_date = lubridate::as_date(.data$created_date))

ok_boat_installs <- v %>%
    dplyr::group_by(.data$device_imei) %>%
    dplyr::summarise(n_boats = dplyr::n_distinct(.data$boat_id),
                     .groups = "drop")
  if (any(ok_boat_installs$n_boats > 1))
    stop("detected a vms device in more than one boat")

A new test is needed where the consistency of devices and boats is still validated. The test needs to acknowledge that IMEIS can be associated to multiple boats but not at the same time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions