Skip to content

Commit

Permalink
Bug fix relating to a change in case for the saga_cmd outputs in v9.2…
Browse files Browse the repository at this point in the history
…. Now the "TYPE" column in the help files contains all lowercase descriptions, like 'grid, output' instead of sentence case. This fix coerces all TYPE entries to lowercase before tagging the `parameter` object with the type of the feature
  • Loading branch information
stevenpawley committed Oct 14, 2023
1 parent 5cb615f commit b2899e7
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions R/parameters.R
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ parameter <-

# parameter class attributes
param <- list(
type = type,
type = tolower(type),
name = name,
alias = identifier,
identifier = identifier,
Expand Down Expand Up @@ -186,63 +186,63 @@ parameter <-
param$io <- "Output"
}

if (stringr::str_detect(param$type, "Grid")) {
if (stringr::str_detect(param$type, "grid")) {
param$feature <- "Grid"
}

if (stringr::str_detect(param$type, "Grid list")) {
if (stringr::str_detect(param$type, "grid list")) {
param$feature <- "Grid list"
}

if (stringr::str_detect(param$type, "Shapes")) {
if (stringr::str_detect(param$type, "shapes")) {
param$feature <- "Shape"
}

if (stringr::str_detect(param$type, "Shapes list")) {
if (stringr::str_detect(param$type, "shapes list")) {
param$feature <- "Shapes list"
}

if (stringr::str_detect(param$type, "Table")) {
if (stringr::str_detect(param$type, "table")) {
param$feature <- "Table"
}

if (stringr::str_detect(param$type, "Static table")) {
if (stringr::str_detect(param$type, "static table")) {
param$feature <- "Table"
}

if (stringr::str_detect(param$type, "Table list")) {
if (stringr::str_detect(param$type, "table list")) {
param$feature <- "Table list"
}

if (stringr::str_detect(param$type, "File path")) {
if (stringr::str_detect(param$type, "file path")) {
param$feature <- "File path"
}

if (stringr::str_detect(param$type, "field")) {
param$feature <- "Table field"
}

if (stringr::str_detect(param$type, "Integer")) {
if (stringr::str_detect(param$type, "integer")) {
param$feature <- "Integer"
}

if (stringr::str_detect(param$type, "Choice")) {
if (stringr::str_detect(param$type, "choice")) {
param$feature <- "Choice"
}

if (stringr::str_detect(param$type, "Floating point")) {
if (stringr::str_detect(param$type, "floating point")) {
param$feature <- "numeric"
}

if (stringr::str_detect(param$type, "Boolean")) {
if (stringr::str_detect(param$type, "boolean")) {
param$feature <- "logical"
}

if (stringr::str_detect(param$type, "Long text")) {
if (stringr::str_detect(param$type, "long text")) {
param$feature <- "character"
}

if (stringr::str_detect(param$type, "Text")) {
if (stringr::str_detect(param$type, "text")) {
param$feature <- "character"
}

Expand Down

0 comments on commit b2899e7

Please sign in to comment.