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

Set aliases: ISTA=PGD, FISTA=APGD #2007

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

MargaretDuff
Copy link
Member

@MargaretDuff MargaretDuff commented Dec 10, 2024

Changes

ISTA now has the alternative name PGD and FISTA has the alternative APGD. These aliases have identical functionality as the original

Testing you performed

Please add any demo scripts to https://github.com/TomographicImaging/CIL-Demos/tree/main/misc

Related issues/links

Closes #2005

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

@MargaretDuff MargaretDuff linked an issue Dec 10, 2024 that may be closed by this pull request
@MargaretDuff
Copy link
Member Author

I wonder if there is a better unit test I can run?

@lauramurgatroyd
Copy link
Member

lauramurgatroyd commented Dec 12, 2024

You could write a unit test that instantiates PGD and check that it calls init of ISTA
from unittest.mock import patch

In this example we mock a method using patch:
https://github.com/TomographicImaging/eqt/blob/c3ae2b44a92d8cc1e35bb6b9a4d0c2bbd98dc027/test/test_SessionDialogs.py#L86-L90
We then check that the method has been called.

The method you would mock could be ISTA's init and then you could make an instance of PGD and check the ISTA init is called once.

There is also this method: https://docs.python.org/3/library/unittest.mock.html#unittest.mock.Mock.assert_called_once
which checks also that the args are passed to the method

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Alias ISTA-->PGD and FISTA-->APGD
2 participants