diff --git a/vcell-cli/src/main/java/org/vcell/cli/run/SedmlJob.java b/vcell-cli/src/main/java/org/vcell/cli/run/SedmlJob.java index 9c68e9da46..42ccf0cf20 100644 --- a/vcell-cli/src/main/java/org/vcell/cli/run/SedmlJob.java +++ b/vcell-cli/src/main/java/org/vcell/cli/run/SedmlJob.java @@ -389,7 +389,7 @@ private void generateHDF5(SolverHandler solverHandler, HDF5ExecutionResults mast Hdf5DataExtractor hdf5Extractor = new Hdf5DataExtractor(this.sedml, solverHandler.taskToTempSimulationMap, this.RESULTS_DIRECTORY_PATH); - Hdf5DataContainer partialHdf5File = hdf5Extractor.extractHdf5RelevantData(solverHandler.nonSpatialResults, solverHandler.spatialResults, masterHdf5File.isBioSimHdf5); + Hdf5DataContainer partialHdf5File = hdf5Extractor.extractHdf5RelevantData(solverHandler.nonSpatialResults, solverHandler.spatialResults); masterHdf5File.addResults(this.sedml, partialHdf5File); for (File tempH5File : solverHandler.spatialResults.values()) { diff --git a/vcell-cli/src/main/java/org/vcell/cli/run/hdf5/Hdf5DataPreparer.java b/vcell-cli/src/main/java/org/vcell/cli/run/hdf5/Hdf5DataPreparer.java index 4111bc64b0..d421345399 100644 --- a/vcell-cli/src/main/java/org/vcell/cli/run/hdf5/Hdf5DataPreparer.java +++ b/vcell-cli/src/main/java/org/vcell/cli/run/hdf5/Hdf5DataPreparer.java @@ -124,7 +124,7 @@ public static Hdf5PreparedData prepareNonspatialData(Hdf5SedmlResults datasetWra List dataDimensionList = new LinkedList<>(); Hdf5SedmlResultsNonspatial dataSourceNonspatial = (Hdf5SedmlResultsNonspatial) datasetWrapper.dataSource; - Map> dataSetMap = dataSourceNonspatial.dataItems.getDataSetMappings(report); + Map> dataSetMap = dataSourceNonspatial.allJobResults; numDataSets = dataSetMap.keySet().size(); for (DataSet dataSet : dataSetMap.keySet()){ @@ -150,7 +150,7 @@ public static Hdf5PreparedData prepareNonspatialData(Hdf5SedmlResults datasetWra int bufferOffset = 0; for (DataSet dataSet : dataSetMap.keySet()) { - List dataArrays = dataSourceNonspatial.dataItems.get(report, dataSet); + List dataArrays = dataSourceNonspatial.allJobResults.get(dataSet); for (double[] dataArray : dataArrays){ if (dataArray.length < numTimePoints){ double[] paddedArray = new double[Math.toIntExact(numTimePoints)]; diff --git a/vcell-cli/src/main/java/org/vcell/cli/run/hdf5/Hdf5SedmlResultsNonspatial.java b/vcell-cli/src/main/java/org/vcell/cli/run/hdf5/Hdf5SedmlResultsNonspatial.java index 01e7fbe120..9df3397e4a 100644 --- a/vcell-cli/src/main/java/org/vcell/cli/run/hdf5/Hdf5SedmlResultsNonspatial.java +++ b/vcell-cli/src/main/java/org/vcell/cli/run/hdf5/Hdf5SedmlResultsNonspatial.java @@ -14,6 +14,6 @@ public Hdf5SedmlResultsNonspatial() {} /** * Map of all data contained within a job relevant to HDF5 formatted files */ - public NonspatialDataMapping dataItems = new NonspatialDataMapping(); + public Map> allJobResults = new LinkedHashMap<>(); } diff --git a/vcell-cli/src/main/java/org/vcell/cli/run/hdf5/NonspatialResultsConverter.java b/vcell-cli/src/main/java/org/vcell/cli/run/hdf5/NonspatialResultsConverter.java index a5d1dc9c62..5fe08f6ab9 100644 --- a/vcell-cli/src/main/java/org/vcell/cli/run/hdf5/NonspatialResultsConverter.java +++ b/vcell-cli/src/main/java/org/vcell/cli/run/hdf5/NonspatialResultsConverter.java @@ -174,11 +174,11 @@ public static Map> convertNonspatialResultsToSedm for (DataSet dataSet : dataSetValues.keySet()){ NonspatialValueHolder dataSetValuesSource = dataSetValues.get(dataSet); - dataSourceNonspatial.dataItems.put(report, dataSet, new LinkedList<>()); + dataSourceNonspatial.allJobResults.put(dataSet, new LinkedList<>()); dataSourceNonspatial.scanBounds = dataSetValuesSource.vcSimulation.getMathOverrides().getScanBounds(); dataSourceNonspatial.scanParameterNames = dataSetValuesSource.vcSimulation.getMathOverrides().getScannedConstantNames(); for (double[] data : dataSetValuesSource.listOfResultSets) { - dataSourceNonspatial.dataItems.get(report, dataSet).add(data); + dataSourceNonspatial.allJobResults.get(dataSet).add(data); shapes.add(Integer.toString(data.length)); } diff --git a/vcell-cli/src/test/java/org/vcell/cli/run/hdf5/Hdf5WriterTest.java b/vcell-cli/src/test/java/org/vcell/cli/run/hdf5/Hdf5WriterTest.java index e793295bac..edfc222e53 100644 --- a/vcell-cli/src/test/java/org/vcell/cli/run/hdf5/Hdf5WriterTest.java +++ b/vcell-cli/src/test/java/org/vcell/cli/run/hdf5/Hdf5WriterTest.java @@ -20,14 +20,9 @@ public class Hdf5WriterTest { public static HDF5ExecutionResults createExampleData() { - Report plotReport = new Report("report0", "Plot Report"); - Report reportReport = new Report("report1", "Report Report"); - DataSet t = new DataSet("t","t","t","#null"); DataSet s0 = new DataSet("s0","s0","s0","#null"); DataSet s1 = new DataSet("s1", "s1", "s1","#null"); - plotReport.addDataSet(t); plotReport.addDataSet(s0); plotReport.addDataSet(s1); - reportReport.addDataSet(t); reportReport.addDataSet(s0); reportReport.addDataSet(s1); Hdf5SedmlMetadata plotMetadata = new Hdf5SedmlMetadata(); plotMetadata._type = "SedPlot2D"; @@ -63,9 +58,12 @@ public static HDF5ExecutionResults createExampleData() { plotDataSourceNonspatial.scanBounds = new int[0]; plotDataSourceNonspatial.scanParameterNames = new String[0]; plotDatasetWrapper.dataSource = plotDataSourceNonspatial; - plotDataSourceNonspatial.dataItems.put(plotReport, t, Arrays.asList(row_t)); - plotDataSourceNonspatial.dataItems.put(plotReport, s0, Arrays.asList(row_S0_0)); - plotDataSourceNonspatial.dataItems.put(plotReport, s1, Arrays.asList(row_S1)); + Map> plotJob = new LinkedHashMap<>(); + plotJob.put(t, Arrays.asList(row_t)); + plotJob.put(s0, Arrays.asList(row_S0_0)); + plotJob.put(s1, Arrays.asList(row_S1)); + plotDataSourceNonspatial.allJobResults = plotJob; + Hdf5SedmlResults reportDatasetWrapper = new Hdf5SedmlResults(); reportDatasetWrapper.datasetMetadata = reportMetadata; @@ -73,21 +71,20 @@ public static HDF5ExecutionResults createExampleData() { reportDataSourceNonspatial.scanBounds = new int[] { 2 }; // zero indexed? reportDataSourceNonspatial.scanParameterNames = new String[] { "k1" }; reportDatasetWrapper.dataSource = reportDataSourceNonspatial; - reportDataSourceNonspatial.dataItems.put(reportReport, t, Arrays.asList(row_t, row_t, row_t)); - reportDataSourceNonspatial.dataItems.put(reportReport, s0, Arrays.asList(row_S0_0, row_S0_1, row_S0_2)); - reportDataSourceNonspatial.dataItems.put(reportReport, s1, Arrays.asList(row_S1, row_S1, row_S1)); + Map> reportJob = new LinkedHashMap<>(); + reportJob.put(t, Arrays.asList(row_t, row_t, row_t)); + reportJob.put(s0, Arrays.asList(row_S0_0, row_S0_1, row_S0_2)); + reportJob.put(s1, Arrays.asList(row_S1, row_S1, row_S1)); + reportDataSourceNonspatial.allJobResults = reportJob; Hdf5DataContainer hdf5FileWrapper = new Hdf5DataContainer(); - String uri1 = "___0_export_NO_scan_test_1.sedml"; - String uri2 = "___0_export_NO_scan_test_2.sedml"; - List wrappers1 = new ArrayList<>(); - List wrappers2 = new ArrayList<>(); - wrappers1.add(plotDatasetWrapper); - wrappers2.add(reportDatasetWrapper); - hdf5FileWrapper.reportToUriMap.put(plotReport, uri1); - hdf5FileWrapper.reportToUriMap.put(reportReport, uri2); - hdf5FileWrapper.reportToResultsMap.put(plotReport, wrappers1); - hdf5FileWrapper.reportToResultsMap.put(reportReport, wrappers2); + Report report = new Report("simId","simName"); + String uri = "___0_export_NO_scan_test.sedml"; + List wrappers = new ArrayList<>(); + wrappers.add(plotDatasetWrapper); + wrappers.add(reportDatasetWrapper); + hdf5FileWrapper.reportToUriMap.put(report, uri); + hdf5FileWrapper.reportToResultsMap.put(report, wrappers); HDF5ExecutionResults results = new HDF5ExecutionResults(true); results.addResults(null, hdf5FileWrapper);