Skip to content

Commit f9ebabf

Browse files
authored
ENH: Excessive Warning Cleanup (#1194)
* Clean up top 3 most excessive warnings * Repair broken test case * Convert frequent warnings to preflight updated values
1 parent c0067c7 commit f9ebabf

File tree

7 files changed

+85
-100
lines changed

7 files changed

+85
-100
lines changed

src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ArrayCalculatorFilter.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -158,15 +158,6 @@ IFilter::PreflightResult ArrayCalculatorFilter::preflightImpl(const DataStructur
158158
if(const auto* attributeMatrix = dataStructure.getDataAs<AttributeMatrix>(outputGroupPath); attributeMatrix != nullptr)
159159
{
160160
calculatedTupleShape = attributeMatrix->getShape();
161-
resultOutputActions.warnings().push_back(Warning{static_cast<int>(CalculatorItem::WarningCode::NumericValueWarning),
162-
"The result of the chosen expression will be a numeric value. This numeric value will be used to initialize an "
163-
"array with the number of tuples equal to the number of tuples in the destination group."});
164-
}
165-
else
166-
{
167-
resultOutputActions.warnings().push_back(
168-
Warning{static_cast<int>(CalculatorItem::WarningCode::NumericValueWarning),
169-
"The result of the chosen expression will be a numeric value or contain one tuple. This numeric value will be stored in an array with the number of tuples equal to 1"});
170161
}
171162
}
172163

src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CropEdgeGeometryFilter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ IFilter::PreflightResult CropEdgeGeometryFilter::preflightImpl(const DataStructu
223223
{
224224
// Detected at least one vertex array, throw a warning
225225
resultOutputActions.warnings().push_back(
226-
{-100, "A vertex data array was detected in the selected edge geometry. This filter currently only interpolates vertex positions, associated vertex data values will not be interpolated."});
226+
{-100, "A vertex data array was detected in the selected edge geometry. This filter currently only interpolates vertex positions, associated vertex data values will not be interpolated."});
227227
}
228228

229229
for(const auto& [identifier, object] : selectedVertexData)

src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CropImageGeometryFilter.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -515,11 +515,11 @@ IFilter::PreflightResult CropImageGeometryFilter::preflightImpl(const DataStruct
515515
}
516516
if(!warningMsg.empty())
517517
{
518-
resultOutputActions.m_Warnings.push_back(Warning(
519-
{-55503,
518+
preflightUpdatedValues.push_back(
519+
{"Invalidated NeighborLists",
520520
fmt::format(
521-
"This filter will modify the Cell Level Array '{}' which causes all Feature level NeighborLists to become invalid. These NeighborLists will not be copied to the new geometry:{}",
522-
featureIdsArrayPath.toString(), warningMsg)}));
521+
"This filter will modify the Cell Level Array(s) '{}' which causes all feature level NeighborLists to become invalid. These NeighborLists will not be copied to the new geometry:{}",
522+
featureIdsArrayPath.toString(), warningMsg)});
523523
}
524524
}
525525

src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ResampleImageGeomFilter.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -295,11 +295,11 @@ IFilter::PreflightResult ResampleImageGeomFilter::preflightImpl(const DataStruct
295295
}
296296
if(!warningMsg.empty())
297297
{
298-
resultOutputActions.m_Warnings.push_back(Warning(
299-
{-55503,
298+
preflightUpdatedValues.push_back(
299+
{"Invalidated NeighborLists",
300300
fmt::format(
301301
"This filter will modify the Cell Level Array '{}' which causes all Feature level NeighborLists to become invalid. These NeighborLists will not be copied to the new geometry:{}",
302-
featureIdsArrayPath.toString(), warningMsg)}));
302+
featureIdsArrayPath.toString(), warningMsg)});
303303
}
304304
}
305305

src/Plugins/SimplnxCore/test/ArrayCalculatorTest.cpp

Lines changed: 73 additions & 79 deletions
Large diffs are not rendered by default.

src/simplnx/Parameters/FileSystemPathParameter.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ Result<> ValidateOutputFile(const FileSystemPathParameter::ValueType& path)
8080
{
8181
return result;
8282
}
83-
if(!fs::exists(path))
83+
if(fs::exists(path))
8484
{
85-
return MakeWarningVoidResult(-6, fmt::format("File System Path '{}' does not exist. It will be created during execution.", path.string()));
85+
return MakeWarningVoidResult(-6, fmt::format("File System Path '{}' already exists. It will be OVERWRITTEN during execution.", path.string()));
8686
}
8787
} catch(const fs::filesystem_error& exception)
8888
{
@@ -104,7 +104,7 @@ Result<> ValidateOutputDir(const FileSystemPathParameter::ValueType& path)
104104
}
105105
if(!fs::exists(path))
106106
{
107-
return MakeWarningVoidResult(-7, fmt::format("File System Path '{}' does not exist. It will be created during execution.", path.string()));
107+
return MakeWarningVoidResult(-17, fmt::format("File System Directory Path '{}' does not exist. It will be created during execution.", path.string()));
108108
}
109109
} catch(const fs::filesystem_error& exception)
110110
{

src/simplnx/Utilities/FilterUtilities.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ IFilter::PreflightResult NeighborListRemovalPreflightCode(const DataStructure& d
5353

5454
// Throw a warning to inform the user that the neighbor list arrays could be deleted by this filter
5555
std::string ss =
56-
fmt::format("This filter WILL remove all arrays of type NeighborList from the feature Attribute Matrix '{}'. These arrays are:\n", featureIdsPath.toString(), featureGroupDataPath.toString());
56+
fmt::format("This filter will REMOVE all arrays of type NeighborList from the feature Attribute Matrix '{}'. These arrays are:\n", featureIdsPath.toString(), featureGroupDataPath.toString());
5757

5858
auto result = nx::core::GetAllChildDataPaths(dataStructure, featureGroupDataPath, DataObject::Type::NeighborList);
5959
if(!result.has_value())

0 commit comments

Comments
 (0)