Working on DSL improvement

This commit is contained in:
Alexander Nozik 2016-08-20 13:44:28 +03:00
parent 154ff33bbd
commit 6a184dddda
2 changed files with 8 additions and 2 deletions

View File

@ -47,8 +47,12 @@ public class NumassFitScanTask extends GenericTask {
MetaBuilder overrideMeta = new MetaBuilder(fitConfig); MetaBuilder overrideMeta = new MetaBuilder(fitConfig);
overrideMeta.setValue("@resultName", String.format("%s[%s=%s]", data.getName(), scanParameter, val.stringValue())); overrideMeta.setValue("@resultName", String.format("%s[%s=%s]", data.getName(), scanParameter, val.stringValue()));
overrideMeta.getNodes("params.param").stream() if (overrideMeta.hasNode("params." + scanParameter)) {
.filter(par -> par.getString("name") == scanParameter).forEach(par -> par.setValue("value", val)); overrideMeta.setValue("params." + scanParameter + ".value", val);
} else {
overrideMeta.getNodes("params.param").stream()
.filter(par -> par.getString("name") == scanParameter).forEach(par -> par.setValue("value", val));
}
// Data<Table> newData = new Data<Table>(data.getGoal(),data.type(),overrideMeta); // Data<Table> newData = new Data<Table>(data.getGoal(),data.type(),overrideMeta);
DataNode node = action.run(DataNode.of("fit_" + i, data, Meta.empty()), overrideMeta); DataNode node = action.run(DataNode.of("fit_" + i, data, Meta.empty()), overrideMeta);
resultBuilder.putData(data.getName() + ".fit_" + i, node.getData()); resultBuilder.putData(data.getName() + ".fit_" + i, node.getData());

View File

@ -1,5 +1,6 @@
package inr.numass.workspace; package inr.numass.workspace;
import hep.dataforge.context.GlobalContext;
import hep.dataforge.data.DataNode; import hep.dataforge.data.DataNode;
import hep.dataforge.grind.JavaGrindLauncher; import hep.dataforge.grind.JavaGrindLauncher;
import hep.dataforge.meta.Meta; import hep.dataforge.meta.Meta;
@ -50,6 +51,7 @@ public class NumassGrindLauncher {
} }
node.computeAll(); node.computeAll();
GlobalContext.instance().close();
} }
// //
// JavaGrindLauncher.buildWorkspace(new File(cfgPath), NumassWorkspaceSpec.class) // JavaGrindLauncher.buildWorkspace(new File(cfgPath), NumassWorkspaceSpec.class)