Skip to content

Commit

Permalink
Merge pull request #309 from madgik/dev/518/formula
Browse files Browse the repository at this point in the history
Dev/518/formula
  • Loading branch information
ThanKarab authored Dec 21, 2021
2 parents bf2fc7a + b42b006 commit c0d92f7
Show file tree
Hide file tree
Showing 42 changed files with 8,853 additions and 7,077 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,8 @@ private static void validateAlgorithmParameterValueType(
ParameterProperties parameterProperties
) throws AlgorithmException, BadUserInputException {
if (parameterProperties.getValueType().equals(ParameterProperties.ParameterValueType.json)) {
if (value.equals(""))
return;
try {
new JSONObject(value);
} catch (JSONException ex) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public class ParameterProperties {
public enum ParameterType {
column, // used for selecting specific columns from the database
formula, // used for parsing the input as a formula of R, '+ - * : 0' are allowed.
formula_description, // used for providing a formula description to the algorithm in json format
filter, // used for filtering on the database input
dataset, // used for choosing database input
pathology, // used for specifying what database to use
Expand All @@ -33,7 +34,6 @@ public enum ParameterValueType {
real,
json
}

public ParameterProperties() {
}

Expand All @@ -50,13 +50,15 @@ public void validateParameterPropertiesInitialization(String algorithmName) thro
if (type == null) {
throw new AlgorithmException(algorithmName, "The parameter field 'type' was not initialized in the properties.json file.");
} else if (type.equals(ParameterType.column) || type.equals(ParameterType.formula)) {
if (columnValuesSQLType == null) {
}

if (columnValuesIsCategorical == null) {
throw new AlgorithmException(algorithmName, "The parameter field 'columnValuesIsCategorical' was not initialized in the properties.json file.");
}
} else if (valueType.equals(ParameterValueType.json)){
}else if (type.equals(ParameterType.formula_description)) {
if (!valueType.equals(ParameterValueType.json)) {
throw new AlgorithmException(algorithmName, "The parameter field 'valueType' must be json since the 'type' is formula_description.");
}
}
if (valueType.equals(ParameterValueType.json)){
if(valueMultiple) {
throw new AlgorithmException(algorithmName, "The parameter field 'valueMultiple' cannot be true because the 'valueType' is json.");
}
Expand Down
2 changes: 1 addition & 1 deletion Exareme-Docker/src/mip-algorithms/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

# db files
*.db
# !mipframework/runner/dbs/datasets.db
!mipframework/runner/dbs/datasets.db
# !mipframework/runner/dbs/1LocalDBs/local_dataset0.db
# !mipframework/runner/dbs/10LocalDBs/local_dataset0.db
# !mipframework/runner/dbs/10LocalDBs/local_dataset1.db
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from descriptive_stats import DescriptiveStats
from .descriptive_stats import DescriptiveStats

__all__ = ["DescriptiveStats"]
Loading

0 comments on commit c0d92f7

Please sign in to comment.