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

Merged
merged 14 commits into from
Oct 24, 2024
6 changes: 6 additions & 0 deletions qiskit_ibm_runtime/ibm_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,12 @@ def target_history(self, datetime: Optional[python_datetime] = None) -> Target:
self._convert_to_target(refresh=True)
return self._target

def refresh(self) -> None:
"""Refresh the current backend target"""
self._get_properties(datetime=python_datetime.now())
self._get_defaults()
self._convert_to_target(refresh=True)

def properties(
self, refresh: bool = False, datetime: Optional[python_datetime] = None
) -> Optional[BackendProperties]:
Expand Down
2 changes: 2 additions & 0 deletions release-notes/unreleased/1955.feat.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Added a new method, ``backend.refresh()`` that refreshes the
current backend target with the latest updates from the server.