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

Add backend refresh() method #1955

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open

Conversation

kt474
Copy link
Member

@kt474 kt474 commented Sep 30, 2024

Summary

Details and comments

Fixes #

@kt474 kt474 added the Changelog: New Feature Include in the Added section of the changelog label Sep 30, 2024
@kt474 kt474 requested a review from jyu00 September 30, 2024 18:45
Copy link
Collaborator

@jyu00 jyu00 left a comment

Choose a reason for hiding this comment

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

can you also add a test?

qiskit_ibm_runtime/ibm_backend.py Outdated Show resolved Hide resolved
instance=self._instance,
):
self._configuration = config
self._get_properties(datetime=python_datetime.now())
Copy link
Collaborator

Choose a reason for hiding this comment

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

Looking at the code, _get_properties() and properties() seem to nearly identical, with the exception that the latter support refresh. I wonder if we can consolidate them and just pass refresh=True.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah I think we can consolidate the two methods - i'll do that when fixing #1956

Copy link
Collaborator

Choose a reason for hiding this comment

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

ok is the plan to use _get_properties(datetime) in this PR and then switch to using properties() after #1956 is done?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah I think it's easier that way

test/integration/test_backend.py Outdated Show resolved Hide resolved
):
self._configuration = config
self._get_properties(datetime=python_datetime.now())
self._get_defaults()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks like _get_defaults also uses cached data if it already exists.

def _get_defaults(self) -> None:
"""Gets defaults if pulse backend and decodes it"""
if not self._defaults and isinstance(self._configuration, PulseBackendConfiguration):

@kt474 kt474 added this to the 0.32.0 milestone Oct 17, 2024
@kt474 kt474 requested a review from jyu00 October 17, 2024 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: New Feature Include in the Added section of the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants