Skip to content
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

Merged
merged 4 commits into from
Nov 29, 2024

Conversation

N-Dekker
Copy link
Contributor

"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

@github-actions github-actions bot added type:Enhancement Improvement of existing methods or implementation type:Testing Ensure that the purpose of a class is met/the results on a wide set of test cases are correct area:Core Issues affecting the Core module area:Filtering Issues affecting the Filtering module area:Registration Issues affecting the Registration module area:Segmentation Issues affecting the Segmentation module labels Nov 27, 2024
Copy link
Member

@dzenanz dzenanz left a 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.

@github-actions github-actions bot added area:IO Issues affecting the IO module area:Video Issues affecting the Video module area:Numerics Issues affecting the Numerics module labels Nov 27, 2024
@N-Dekker N-Dekker changed the title ENH: Added nested CoordinateType aliases as alternative to CoordRepType Deprecate CoordRepType and replace it with CoordinateType Nov 27, 2024
Comment on lines 93 to 96
using CoordRepType = CoordinateType;
#ifndef ITK_FUTURE_REMOVE_LEGACY
using CoordRepType [[deprecated("ITK 6 discourages using `CoordRepType`. Please use `CoordinateType` instead!")]] =
CoordinateType;
#endif
Copy link
Contributor Author

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?

Copy link
Contributor Author

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?

Copy link
Member

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.

Copy link
Member

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.

Copy link
Contributor Author

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.

@github-actions github-actions bot removed the type:Enhancement Improvement of existing methods or implementation label Nov 27, 2024
@N-Dekker N-Dekker marked this pull request as ready for review November 27, 2024 21:21
"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ć.
@dzenanz dzenanz merged commit e667fa3 into InsightSoftwareConsortium:master Nov 29, 2024
17 checks passed
@jhlegarreta
Copy link
Member

I assume this
https://open.cdash.org/viewBuildError.php?onlydeltap&buildid=10058584

is related to this PR.

@N-Dekker
Copy link
Contributor Author

N-Dekker commented Dec 2, 2024

@jhlegarreta Thanks Jon. I see:

/Users/builder/externalExamples/SpatialObjects/MeshSpatialObject.cxx:66:13: error: no type named 'CoordRepType' in 'itk::Mesh<float, 3, itk::DefaultDynamicMeshTraits<float, 3>>'

Do you have a clue why? Does it have ITK_FUTURE_LEGACY_REMOVE defined?

'CoordRepType' should only be removed when ITK_FUTURE_LEGACY_REMOVE is defined:

https://github.com/N-Dekker/ITK/blob/c753171d0b6461e947f2d9ec8fe808392e4bfd01/Modules/Core/Mesh/include/itkMesh.h#L172-L174

@jhlegarreta
Copy link
Member

Haven't had a look/do not have time to investigate now, but my first thought was whether the Examples were included in your set of changes.

@dzenanz
Copy link
Member

dzenanz commented Dec 2, 2024

@seanm might provide more info about the build configuration.

@N-Dekker
Copy link
Contributor Author

N-Dekker commented Dec 2, 2024

Sorry I overlooked the Examples when I did this PR. I can have another look in a few hours from now.

N-Dekker added a commit to N-Dekker/ITK that referenced this pull request Dec 2, 2024
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"
hjmjohnson pushed a commit that referenced this pull request Dec 2, 2024
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"
N-Dekker added a commit to N-Dekker/ITK that referenced this pull request Dec 3, 2024
Follow-up to pull request InsightSoftwareConsortium#4997
commit 5ea1a9a
"ENH: Add nested CoordinateType aliases as alternative to CoordRepType"
N-Dekker added a commit to N-Dekker/ITK that referenced this pull request Dec 3, 2024
Follow-up to pull request InsightSoftwareConsortium#4997
commit 324eaf1
"STYLE: Replace CoordRepType with CoordinateType in tests"
N-Dekker added a commit to N-Dekker/ITK that referenced this pull request Dec 3, 2024
Follow-up to pull request InsightSoftwareConsortium#4997
commit 15d189f
"STYLE: Replace CoordRepType with CoordinateType in ITK implementation"
N-Dekker added a commit to N-Dekker/ITK that referenced this pull request Dec 3, 2024
Follow-up to pull request InsightSoftwareConsortium#4997
commit e667fa3
"ENH: Deprecate (FUTURE REMOVE) CoordRepType in favor of CoordinateType"
N-Dekker added a commit to N-Dekker/ITK that referenced this pull request Dec 3, 2024
Follow-up to pull request InsightSoftwareConsortium#4997
commit 15d189f
"STYLE: Replace CoordRepType with CoordinateType in ITK implementation"
N-Dekker added a commit to N-Dekker/ITK that referenced this pull request Dec 3, 2024
Follow-up to pull request InsightSoftwareConsortium#4997
commit e667fa3
"ENH: Deprecate (FUTURE REMOVE) CoordRepType in favor of CoordinateType"
hjmjohnson pushed a commit that referenced this pull request Dec 4, 2024
Follow-up to pull request #4997
commit 5ea1a9a
"ENH: Add nested CoordinateType aliases as alternative to CoordRepType"
hjmjohnson pushed a commit that referenced this pull request Dec 4, 2024
Follow-up to pull request #4997
commit 324eaf1
"STYLE: Replace CoordRepType with CoordinateType in tests"
hjmjohnson pushed a commit that referenced this pull request Dec 4, 2024
Follow-up to pull request #4997
commit 15d189f
"STYLE: Replace CoordRepType with CoordinateType in ITK implementation"
hjmjohnson pushed a commit that referenced this pull request Dec 4, 2024
Follow-up to pull request #4997
commit e667fa3
"ENH: Deprecate (FUTURE REMOVE) CoordRepType in favor of CoordinateType"
N-Dekker added a commit to N-Dekker/ITK that referenced this pull request Dec 4, 2024
hjmjohnson pushed a commit that referenced this pull request Dec 5, 2024
N-Dekker added a commit to N-Dekker/ITKMontage that referenced this pull request Dec 6, 2024
N-Dekker added a commit to N-Dekker/ITK that referenced this pull request Dec 16, 2024
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"
hjmjohnson pushed a commit that referenced this pull request Dec 16, 2024
Added note about `CoordRepType` being replaced with `CoordinateType`.

Follow-up to:
- pull request #5006
commit a68b8f6
"ENH: FUTURE REMOVE `...CoordRepType` in favor of `...CoordinateType`"
- pull request #4997
commit e667fa3
"ENH: Deprecate (FUTURE REMOVE) CoordRepType in favor of CoordinateType"
N-Dekker added a commit to SuperElastix/elastix that referenced this pull request Jan 8, 2025
Following ITK pull request InsightSoftwareConsortium/ITK#4997 "Deprecate `CoordRepType` and replace it with `CoordinateType`"
N-Dekker added a commit to SuperElastix/elastix that referenced this pull request Jan 8, 2025
Following ITK pull request InsightSoftwareConsortium/ITK#4997 "Deprecate `CoordRepType` and replace it with `CoordinateType`"
N-Dekker added a commit to SuperElastix/elastix that referenced this pull request Jan 9, 2025
Following ITK pull request InsightSoftwareConsortium/ITK#4997 "Deprecate `CoordRepType` and replace it with `CoordinateType`"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:Core Issues affecting the Core module area:Filtering Issues affecting the Filtering module area:IO Issues affecting the IO module area:Numerics Issues affecting the Numerics module area:Registration Issues affecting the Registration module area:Segmentation Issues affecting the Segmentation module area:Video Issues affecting the Video module type:Testing Ensure that the purpose of a class is met/the results on a wide set of test cases are correct
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants