Skip to content

Commit

Permalink
Added VCML conversion failure type in preparation for VCML processing
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeByDrescher committed Jan 29, 2025
1 parent f574f8d commit 44b082f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,6 @@ public enum FailureType {
UNSUPPORTED_DELAY_SBML,
UNSUPPORTED_NON_CONSTANT_COMPARTMENTS,
BIOMODEL_IMPORT_SEDML_FAILURE,
VCML_EXPORT_FAILURE,
TIMEOUT_ENCOUNTERED
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeoutException;
import java.util.stream.Collectors;

public class OmexTestingDatabase {
Expand All @@ -29,7 +30,8 @@ public enum TestCollection {
VCELL_BSTS_SYNTHS(TestDataRepo.vcell, "vcell-cli/src/test/resources/bsts-omex/synths"),
VCELL_SPATIAL(TestDataRepo.vcell, "vcell-cli/src/test/resources/spatial"),
SYSBIO_BIOMD(TestDataRepo.sysbio, "omex_files"),
VCELL_PUBLISHED(TestDataRepo.vcdb,"published/biomodel/omex/sbml");
VCELL_PUBLISHED_OMEX(TestDataRepo.vcdb,"published/biomodel/omex/sbml"),
VCELL_PUBLISHED_VCML(TestDataRepo.vcdb,"published/biomodel/vcml");

public final TestDataRepo repo;
public final String pathPrefix;
Expand Down Expand Up @@ -120,6 +122,9 @@ private static FailureType determineFault(TraceEvent traceEvent){
return (sbmlFailureType = determineFault(traceEvent.exception)) != null ? sbmlFailureType : FailureType.SBML_IMPORT_FAILURE;
}

if (traceEvent.message.contains("convert necessary file to sbml/sedml combine archive"))
return FailureType.VCML_EXPORT_FAILURE;

if (traceEvent.exception instanceof RuntimeException && traceEvent.message.contains("Failed execution")){
if (traceEvent.message.contains("divide by zero")) return FailureType.DIVIDE_BY_ZERO;
if (traceEvent.message.contains("infinite loop")) return FailureType.SOLVER_FAILURE;
Expand Down Expand Up @@ -147,7 +152,9 @@ private static FailureType determineFault(TraceEvent traceEvent){
private static FailureType determineFault(Exception caughtException){
String errorMessage = caughtException.getMessage();

if (errorMessage.contains("refers to either a non-existent model")) { //"refers to either a non-existent model (invalid SED-ML) or to another model with changes (not supported yet)"
if (caughtException instanceof TimeoutException) {
return FailureType.TIMEOUT_ENCOUNTERED;
} else if (errorMessage.contains("refers to either a non-existent model")) { //"refers to either a non-existent model (invalid SED-ML) or to another model with changes (not supported yet)"
return FailureType.SEDML_UNSUPPORTED_MODEL_REFERENCE;
} else if (errorMessage.contains("Non-integer stoichiometry")) {
return FailureType.UNSUPPORTED_NON_INT_STOCH;
Expand Down

0 comments on commit 44b082f

Please sign in to comment.