Extra fixing windows paths generated from AutoAnalyser to be properly escaped in data filename for Python/Matlab

This commit is contained in:
jlizier 2022-09-01 15:50:27 +10:00
parent c233485c90
commit 05248ef105
1 changed files with 3 additions and 3 deletions

View File

@ -917,9 +917,9 @@ public abstract class AutoAnalyser extends JFrame
// 2. Python
pythonCode.append("# " + loadDataComment);
if (selectedCalcType.equalsIgnoreCase(CALC_TYPE_DISCRETE)) {
pythonCode.append("dataRaw = readIntsFile.readIntsFile(\"" + dataFile.getAbsolutePath() + "\")\n");
pythonCode.append("dataRaw = readIntsFile.readIntsFile(\"" + filenameAsEscapedString + "\")\n");
} else {
pythonCode.append("dataRaw = readFloatsFile.readFloatsFile(\"" + dataFile.getAbsolutePath() + "\")\n");
pythonCode.append("dataRaw = readFloatsFile.readFloatsFile(\"" + filenameAsEscapedString + "\")\n");
}
pythonCode.append("# As numpy array:\n");
pythonCode.append("data = numpy.array(dataRaw)\n");
@ -945,7 +945,7 @@ public abstract class AutoAnalyser extends JFrame
}
// 3. Matlab
matlabCode.append("% " + loadDataComment);
matlabCode.append("data = load('" + dataFile.getAbsolutePath() + "');\n");
matlabCode.append("data = load('" + filenameAsEscapedString + "');\n");
if (! allCombosCheckBox.isSelected()) {
matlabCode.append("% Column indices start from 1 in Matlab:\n");
if (selectedCalcType.equalsIgnoreCase(CALC_TYPE_DISCRETE)) {