Skip to content

Commit

Permalink
minor doc update
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafnuss committed Feb 22, 2024
1 parent 8b18644 commit c994301
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 28 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@ biocViews:
Config/testthat/edition: 3
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.0
RoxygenNote: 7.3.1
Language: en-GB
2 changes: 1 addition & 1 deletion R/geopressure_map_likelihood.R
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ geopressure_map_likelihood <- function(tag,

# remove mse maps computed by geopressure_map_mismatch()
if (!keep_mse) {
tag[names(tag) %in% c("map_pressure_mse", "map_pressure_mask")] <- NULL
tag[names(tag) == "map_pressure_mse"] <- NULL
tag$stap <- tag$stap[names(tag$stap) != "nb_sample"]
}

Expand Down
2 changes: 1 addition & 1 deletion R/geopressure_map_preprocess.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ geopressure_map_preprocess <- function(tag, compute_known = FALSE) {
))
id <- pressure$stap_id == 0
sequence <- seq_len(nrow(pressure))
pressure$stap_id[id] <- approx(sequence[!id], pressure$stap_id[!id], sequence[id])$y
pressure$stap_id[id] <- stats::approx(sequence[!id], pressure$stap_id[!id], sequence[id])$y
}

if (nrow(pressure) < 3) {
Expand Down
2 changes: 1 addition & 1 deletion R/pressurepath_create.R
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
#' ](https://doi.org/10.24381/cds.adbb2d47), `"land"` [doc](https://doi.org/10.24381/cds.e2161bac)
#' or `"both"`. LAND has greater precision but is not available on water. Using a single one makes
#' the query faster.
#' @param preprocess logical to use `geopressure_map_preprocess`.
#' @param preprocess logical to pre-process pressure data with `geopressure_map_preprocess()`.
#' @param quiet logical to hide messages about the progress
#' @param workers number of parallel requests on GEE. Integer between 1 and 99.
#' @param debug logical to display additional information to debug a request
Expand Down
16 changes: 10 additions & 6 deletions R/print.tag.R
Original file line number Diff line number Diff line change
Expand Up @@ -76,21 +76,25 @@ print.tag <- function(x, ...) {
"*" = "Dimensions (lat x lon): {.val {geo$dim[1]}} x {.val {geo$dim[2]}} (res. \\
{.val {1/tag$param$scale}}\u00b0)"
))
fun_map <- "geopressure_map"
if ("map_pressure_mse" %in% status) {
map_pressure_mismatch <- c("map_pressure_mse", "map_pressure_mask")
map_pressure_mismatch <- map_pressure_mismatch[map_pressure_mismatch %in% names(tag)]

map_pressure_mismatch <- c("map_pressure_mse", "map_pressure_mask")
map_pressure_mismatch <- map_pressure_mismatch[map_pressure_mismatch %in% names(tag)]
if (length(map_pressure_mismatch) > 0) {
cli::cli_bullets(c(
"v" = "Pressure mismatch {.field {map_pressure_mismatch}} computed."
"v" = "Pressure mismatch {.field {map_pressure_mismatch}} available."
))
fun_map <- "geopressure_map_likelihood"
}
# nolint end
if ("map_pressure" %in% status) {
cli::cli_bullets(c(
"v" = "Pressure likelihood {.field map_pressure} computed!"
))
} else {
if ("map_pressure_mse" %in% names(tag)){

Check warning on line 93 in R/print.tag.R

View workflow job for this annotation

GitHub Actions / lint

file=R/print.tag.R,line=93,col=50,[brace_linter] There should be a space before an opening curly brace.

Check warning on line 93 in R/print.tag.R

View workflow job for this annotation

GitHub Actions / lint

file=R/print.tag.R,line=93,col=50,[paren_body_linter] There should be a space between a right parenthesis and a body expression.
fun_map <- "geopressure_map_likelihood"

Check warning on line 94 in R/print.tag.R

View workflow job for this annotation

GitHub Actions / lint

file=R/print.tag.R,line=94,col=13,[object_usage_linter] local variable 'fun_map' assigned but may not be used
} else {
fun_map <- "geopressure_map"
}
cli::cli_bullets(c(
"x" = "No pressure likelihood computed yet. Use {.fun {fun_map}}."
))
Expand Down
11 changes: 7 additions & 4 deletions R/tag_label_stap.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@
#'
#' @description
#' This function computes the stationary periods from the pressure and/or acceleration label data.
#' In most case, this function should be run directly after `tag_label_read()` in order to update
#' `tag` to correspond to the new label file.
#'
#' A stationary period is a period during which the bird is considered static relative to the
#' spatial resolution of interest (~10-50km). They are defined by being separated by a flight of any
#' duration (label `"flight"`). The `stap_id` is an integer value for stationary periods and decimal
#' value for flight. The `stap_id` is added as a new column to each sensor data.
#'
#' If an acceleration data.frame is present and contains a column `label`, the stationary period
#' will be computed from it, otherwise, it uses the pressure data.frame.
#'
#' Stationary periods are defined by being separated by a flight (label `"flight"`). Flights of any
#' duration will be considered.
#'
#' The function also adds the corresponding `stap_id` column to each sensor data.
#'
#' @inheritParams tag_label
#' @param warning_flight_duration Threshold of flight duration to display warning for (hours)
Expand Down
2 changes: 1 addition & 1 deletion man/pressurepath_create.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/tag_label_auto.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/tag_label_read.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 9 additions & 7 deletions man/tag_label_stap.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/tag_label_write.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c994301

Please sign in to comment.