Skip to content

Commit 71c3012

Browse files
committed
fix handling of bad URIs in OMEX and bad file names in outputs
1 parent 58c5e2f commit 71c3012

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

vcell-cli/src/main/java/org/vcell/cli/CLIStandalone.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ private static void singleExec(String[] args) {
6767
SedML sedml = null;
6868
sedml = Libsedml.readDocument(completeSedmlPath).getSedMLModel();
6969
SolverHandler solverHandler = new SolverHandler();
70-
ExternalDocInfo externalDocInfo = new ExternalDocInfo(completeSedmlPath, true);
70+
// send the omex file since we do better handling of malformed model URIs in XMLHelper code
71+
ExternalDocInfo externalDocInfo = new ExternalDocInfo(new File(inputFile), true);
7172
solverHandler.simulateAllTasks(externalDocInfo, sedml, outDirForCurrentSedml);
7273
}
7374
// At the end

vcell-cli/src/main/java/org/vcell/cli/SolverHandler.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,33 +61,33 @@ public void simulateAllTasks(ExternalDocInfo externalDocInfo, SedML sedml, File
6161
SolverDescription sd = std.getSolverDescription();
6262
String kisao = sd.getKisao();
6363
if (SolverDescription.CVODE.getKisao().contentEquals(kisao)) {
64-
ODESolverResultSet odeSolverResultSet = CVODEHelper.solve(outputDir, sims[i].getDescription(), bioModel);
64+
ODESolverResultSet odeSolverResultSet = CVODEHelper.solve(outputDir, sims[i].getDescription().replaceAll("[:\\\\/*?|<>]", "_"), bioModel);
6565
System.out.println("Finished: " + docName + ": - task '" + sims[i].getDescription() + "'.");
6666
} else if (SolverDescription.StochGibson.getKisao().contentEquals(kisao)) {
67-
ODESolverResultSet odeSolverResultSet = StockGibsonHelper.solve(outputDir, sims[i].getDescription(),
67+
ODESolverResultSet odeSolverResultSet = StockGibsonHelper.solve(outputDir, sims[i].getDescription().replaceAll("[:\\\\/*?|<>]", "_"),
6868
bioModel);
6969
System.out.println("Finished: " + docName + ": - task '" + sims[i].getDescription() + "'.");
7070
} else if (SolverDescription.IDA.getKisao().contentEquals(kisao)) {
71-
ODESolverResultSet odeSolverResultSet = IDAHelper.solve(outputDir, sims[i].getDescription(), bioModel);
71+
ODESolverResultSet odeSolverResultSet = IDAHelper.solve(outputDir, sims[i].getDescription().replaceAll("[:\\\\/*?|<>]", "_"), bioModel);
7272
System.out.println("Finished: " + docName + ": - task '" + sims[i].getDescription() + "'.");
7373
} else if (SolverDescription.RungeKuttaFehlberg.getKisao().contentEquals(kisao)) {
74-
ODESolverResultSet odeSolverResultSet = RungeKuttaFelhbergHelper.solve(outputDir, sims[i].getDescription(),
74+
ODESolverResultSet odeSolverResultSet = RungeKuttaFelhbergHelper.solve(outputDir, sims[i].getDescription().replaceAll("[:\\\\/*?|<>]", "_"),
7575
bioModel);
7676
System.out.println("Finished: " + docName + ": - task '" + sims[i].getDescription() + "'.");
7777
} else if (SolverDescription.AdamsMoulton.getKisao().contentEquals(kisao)) {
78-
ODESolverResultSet odeSolverResultSet = AdamsMoultonHelper.solve(outputDir, sims[i].getDescription(),
78+
ODESolverResultSet odeSolverResultSet = AdamsMoultonHelper.solve(outputDir, sims[i].getDescription().replaceAll("[:\\\\/*?|<>]", "_"),
7979
bioModel);
8080
System.out.println("Finished: " + docName + ": - task '" + sims[i].getDescription() + "'.");
8181
} else if (SolverDescription.ForwardEuler.getKisao().contentEquals(kisao)) {
82-
ODESolverResultSet odeSolverResultSet = ForwardEulerHelper.solve(outputDir, sims[i].getDescription(),
82+
ODESolverResultSet odeSolverResultSet = ForwardEulerHelper.solve(outputDir, sims[i].getDescription().replaceAll("[:\\\\/*?|<>]", "_"),
8383
bioModel);
8484
System.out.println("Finished: " + docName + ": - task '" + sims[i].getDescription() + "'.");
8585
} else if (SolverDescription.RungeKutta2.getKisao().contentEquals(kisao)) {
86-
ODESolverResultSet odeSolverResultSet = RungeKutta2Helper.solve(outputDir, sims[i].getDescription(),
86+
ODESolverResultSet odeSolverResultSet = RungeKutta2Helper.solve(outputDir, sims[i].getDescription().replaceAll("[:\\\\/*?|<>]", "_"),
8787
bioModel);
8888
System.out.println("Finished: " + docName + ": - task '" + sims[i].getDescription() + "'.");
8989
} else if (SolverDescription.RungeKutta4.getKisao().contentEquals(kisao)) {
90-
ODESolverResultSet odeSolverResultSet = RungeKutta4Helper.solve(outputDir, sims[i].getDescription(),
90+
ODESolverResultSet odeSolverResultSet = RungeKutta4Helper.solve(outputDir, sims[i].getDescription().replaceAll("[:\\\\/*?|<>]", "_"),
9191
bioModel);
9292
System.out.println("Finished: " + docName + ": - task '" + sims[i].getDescription() + "'.");
9393
} else {

0 commit comments

Comments
 (0)