Skip to content

Commit

Permalink
delete get_service_from_backend(
Browse files Browse the repository at this point in the history
  • Loading branch information
1ucian0 committed Nov 18, 2024
1 parent d0d53da commit d23247a
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions qiskit_experiments/framework/experiment_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,10 +262,6 @@ def __init__(
if provider is None and backend is not None:
self.provider = backend.provider
self._service = service
if self._service is None and self.provider is not None:
self._service = self.get_service_from_provider(self.provider)
if self._service is None and self.provider is None and self.backend is not None:
self._service = self.get_service_from_backend(self.backend)
self._auto_save = False
self._created_in_db = False
self._extra_data = kwargs
Expand Down Expand Up @@ -2377,12 +2373,6 @@ def load(
Raises:
ExperimentDataError: If not service nor provider were given.
"""
if service is None:
if provider is None:
raise ExperimentDataError(
"Loading an experiment requires a valid Qiskit provider or experiment service."
)
service = cls.get_service_from_provider(provider)
data = service.experiment(experiment_id, json_decoder=cls._json_decoder)
if service.experiment_has_file(experiment_id, cls._metadata_filename):
metadata = service.file_download(
Expand Down Expand Up @@ -2685,25 +2675,6 @@ def get_service_from_backend(backend):
except Exception: # pylint: disable=broad-except
return None

@staticmethod
def get_service_from_provider(provider):
"""Initializes the service from the provider data"""
try:
# qiskit-ibm-provider style
if hasattr(provider, "_account"):
warnings.warn(
"qiskit-ibm-provider has been deprecated in favor of qiskit-ibm-runtime. Support"
"for qiskit-ibm-provider backends will be removed in Qiskit Experiments 0.7.",
DeprecationWarning,
stacklevel=2,
)
return IBMExperimentService(
token=provider._account.token, url=provider._account.url
)
return None
except Exception: # pylint: disable=broad-except
return None

def __setstate__(self, state):
self.__dict__.update(state)
# Initialize non-pickled attributes
Expand Down

0 comments on commit d23247a

Please sign in to comment.