use of org.knime.core.node.InvalidSettingsException in project knime-core by knime.
the class FileWorkflowPersistor method loadOutPortTemplate.
/**
* Sub class hook o read port settings.
*
* @param settings Ignored.
* @return null
* @throws InvalidSettingsException Not actually thrown here.
*/
WorkflowPortTemplate loadOutPortTemplate(final NodeSettingsRO settings) throws InvalidSettingsException {
if (getLoadVersion().isOlderThan(LoadVersion.V200)) {
throw new InvalidSettingsException("No ports for metanodes in version 1.x.x");
} else {
int index = settings.getInt("index");
String name = settings.getString("name");
NodeSettingsRO portTypeSettings = settings.getNodeSettings("type");
PortType type = PortType.load(portTypeSettings);
WorkflowPortTemplate result = new WorkflowPortTemplate(index, type);
result.setPortName(name);
return result;
}
}
use of org.knime.core.node.InvalidSettingsException in project knime-core by knime.
the class OneWayANOVANodeModel method configure.
/**
* {@inheritDoc}
*/
@Override
protected DataTableSpec[] configure(final DataTableSpec[] inSpecs) throws InvalidSettingsException {
DataTableSpec spec = inSpecs[0];
if (m_settings.getGroupingColumn() == null || !spec.containsName(m_settings.getGroupingColumn())) {
throw new InvalidSettingsException("Please define a grouping column.");
}
FilterResult filterResult = m_settings.getTestColumns().applyTo(spec);
if (filterResult.getIncludes().length == 0) {
if (filterResult.getExcludes().length > 0) {
throw new InvalidSettingsException("Please select at least " + "one test column.");
} else {
throw new InvalidSettingsException("There are no numeric columns " + "in the input table. At least one numeric column " + "is needed to perform the test.");
}
}
if (m_settings.getConfidenceIntervalProb() > 0.99 || m_settings.getConfidenceIntervalProb() < 0.01) {
throw new InvalidSettingsException("The property " + "\"Confidence Interval (in %)\" must be in the range " + "[1, 99].");
}
return new DataTableSpec[] { OneWayANOVAStatistics.getTableSpec(), LeveneTestStatistics.getTableSpec(), OneWayANOVAStatistics.getGroupStatisticsSpec() };
}
use of org.knime.core.node.InvalidSettingsException in project knime-core by knime.
the class OneWayANOVANodeModel method getGroups.
private List<String> getGroups(final BufferedDataTable inData, final ExecutionMonitor exec) throws InvalidSettingsException, CanceledExecutionException {
DataTableSpec spec = inData.getSpec();
int gIndex = spec.findColumnIndex(m_settings.getGroupingColumn());
LinkedHashSet<String> groups = new LinkedHashSet<String>();
if (gIndex < 0) {
throw new InvalidSettingsException("Grouping column not found.");
}
final int rowCount = inData.getRowCount();
int rowIndex = 0;
for (DataRow row : inData) {
exec.checkCanceled();
exec.setProgress(rowIndex++ / (double) rowCount, rowIndex + "/" + rowCount + " (\"" + row.getKey() + "\")");
DataCell group = row.getCell(gIndex);
if (!group.isMissing()) {
groups.add(group.toString());
}
}
return Arrays.asList(groups.toArray(new String[groups.size()]));
}
use of org.knime.core.node.InvalidSettingsException in project knime-core by knime.
the class OneSampleTTestNodeModel method configure.
/**
* {@inheritDoc}
*/
@Override
protected DataTableSpec[] configure(final DataTableSpec[] inSpecs) throws InvalidSettingsException {
DataTableSpec spec = inSpecs[0];
FilterResult filterResult = m_settings.getTestColumns().applyTo(spec);
if (filterResult.getIncludes().length == 0) {
if (filterResult.getExcludes().length > 0) {
throw new InvalidSettingsException("Please select at least " + "one test column.");
} else {
throw new InvalidSettingsException("There are no numeric columns " + "in the input table. At least one numeric column " + "is needed to perform the test.");
}
}
if (m_settings.getConfidenceIntervalProb() > 0.99 || m_settings.getConfidenceIntervalProb() < 0.01) {
throw new InvalidSettingsException("The property " + "\"Confidence Interval (in %)\" must be in the range " + "[1, 99].");
}
return new DataTableSpec[] { OneSampleTTestStatistics.getTableSpec(), OneSampleTTestStatistics.getDescStatsSpec() };
}
use of org.knime.core.node.InvalidSettingsException in project knime-core by knime.
the class TwoSampleTTestNodeModel method configure.
/**
* {@inheritDoc}
*/
@Override
protected DataTableSpec[] configure(final DataTableSpec[] inSpecs) throws InvalidSettingsException {
DataTableSpec spec = inSpecs[0];
if (m_settings.getGroupingColumn() == null || !spec.containsName(m_settings.getGroupingColumn())) {
throw new InvalidSettingsException("Please define a grouping column.");
}
if (m_settings.getGroupOne() == null) {
throw new InvalidSettingsException("Value of group one is not set.");
}
if (m_settings.getGroupTwo() == null) {
throw new InvalidSettingsException("Value of group two is not set.");
}
FilterResult filterResult = m_settings.getTestColumns().applyTo(spec);
if (filterResult.getIncludes().length == 0) {
if (filterResult.getExcludes().length > 0) {
throw new InvalidSettingsException("Please select at least " + "one test column.");
} else {
throw new InvalidSettingsException("There are no numeric columns " + "in the input table. At least one numeric column " + "is needed to perform the test.");
}
}
if (m_settings.getConfidenceIntervalProb() > 0.99 || m_settings.getConfidenceIntervalProb() < 0.01) {
throw new InvalidSettingsException("The property " + "\"Confidence Interval (in %)\" must be in the range " + "[1, 99].");
}
return new DataTableSpec[] { TwoSampleTTestStatistics.getTableSpec(), LeveneTestStatistics.getTableSpec(), TwoSampleTTestStatistics.getGroupStatisticsSpec() };
}
Aggregations