Skip to content

Fix deprecation warning for rtol and atol in GD - #2056

Merged
gfardell merged 3 commits into
TomographicImaging:masterfrom
emmanuel-ferdman:master
Jan 31, 2025
Merged

Fix deprecation warning for rtol and atol in GD#2056
gfardell merged 3 commits into
TomographicImaging:masterfrom
emmanuel-ferdman:master

Conversation

@emmanuel-ferdman

@emmanuel-ferdman emmanuel-ferdman commented Jan 29, 2025

Copy link
Copy Markdown
Contributor

Description

The commit contains the following changes:

  • Avoid printing deprecation warnings for rtol and atol when they are not passed to the GC constructor (or passed with None).
  • Replace the deprecated log.warn() with log.warning() as log.warn() was deprecated in Python 3.3. See cpython-#105376 for more details.

Example Usage

myGD_LS = GD(initial=x0, f=f1, step_size=None, update_objective_interval=10)

Related issues/links

Checklist

  • I have performed a self-review of my code
  • I have added docstrings in line with the guidance in the developer guide
  • I have updated the relevant documentation
  • I have implemented unit tests that cover any new or modified functionality
  • CHANGELOG.md has been updated with any functionality change
  • Request review from all relevant developers
  • Change pull request label to 'Waiting for review'

Contribution Notes

Please read and adhere to the developer guide and local patterns and conventions.

  • The content of this Pull Request (the Contribution) is intentionally submitted for inclusion in CIL (the Work) under the terms and conditions of the Apache-2.0 License
  • I confirm that the contribution does not violate any intellectual property rights of third parties

@gfardell

Copy link
Copy Markdown
Member

Thank you very much for your contribution. It looks like sensible logic on when to raise the warning.

Would you like to add your name and institute (if applicable) to our maintained list of contributors?https://github.com/TomographicImaging/CIL/blob/master/NOTICE.txt

If you'd prefer not to, we'll still merge your contribution and acknowledge you via you github handle in our release notes.

@gfardell

Copy link
Copy Markdown
Member

I think if you add "Independent Contributor" as number 14 in the institutions key that would be best, then we have it explicitly stated.

@gfardell gfardell left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution @emmanuel-ferdman

@MargaretDuff MargaretDuff left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution!

Signed-off-by: Margaret Duff <[email protected]>
@MargaretDuff
MargaretDuff self-requested a review January 31, 2025 09:29
@gfardell
gfardell merged commit 5749b38 into TomographicImaging:master Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GD raises deprecation warning if atol and rtol are not used

3 participants