diff --git a/cirq-google/cirq_google/__init__.py b/cirq-google/cirq_google/__init__.py index 0d2bc530477..86ddb2249fd 100644 --- a/cirq-google/cirq_google/__init__.py +++ b/cirq-google/cirq_google/__init__.py @@ -29,7 +29,6 @@ from cirq_google.engine import ( Calibration as Calibration, CalibrationLayer as CalibrationLayer, - CalibrationResult as CalibrationResult, Engine as Engine, EngineJob as EngineJob, EngineProgram as EngineProgram, diff --git a/cirq-google/cirq_google/engine/__init__.py b/cirq-google/cirq_google/engine/__init__.py index 30e8fb0aba8..743d02eb986 100644 --- a/cirq-google/cirq_google/engine/__init__.py +++ b/cirq-google/cirq_google/engine/__init__.py @@ -48,8 +48,6 @@ from cirq_google.engine.calibration_layer import CalibrationLayer as CalibrationLayer -from cirq_google.engine.calibration_result import CalibrationResult as CalibrationResult - from cirq_google.engine.calibration_to_noise_properties import ( noise_properties_from_calibration as noise_properties_from_calibration, ) diff --git a/cirq-google/cirq_google/engine/calibration_result.py b/cirq-google/cirq_google/engine/calibration_result.py deleted file mode 100644 index 44353776d57..00000000000 --- a/cirq-google/cirq_google/engine/calibration_result.py +++ /dev/null @@ -1,77 +0,0 @@ -# Copyright 2020 The Cirq Developers -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -from __future__ import annotations - -import dataclasses -import datetime -from typing import Any, TYPE_CHECKING - -if TYPE_CHECKING: - import cirq_google - - -@dataclasses.dataclass -class CalibrationResult: - """Python implementation of the proto found in - cirq_google.api.v2.calibration_pb2.CalibrationLayerResult for use - in Engine calls. - - Note that, if these fields are not filled out by the calibration API, - they will be set to the default values in the proto, as defined here: - https://developers.google.com/protocol-buffers/docs/proto3#default - These defaults will converted to `None` by the API client. - - Deprecated: Calibrations are no longer supported via cirq. - """ - - code: Any - error_message: str | None - token: str | None - valid_until: datetime.datetime | None - metrics: cirq_google.Calibration - - @classmethod - def _from_json_dict_( - cls, - code: Any, - error_message: str | None, - token: str | None, - utc_valid_until: float, - metrics: cirq_google.Calibration, - **kwargs, - ) -> CalibrationResult: - """Magic method for the JSON serialization protocol.""" - valid_until = ( - datetime.datetime.utcfromtimestamp(utc_valid_until) - if utc_valid_until is not None - else None - ) - return cls(code, error_message, token, valid_until, metrics) - - def _json_dict_(self) -> dict[str, Any]: - """Magic method for the JSON serialization protocol.""" - utc_valid_until = ( - self.valid_until.replace(tzinfo=datetime.timezone.utc).timestamp() - if self.valid_until is not None - else None - ) - return { - 'code': self.code, - 'error_message': self.error_message, - 'token': self.token, - 'utc_valid_until': utc_valid_until, - 'metrics': self.metrics, - } diff --git a/cirq-google/cirq_google/engine/engine_job.py b/cirq-google/cirq_google/engine/engine_job.py index e169ff994d2..b2b6ee6b579 100644 --- a/cirq-google/cirq_google/engine/engine_job.py +++ b/cirq-google/cirq_google/engine/engine_job.py @@ -31,7 +31,6 @@ from google.protobuf import any_pb2 import cirq_google.engine.engine as engine_base - from cirq_google.engine.calibration_result import CalibrationResult from cirq_google.engine.engine import engine_processor, engine_program TERMINAL_STATES = [ @@ -91,7 +90,6 @@ def __init__( self.context = context self._job = _job self._results: Sequence[EngineResult] | None = None - self._calibration_results: Sequence[CalibrationResult] | None = None self._batched_results: Sequence[Sequence[EngineResult]] | None = None self._job_result_future = job_result_future diff --git a/cirq-google/cirq_google/json_test_data/spec.py b/cirq-google/cirq_google/json_test_data/spec.py index 8021a72091a..47e24b36b6b 100644 --- a/cirq-google/cirq_google/json_test_data/spec.py +++ b/cirq-google/cirq_google/json_test_data/spec.py @@ -29,7 +29,6 @@ 'ProcessorSampler', 'ValidatingSampler', 'CouldNotPlaceError', - 'CalibrationResult', # Abstract: 'ExecutableSpec', ],