Skip to content

BUG: Do not print non-self member variables in PrintSelf#3066

Merged
dzenanz merged 1 commit intoInsightSoftwareConsortium:masterfrom
jhlegarreta:DoNotPrintNonSelfMembersInPrintSelf
Jan 8, 2022
Merged

BUG: Do not print non-self member variables in PrintSelf#3066
dzenanz merged 1 commit intoInsightSoftwareConsortium:masterfrom
jhlegarreta:DoNotPrintNonSelfMembersInPrintSelf

Conversation

@jhlegarreta
Copy link
Copy Markdown
Member

Do not print non-self member variables in PrintSelf.

Fixes

  CurrentPosition: ITK test driver caught an ITK exception:

itk::ExceptionObject (0x55be11155e70)
Location: "unknown"
File: /home/vsts/work/1/s/Modules/Numerics/Optimizersv4/src/itkObjectToObjectOptimizerBase.cxx
Line: 201
Description: ITK ERROR: LBFGSBOptimizerv4(0x55be11150c00): m_Metric has not been assigned. Cannot get parameters.

raised in:
https://open.cdash.org/test/583682381

PR Checklist

Do not print non-self member variables in `PrintSelf`.

Fixes
```
  CurrentPosition: ITK test driver caught an ITK exception:

itk::ExceptionObject (0x55be11155e70)
Location: "unknown"
File: /home/vsts/work/1/s/Modules/Numerics/Optimizersv4/src/itkObjectToObjectOptimizerBase.cxx
Line: 201
Description: ITK ERROR: LBFGSBOptimizerv4(0x55be11150c00): m_Metric has not been assigned. Cannot get parameters.
```

raised in:
https://open.cdash.org/test/583682381
@github-actions github-actions Bot added area:Numerics Issues affecting the Numerics module type:Bug Inconsistencies or issues which will cause an incorrect result under some or all circumstances labels Jan 8, 2022
@jhlegarreta
Copy link
Copy Markdown
Member Author

#3062 passing relies on this fix.

Also, note that this is the minimum set of changes required to fix the issue, but the itk::LBFGSBOptimizerv4::PrintSelf method is printing many non-self members. Probably other optimization classes are as well, and the issue might involve the related metrics or transforms (e.g. there is no m_CurrentPosition in any superclass or related metrics, except for a few specialized optimizers) . Might have been an effect of the non-v4 classes. It should be should be addressed in a separate PR.

@jhlegarreta
Copy link
Copy Markdown
Member Author

/azp run ITK.macOS

@dzenanz dzenanz merged commit 44e3199 into InsightSoftwareConsortium:master Jan 8, 2022
@jhlegarreta jhlegarreta deleted the DoNotPrintNonSelfMembersInPrintSelf branch January 8, 2022 23:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:Numerics Issues affecting the Numerics module type:Bug Inconsistencies or issues which will cause an incorrect result under some or all circumstances

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants