Moved Markup into separate module. Replaced Descriptor rendering with Output clause.

This commit is contained in:
Alexander Nozik 2018-05-08 23:00:58 +03:00
parent 682c8805a2
commit 52dd70cbdc
8 changed files with 14 additions and 14 deletions

View File

@ -22,8 +22,8 @@ import hep.dataforge.context.Global;
import hep.dataforge.description.ActionDescriptor; import hep.dataforge.description.ActionDescriptor;
import hep.dataforge.description.Descriptors; import hep.dataforge.description.Descriptors;
import hep.dataforge.exceptions.DescriptorException; import hep.dataforge.exceptions.DescriptorException;
import hep.dataforge.io.markup.MarkupBuilder; import hep.dataforge.markup.markup.MarkupBuilder;
import hep.dataforge.io.markup.MarkupUtils; import hep.dataforge.markup.markup.MarkupUtils;
import hep.dataforge.meta.Meta; import hep.dataforge.meta.Meta;
/** /**
@ -67,6 +67,6 @@ public class Numass {
builder.text("***End of actions list***", "red"); builder.text("***End of actions list***", "red");
context.getIo().getOutput().push(builder.build(), Meta.empty()); context.getIo().getOutput().render(builder.build(), Meta.empty());
} }
} }

View File

@ -129,7 +129,7 @@ public class MonitorCorrectAction extends OneToOneAction<Table, Table> {
// } // }
Table res = ListTable.infer(dataList); Table res = ListTable.infer(dataList);
context.getIo().output(name, getName()).push(NumassUtils.INSTANCE.wrap(res, meta), Meta.empty()); context.getIo().output(name, getName()).render(NumassUtils.INSTANCE.wrap(res, meta), Meta.empty());
return res; return res;
} }
@ -194,7 +194,7 @@ public class MonitorCorrectAction extends OneToOneAction<Table, Table> {
String monitorFileName = meta.getString("monitorFile", "monitor"); String monitorFileName = meta.getString("monitorFile", "monitor");
ListTable data = ListTable.infer(monitorPoints); ListTable data = ListTable.infer(monitorPoints);
context.getIo().output(monitorFileName, getName()).push(NumassUtils.INSTANCE.wrap(data, meta), Meta.empty()); context.getIo().output(monitorFileName, getName()).render(NumassUtils.INSTANCE.wrap(data, meta), Meta.empty());
// ColumnedDataWriter.writeTable(stream, TableTransform.sort(data, "Timestamp", true), "Monitor points", monitorNames); // ColumnedDataWriter.writeTable(stream, TableTransform.sort(data, "Timestamp", true), "Monitor points", monitorNames);
} }
} }

View File

@ -49,7 +49,7 @@ public class SubstractSpectrumAction extends OneToOneAction<Table, Table> {
Table res = builder.build(); Table res = builder.build();
context.getIo().output(name, getName()).push(NumassUtils.INSTANCE.wrap(res, inputMeta), Meta.empty()); context.getIo().output(name, getName()).render(NumassUtils.INSTANCE.wrap(res, inputMeta), Meta.empty());
return res; return res;
} catch (IOException ex) { } catch (IOException ex) {
throw new RuntimeException("Could not read reference file", ex); throw new RuntimeException("Could not read reference file", ex);

View File

@ -60,7 +60,7 @@ class MergeDataAction : ManyToOneAction<Table, Table>() {
} }
override fun afterGroup(context: Context, groupName: String, outputMeta: Meta, output: Table) { override fun afterGroup(context: Context, groupName: String, outputMeta: Meta, output: Table) {
context.io.output(groupName, name).push(NumassUtils.wrap(output, outputMeta)) context.io.output(groupName, name).render(NumassUtils.wrap(output, outputMeta))
super.afterGroup(context, groupName, outputMeta, output) super.afterGroup(context, groupName, outputMeta, output)
} }

View File

@ -108,7 +108,7 @@ object SummaryAction : ManyToOneAction<FitState, Table>() {
} }
override fun afterGroup(context: Context, groupName: String, outputMeta: Meta, output: Table) { override fun afterGroup(context: Context, groupName: String, outputMeta: Meta, output: Table) {
context.io.output(groupName, name).push(NumassUtils.wrap(output, outputMeta)) context.io.output(groupName, name).render(NumassUtils.wrap(output, outputMeta))
super.afterGroup(context, groupName, outputMeta, output) super.afterGroup(context, groupName, outputMeta, output)
} }

View File

@ -103,7 +103,7 @@ class TransformDataAction : OneToOneAction<Table, Table>() {
val res = table.addColumn(ListColumn.build(table.getColumn(COUNT_RATE_KEY).format, cr.stream())) val res = table.addColumn(ListColumn.build(table.getColumn(COUNT_RATE_KEY).format, cr.stream()))
.addColumn(ListColumn.build(table.getColumn(COUNT_RATE_ERROR_KEY).format, crErr.stream())) .addColumn(ListColumn.build(table.getColumn(COUNT_RATE_ERROR_KEY).format, crErr.stream()))
context.io.output(name, name).push(NumassUtils.wrap(res, meta)) context.io.output(name, name).render(NumassUtils.wrap(res, meta))
return res return res
} }

View File

@ -68,7 +68,7 @@ object NumassFitScanSummaryTask : AbstractTask<Table>() {
pars.getValue("trap")) pars.getValue("trap"))
} }
val res = TableTransform.sort(builder.build(), "m", true) val res = TableTransform.sort(builder.build(), "m", true)
context.io.output(nodeName, stage = name).push(NumassUtils.wrap(res, meta)) context.io.output(nodeName, stage = name).render(NumassUtils.wrap(res, meta))
return res return res
} }

View File

@ -60,7 +60,7 @@ val analyzeTask = task("analyze") {
pipe<NumassSet, Table> { set -> pipe<NumassSet, Table> { set ->
SmartAnalyzer().analyzeSet(set, meta).also { res -> SmartAnalyzer().analyzeSet(set, meta).also { res ->
val outputMeta = meta.builder.putNode("data", set.meta) val outputMeta = meta.builder.putNode("data", set.meta)
context.io.output(name, stage = "numass.analyze").push(NumassUtils.wrap(res, outputMeta)) context.io.output(name, stage = "numass.analyze").render(NumassUtils.wrap(res, outputMeta))
} }
} }
} }
@ -105,13 +105,13 @@ val monitorTableTask = task("monitor") {
//add set markers //add set markers
addSetMarkers(frame, data.values) addSetMarkers(frame, data.values)
} }
context.io.output(name, stage = "numass.monitor", type = "dfp").push(PlotFrame.Wrapper().wrap(frame)) context.io.output(name, stage = "numass.monitor", type = "dfp").render(PlotFrame.Wrapper().wrap(frame))
} }
} }
} }
context.io.output(name, stage = "numass.monitor").push(NumassUtils.wrap(res, meta)) context.io.output(name, stage = "numass.monitor").render(NumassUtils.wrap(res, meta))
return@join res; return@join res;
} }
@ -170,7 +170,7 @@ val subtractEmptyTask = task("dif") {
res.goal.onComplete { r, _ -> res.goal.onComplete { r, _ ->
if (r != null) { if (r != null) {
context.io.output(input.name + "_subtract", stage = "numass.merge").push(NumassUtils.wrap(r, resMeta)) context.io.output(input.name + "_subtract", stage = "numass.merge").render(NumassUtils.wrap(r, resMeta))
} }
} }