Skip to content

Commit

Permalink
Merge pull request #106 from IOHprofiler/v1.7.4
Browse files Browse the repository at this point in the history
V1.7.4
  • Loading branch information
Dvermetten authored Jun 28, 2023
2 parents 43711c9 + 6bbd9d5 commit 0ce9079
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 54 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: IOHanalyzer
Type: Package
Title: Data Analysis Part of 'IOHprofiler'
Version: 0.1.7.1
Version: 0.1.7.4
Maintainer: Diederick Vermetten <d.l.vermetten@liacs.leidenuniv.nl>
Authors@R: c(
person("Hao", "Wang", email = "h.wang@liacs.leidenuniv.nl", role = "aut", comment = c(ORCID = "0000-0002-4933-5181")),
Expand Down
3 changes: 3 additions & 0 deletions R/DataSet.R
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,9 @@ DataSet <- function(info, verbose = F, maximization = NULL, format = IOHprofiler
else {
attr(temp, 'contains_full_FV') <- FALSE
}
if (getOption('IOHanalyzer.function_representation', 'funcId') == 'funcName') {
attr(temp, 'funcId') <- attr(temp, 'funcName')
}
return(temp)
}
else
Expand Down
4 changes: 2 additions & 2 deletions R/DataSetList.R
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ DataSetList <- function(path = NULL, verbose = T, print_fun = NULL, maximization
}

copy_flag <- TRUE
if (isTRUE(info$version >= "0.3.3")) {
if (ifelse(is.null(info$version), F, (compareVersion(info$version, "0.3.3") >= 0))) {
tryCatch(
data <- read_IOH_v1plus(info),
error = function(e) {
Expand All @@ -125,7 +125,7 @@ DataSetList <- function(path = NULL, verbose = T, print_fun = NULL, maximization
format = format, subsampling = subsampling)
}
DIM[i] <- attr(data, 'DIM')
funcId[i] <- attr(data, 'funcId')
funcId[i] <- attr(data, getOption('IOHanalyzer.function_representation', 'funcId'))
algId[i] <- attr(data, 'algId')

# TODO: double-check the following treatment on `instance`!!!
Expand Down
9 changes: 7 additions & 2 deletions R/readFiles.R
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,9 @@ check_format <- function(path) {
return(SOS)

info <- unlist(lapply(index_files, read_index_file), recursive = F)
if (all(unlist(lapply(info, function(x) isTRUE(x$version >="0.3.3"))))) {
if (all(unlist(lapply(info, function(x) {
return (ifelse(is.null(x$version), F, (compareVersion(x$version, "0.3.3") >= 0)))
})))) {
return(IOHprofiler)
}

Expand Down Expand Up @@ -1341,7 +1343,7 @@ read_IOH_v1plus <- function(info, full_sampling = FALSE){

algId <- info$algId
DIM <- info$dim
funcId <- info$funcId
funcId <- attr(info, getOption('IOHanalyzer.function_representation', 'funcId'))

if (impute_evalnrs) {
data$evaluations <- ave(data$raw_y, data$runnr, FUN = seq_along)
Expand Down Expand Up @@ -1389,6 +1391,9 @@ read_IOH_v1plus <- function(info, full_sampling = FALSE){
c(info, list(maxRT = max(runtimes), finalFV = min(FV), format = IOHprofiler,
ID = info$algId))
)
if (getOption('IOHanalyzer.function_representation', 'funcId') == 'funcName') {
attr(ds, 'funcId') <- attr(ds, 'funcName')
}


if (full_sampling || 'violation' %in% info$attributes) {
Expand Down
4 changes: 2 additions & 2 deletions R/stats.R
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@ seq_FV <- function(FV, from = NULL, to = NULL, by = NULL, length.out = NULL, sca
rev_trans <- function(x) 10 ^ x
# TODO: Better way to deal with negative values
# set lowest possible target globally instead of arbitrary 1e-12
from <- max(1e-12, from)
to <- max(1e-12 ,to)
from <- max(1e-12, from[from>0])
to <- max(1e-12 ,to[to>0])
from <- trans(from)
to <- trans(to)
}
Expand Down
6 changes: 1 addition & 5 deletions inst/shiny-server/server/settings_page.R
Original file line number Diff line number Diff line change
Expand Up @@ -204,13 +204,9 @@ observe({

observe({
if (input$Settings.Use_Funcname) {
shinyjs::show(id = "overall_funcname_box")
shinyjs::hide(id = "overall_funcid_box")
options('IOHanalyzer.function_representation' = 'funcname')
options('IOHanalyzer.function_representation' = 'funcName')
}
else {
shinyjs::hide(id = "overall_funcname_box")
shinyjs::show(id = "overall_funcid_box")
options('IOHanalyzer.function_representation' = 'funcId')
}
})
Expand Down
36 changes: 9 additions & 27 deletions inst/shiny-server/server/upload.R
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,13 @@ observeEvent(input$repository.load_button, {
} else {
temp_data <- change_id(data, 'algId')
}

if (getOption('IOHanalyzer.function_representation', 'funcId') == 'funcName') {
for (ds in temp_data){
attr(ds, 'funcId') <- attr(ds, 'funcName')
}
}

# DataList$data <- change_id(DataList$data, getOption("IOHanalyzer.ID_vars", c("algId")))
update_menu_visibility(attr(temp_data, 'suite'))
# set_format_func(attr(DataList$data, 'suite'))
Expand Down Expand Up @@ -383,10 +390,6 @@ update_menu_visibility <- function(suite){
else {
session$sendCustomMessage(type = "manipulateMenuItem", message = list(action = "hide", tabName = "Positions"))
}
if (!is.null(get_funcName(DataList$data)))
shinyjs::enable("Settings.Use_Funcname")
else
shinyjs::disable("Settings.Use_Funcname")
}

observeEvent(input$Upload.Add_to_repo, {
Expand Down Expand Up @@ -420,7 +423,6 @@ observeEvent(input$upload.remove_data, {

updateSelectInput(session, 'Overall.Dim', choices = c(), selected = '')
updateSelectInput(session, 'Overall.Funcid', choices = c(), selected = '')
updateSelectInput(session, 'Overall.Funcname', choices = c(), selected = '')
updateSelectInput(session, 'Overall.ID', choices = c(), selected = '')

print_html('<p style="color:red;">all data are removed!</p>')
Expand Down Expand Up @@ -465,8 +467,6 @@ observe({

updateSelectInput(session, 'Overall.Dim', choices = DIMs, selected = selected_dim)
updateSelectInput(session, 'Overall.Funcid', choices = funcIds, selected = selected_f)
if (input$Settings.Use_Funcname)
updateSelectInput(session, 'Overall.Funcname', choices = get_funcName(data), selected = get_funcName(data[1]))

if ('algId' %in% input$Settings.ID.Variables)
updateSelectInput(session, 'Overall.ID', choices = NULL, selected = NULL)
Expand Down Expand Up @@ -608,14 +608,10 @@ DATA <- reactive({
if (!is.null(algid)) d <- subset(d, algId == algid)
}

if (input$Settings.Use_Funcname) {
fname <- input$Overall.Funcname
if (!is.null(fname)) d <- subset(d, funcname == fname)
}
else {

fid <- input$Overall.Funcid
if (!is.null(fid)) d <- subset(d, funcId == fid)
}


if (length(DataList$data) == 0) return(NULL)

Expand All @@ -630,20 +626,6 @@ DATA_RAW <- reactive({
DataList$data
})

# This observe statement tries to match funcid and funcname seletions so funcId can still be used internally.
# TODO: think of a better solution to ensure this matching doesn't break.
observe({
req(length(DATA_RAW()) > 0)
fname <- input$Overall.Funcname
req(fname)
req(getOption('IOHanalyzer.function_representation', 'funcId') == 'funcname')
dsl_sub <- subset(DATA_RAW(), funcName == fname)
fids <- get_funcId(dsl_sub)
if (length(fids) == 1) {
updateSelectInput(session, 'Overall.Funcid', selected = fids)
}
})

MAX_ERTS_FUNC <- reactive({
dim <- input$Overall.Dim
data <- subset(DataList$data, DIM == dim)
Expand Down
12 changes: 0 additions & 12 deletions inst/shiny-server/ui/DIM_fID_panel.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,6 @@ DIM_fID_panel <- function() {
)
)
),
div(id = 'overall_funcname_box',
# style = "padding: 0px 0px; margin-top:-5em; margin:0%",
fluidRow(
column(
width = 11,
selectInput(
"Overall.Funcname",
label = HTML('<p style="font-size:90%;">Function Name:</p>'),
choices = NULL, selected = NULL)
)
)
),
div(
# style = "padding: 0px 0px; margin-top:-50em;",
fluidRow(
Expand Down
2 changes: 1 addition & 1 deletion man/get_dsc_omnibus.Rd

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

2 changes: 1 addition & 1 deletion man/get_dsc_posthoc.Rd

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

2 changes: 1 addition & 1 deletion man/get_dsc_rank.Rd

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

0 comments on commit 0ce9079

Please sign in to comment.