-
-
Notifications
You must be signed in to change notification settings - Fork 673
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deprecate CoordRepType
and replace it with CoordinateType
#4997
Deprecate CoordRepType
and replace it with CoordinateType
#4997
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer if you introduced deprecation for CoordRepType
in this PR. Pick legacy or future legacy.
bd4620d
to
8ac75d5
Compare
CoordRepType
and replace it with CoordinateType
using CoordRepType = CoordinateType; | ||
#ifndef ITK_FUTURE_REMOVE_LEGACY | ||
using CoordRepType [[deprecated("ITK 6 discourages using `CoordRepType`. Please use `CoordinateType` instead!")]] = | ||
CoordinateType; | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure but I'm afraid that some users might get annoyed by this deprecated-warning. Especially those users who have intentionally enabled legacy support. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm thinking, maybe we should have a FUTURE_DEPRECATED macro, roughly as follows:
#ifdef ITK_LEGACY_REMOVE
#define FUTURE_DEPRECATED [[deprecated]]
#else
#define FUTURE_DEPRECATED
#endif
To be used as follows:
using CoordRepType FUTURE_DEPRECATED = CoordinateType;
So that the warning only appears when users enable LEGACY_REMOVE. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are compiler flags to control warnings.
I now notice: is the correct ifdef ITK_FUTURE_LEGACY_REMOVE
? You used ITK_FUTURE_REMOVE_LEGACY
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That FUTURE_DEPRECATED
macro sounds good to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the other hand, I just hope that this PR can be processed quickly, before Hans (@hjmjohnson) submits another mega-PR 😸 His PR #4996 already caused some conflicts locally, when I was preparing this PR.
8ac75d5
to
836d2a6
Compare
"CoordinateType" appears more readable than "CoordRepType". Using Notepad++, Replace in Files, doing: Find what: ( [ ]+)using CoordRepType = (\w+); Replace with: $1using CoordinateType = $2;\r\n$1using CoordRepType = CoordinateType; Filters: itk*.h Directory: D:\src\ITK\Modules [v] Match case (*) Regular expression Manually excluded "itkQuadEdgeMeshEulerOperatorsTestHelper.h", as it only declares `CoordRepType` locally inside a function. - Follow-up to pull request InsightSoftwareConsortium#4995 commit c1d9ff5 "STYLE: Rename `TCoordRep` template parameters to `TCoordinate`"
Did Replace in Files on "itk*Test*.cxx" and "itk*Test*.h".
Did Notepad++ Replace in Files in ITK/Modules, on "itk*.cxx", "itk*.hxx", and "itk*.h". Skipped the `using CoordRepType = CoordinateType` declarations.
Deprecated using `CoordRepType`, as was suggested by Dženan Zukić.
836d2a6
to
c753171
Compare
I assume this is related to this PR. |
@jhlegarreta Thanks Jon. I see:
Do you have a clue why? Does it have 'CoordRepType' should only be removed when |
Haven't had a look/do not have time to investigate now, but my first thought was whether the |
@seanm might provide more info about the build configuration. |
Sorry I overlooked the Examples when I did this PR. I can have another look in a few hours from now. |
Addressed a compile error at Mac12.x-AppleClang-dbg-Universal saying: > MeshSpatialObject.cxx:66:13: error: no type named 'CoordRepType' in > 'itk::Mesh<float, 3, itk::DefaultDynamicMeshTraits<float, 3>>' Reported by Jon Haitz Legarreta Gorroño. - Follow-up to pull request InsightSoftwareConsortium#4997 commit 15d189f "STYLE: Replace CoordRepType with CoordinateType in ITK implementation"
Addressed a compile error at Mac12.x-AppleClang-dbg-Universal saying: > MeshSpatialObject.cxx:66:13: error: no type named 'CoordRepType' in > 'itk::Mesh<float, 3, itk::DefaultDynamicMeshTraits<float, 3>>' Reported by Jon Haitz Legarreta Gorroño. - Follow-up to pull request #4997 commit 15d189f "STYLE: Replace CoordRepType with CoordinateType in ITK implementation"
Follow-up to pull request InsightSoftwareConsortium#4997 commit 5ea1a9a "ENH: Add nested CoordinateType aliases as alternative to CoordRepType"
Follow-up to pull request InsightSoftwareConsortium#4997 commit 324eaf1 "STYLE: Replace CoordRepType with CoordinateType in tests"
Follow-up to pull request InsightSoftwareConsortium#4997 commit 15d189f "STYLE: Replace CoordRepType with CoordinateType in ITK implementation"
Follow-up to pull request InsightSoftwareConsortium#4997 commit e667fa3 "ENH: Deprecate (FUTURE REMOVE) CoordRepType in favor of CoordinateType"
Follow-up to pull request InsightSoftwareConsortium#4997 commit 15d189f "STYLE: Replace CoordRepType with CoordinateType in ITK implementation"
Follow-up to pull request InsightSoftwareConsortium#4997 commit e667fa3 "ENH: Deprecate (FUTURE REMOVE) CoordRepType in favor of CoordinateType"
Redid pull request InsightSoftwareConsortium#4997 commit 5ea1a9a on release-5.4
Addressed the warnings at https://open.cdash.org/viewBuildError.php?type=1&buildid=10063093 reported by Dženan Zukić at InsightSoftwareConsortium/ITK#5006 (comment) Following ITK pull request InsightSoftwareConsortium/ITK#4997 commit InsightSoftwareConsortium/ITK@e667fa3
Added note about `CoordRepType` being replaced with `CoordinateType`. Follow-up to: - pull request InsightSoftwareConsortium#5006 commit a68b8f6 "ENH: FUTURE REMOVE `...CoordRepType` in favor of `...CoordinateType`" - pull request InsightSoftwareConsortium#4997 commit e667fa3 "ENH: Deprecate (FUTURE REMOVE) CoordRepType in favor of CoordinateType"
Following ITK pull request InsightSoftwareConsortium/ITK#4997 "Deprecate `CoordRepType` and replace it with `CoordinateType`"
Following ITK pull request InsightSoftwareConsortium/ITK#4997 "Deprecate `CoordRepType` and replace it with `CoordinateType`"
Following ITK pull request InsightSoftwareConsortium/ITK#4997 "Deprecate `CoordRepType` and replace it with `CoordinateType`"
"CoordinateType" appears more readable than "CoordRepType".
Using Notepad++, Replace in Files, doing:
TCoordRep
template parameters toTCoordinate
#4995