Skip to content

Commit

Permalink
This commit contains the same fixes as previous, but for the GUI runt…
Browse files Browse the repository at this point in the history
…ime.

Fix the summary file generation to include headers. (Closes #15)
Fix the hdm value assignment. (Closes #16)
  • Loading branch information
JonathanCSmith committed Jul 16, 2024
1 parent cd8dc89 commit 8c0adf0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ private void generateSummaries() {
if (doHeader) {
String headerItems = anamorfEntries.get(0);
String[] hdmHeaderItems = hdmEntries.get(0).split(",");
String header = headerItems + hdmHeaderItems[hdmHeaderItems.length - 1] + ",Alignment (Coherency [%]),Size";
String header = headerItems + "," + hdmHeaderItems[hdmHeaderItems.length - 1] + ",Alignment (Coherency [%]),Size";
lines.add(header);
doHeader = false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,7 @@ private void generateSummaries() {
// Loop through our results and generate a summary
Path gapsOutputPath = Paths.get(this.outputDirectory, "gaps_summary.csv");
Path twombliOutputPath = Paths.get(this.outputDirectory, "twombli_summary.csv");
boolean doHeader = true;
for (CommandModule output : this.finishedFutures) {
// Gather our basic info
String filePrefix = (String) output.getInput("filePrefix");
Expand All @@ -712,14 +713,26 @@ private void generateSummaries() {

// Write to our twombli summary
try {
List<String> lines = new ArrayList<>();
List<String> anamorfEntries = Files.readAllLines(anamorfSummaryPath);
String anamorfData = anamorfEntries.get(anamorfEntries.size() - 1);

List<String> hdmEntries = Files.readAllLines(hdmSummaryPath);

// Conditionally write out our header
if (doHeader) {
String headerItems = anamorfEntries.get(0);
String[] hdmHeaderItems = hdmEntries.get(0).split(",");
String header = headerItems + "," + hdmHeaderItems[hdmHeaderItems.length - 1] + ",Alignment (Coherency [%]),Size";
lines.add(header);
doHeader = false;
}

// Get the data
String anamorfData = anamorfEntries.get(anamorfEntries.size() - 1);
String[] hdmData = hdmEntries.get(hdmEntries.size() - 1).split(",");
double hdmValue = 1 - Double.parseDouble(hdmData[hdmData.length - 1]);
lines.add(anamorfData + "," + hdmValue + "," + alignment + "," + dimension);

List<String> lines = new ArrayList<>();
lines.add(anamorfData + "," + hdmData[hdmData.length - 1] + "," + alignment + "," + dimension);
// Write
Files.write(twombliOutputPath, lines, StandardOpenOption.CREATE, StandardOpenOption.APPEND);
}

Expand Down

0 comments on commit 8c0adf0

Please sign in to comment.