Repository navigation
ENH: Check the C-Axis Reference Misalignments inputs only in preflight - #1975
Open
joeykleingers wants to merge 1 commit into
Open
joeykleingers wants to merge 1 commit into
joeykleingers wants to merge 1 commit into
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
IFilter::execute() always runs preflight before executeImpl(), so the input checks that ComputeCAxisReferenceMisalignments::operator()() repeated through the static ValidateInputs() only checked the same inputs a second time on every run. This change applies the knowledge-base rule "Run a filter, not its algorithm" to this filter. * The input checks move into the filter. Preflight keeps only the checks that the parameters cannot make: the reference direction is finite and not near zero, each selected array is a DataArray of the required type (ArraySelectionParameter does not stop a StringArray), Phases and the enabled mask have one tuple per quaternion, and the output path is not an input path. * The algorithm no longer checks its inputs or the output array that preflight creates. It keeps the phase range check (-98712) and the non-hexagonal warning (-98713). Its @pre lines give its preconditions. * Error codes -98714, -98716, -98718, -98720 and -98722 to -98725 are removed, because no path through the filter can return them. The remaining preflight codes move to the filter class. * The tests that called the algorithm directly are removed. The StringArray preflight test now reaches the type checks of all four selected arrays (-98715, -98717, -98719, -98721) through the filter. Signed-off-by: Joey Kleingers <joey.kleingers@bluequartz.net>
joeykleingers
force-pushed
the
topic/caxis-preflight-only
branch
from
November 13, 2026 20:43
d45c7ec to
ea9b052
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Compute C-Axis Reference Misalignments filter now checks each input one time, in preflight. This applies the knowledge-base rule "Run a filter, not its algorithm" (PR #1959) to the only filter that still followed the previous rule.
IFilter::execute()always runs preflight beforeexecuteImpl(). Thus the input checks that the algorithm repeated through its staticComputeCAxisReferenceMisalignments::ValidateInputs()checked the same inputs a second time on every run. 5 files changed, +213 / −470 lines.1. Input checks in the filter
src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeCAxisReferenceMisalignmentsFilter.cpp: the preflight input checks.src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeCAxisReferenceMisalignmentsFilter.hpp: the preflight error codes andk_MinReferenceDirectionNorm.preflightImpl()keeps only the checks that the parameters cannot make:ArraySelectionParameterapplies its type list only to anIDataArray, so aStringArrayselection gets topreflightImpl().These codes now belong to
ComputeCAxisReferenceMisalignmentsFilter. Their values do not change.2. The algorithm relies on preflight
src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeCAxisReferenceMisalignments.{hpp,cpp}The algorithm no longer checks its inputs or the output array that the preflight
CreateArrayActioncreates. Its@prelines give the preconditions. It keeps the checks that preflight cannot make: a phase value that is not an index into Crystal Structures (-98712), the non-hexagonal warning (-98713), and the result of each read and write.3. Removed error codes
No path through the filter can return these codes, so they are removed:
VectorParameterrejects this before preflight.AllowedComponentShapesof eachArraySelectionParameterreject this before preflight.CreateArrayActioncreates the output asfloat32with component shape {1} and the quaternion tuple shape.The filter was added after the DREAM3D-NX 7.4.2 release, so no released error code changes. The filter documentation lists no error codes and does not change.
4. Tests
src/Plugins/OrientationAnalysis/test/ComputeCAxisReferenceMisalignmentsTest.cppThe tests that called the algorithm directly are removed. Each input check is reached through the filter. The
StringArraypreflight test now selects aStringArrayfor each of the four arrays and asserts the type error code of that array.Test plan
ComputeCAxisReferenceMisalignmentstests pass in an in-core Release build (SIMPLNX_TEST_ALGORITHM_PATH=0) on macOS arm64.ComputeCAxisReferenceMisalignmentstests pass in an out-of-core Release build (DREAM3DNX_ENABLE_OOC=ON,SIMPLNX_TEST_ALGORITHM_PATH=1) on macOS arm64.Related Issue
Closes #1966