Skip to content

Commit

Permalink
Data entry redux (#475)
Browse files Browse the repository at this point in the history
* FilteredDataEntry will now create its own computed column and use that for values

* let JASP handle the computed column part

* also update bayesian workflow

* use checking if column exists field
  • Loading branch information
JorisGoosen authored Oct 10, 2024
1 parent 78715be commit 8620771
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
8 changes: 1 addition & 7 deletions R/auditCommonFunctions.R
Original file line number Diff line number Diff line change
Expand Up @@ -296,18 +296,12 @@
sampleFilter <- numeric(selectionState[["N.items"]])
rowNumber <- as.numeric(sample[["row"]])
sampleFilter[rowNumber] <- as.numeric(sample[["times"]])
auditDataVariable <- rep(NA, selectionState[["N.items"]])
auditDataVariable[options[["performAudit"]][[1]]$rowIndices] <- options[["performAudit"]][[1]]$values


if (is.null(jaspResults[["indicator_col"]])) {
jaspResults[["indicator_col"]] <- createJaspColumn(columnName = options[["indicator_col"]], dependencies = "indicator_col")
}
if (is.null(jaspResults[["variable_col"]])) {
jaspResults[["variable_col"]] <- createJaspColumn(columnName = options[["variable_col"]], dependencies = "variable_col")
}

jaspResults[["indicator_col"]]$setOrdinal(sampleFilter)
jaspResults[["variable_col"]]$setScale(auditDataVariable)
}
}

Expand Down
8 changes: 6 additions & 2 deletions inst/qml/auditBayesianWorkflow.qml
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,12 @@ Form
pasteVariables.checked = true
performAuditTable.colName = names.variable_name
performAuditTable.extraCol = names.indicator_name
values.count > 0 && critical.use_negative && critical.use_inspect ? performAuditTable.filter = names.indicator_name + " > 0" + " | " + critical.use_name + " > 0" : performAuditTable.filter = names.indicator_name + " > 0"

if(values.count > 0 && critical.use_negative && critical.use_inspect)
performAuditTable.filter = names.indicator_name + " > 0" + " | " + critical.use_name + " > 0"
else
performAuditTable.filter = names.indicator_name + " > 0"

performAuditTable.initialValuesSource = annotation.use_values ? "values" : ""
}
}
Expand Down Expand Up @@ -315,7 +320,6 @@ Form
Layout.fillWidth: true
modelType: JASP.FilteredDataEntryModel
source: ["id", "values", "variables"]
colName: "Filter"
defaultValue: 0
decimals: 10
Layout.preferredHeight: 500 * preferencesModel.uiScale
Expand Down
8 changes: 6 additions & 2 deletions inst/qml/auditClassicalWorkflow.qml
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,12 @@ Form
pasteVariables.checked = true
performAuditTable.colName = names.variable_name
performAuditTable.extraCol = names.indicator_name
values.count > 0 && critical.use_negative && critical.use_inspect ? performAuditTable.filter = names.indicator_name + " > 0" + " | " + critical.use_name + " > 0" : performAuditTable.filter = names.indicator_name + " > 0"

if(values.count > 0 && critical.use_negative && critical.use_inspect)
performAuditTable.filter = names.indicator_name + " > 0" + " | " + critical.use_name + " > 0"
else
performAuditTable.filter = names.indicator_name + " > 0"

performAuditTable.initialValuesSource = annotation.use_values ? "values" : ""
}
}
Expand Down Expand Up @@ -306,7 +311,6 @@ Form
Layout.fillWidth: true
modelType: JASP.FilteredDataEntryModel
source: ["id", "values", "variables"]
colName: "Filter"
defaultValue: 0
decimals: 10
Layout.preferredHeight: 500 * preferencesModel.uiScale
Expand Down
3 changes: 2 additions & 1 deletion inst/qml/common/evaluation/AddVariables.qml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,13 @@ Group
value: qsTr("selected")
}

ComputedColumnField
CheckColumnIsFreeOrMineField
{
id: variable_col
name: "variable_col"
text: qsTr("Column name audit result")
fieldWidth: 120 * preferencesModel.uiScale
value: qsTr("auditResult")

}
}

0 comments on commit 8620771

Please sign in to comment.