diff --git a/cirq-core/cirq/study/result.py b/cirq-core/cirq/study/result.py index 968b03b0d5c..ec16b028883 100644 --- a/cirq-core/cirq/study/result.py +++ b/cirq-core/cirq/study/result.py @@ -35,7 +35,7 @@ import pandas as pd from cirq import value, ops -from cirq._compat import deprecated, proper_repr, _warn_or_error +from cirq._compat import proper_repr from cirq.study import resolver if TYPE_CHECKING: @@ -85,15 +85,6 @@ def _key_to_str(key: TMeasurementKey) -> str: class Result(abc.ABC): """The results of multiple executions of a circuit with fixed parameters.""" - def __new__(cls, *args, **kwargs): - if cls is Result: - _warn_or_error( - "Result constructor is deprecated and will be removed in cirq v0.15. " - "Use the ResultDict constructor instead, or another concrete subclass." - ) - return ResultDict(*args, **kwargs) - return super().__new__(cls) - @property @abc.abstractmethod def params(self) -> 'cirq.ParamResolver': @@ -153,29 +144,6 @@ def dataframe_from_measurements(measurements: Mapping[str, np.ndarray]) -> pd.Da dtype = object if any(bs.shape[1] > 63 for _, bs in measurements.items()) else np.int64 return pd.DataFrame(converted_dict, dtype=dtype) - @staticmethod - @deprecated( - deadline="v0.15", - fix="The static method from_single_parameter_set is deprecated. " - "Use the ResultDict constructor instead.", - ) - def from_single_parameter_set( - *, # Forces keyword args. - params: resolver.ParamResolver, - measurements: Mapping[str, np.ndarray], - ) -> 'cirq.Result': - """Packages runs of a single parameterized circuit into a Result. - - Args: - params: A ParamResolver of settings used for this result. - measurements: A dictionary from measurement gate key to measurement - results. The value for each key is a 2-D array of booleans, - with the first index running over the repetitions, and the - second index running over the qubits for the corresponding - measurements. - """ - return ResultDict(params=params, measurements=measurements) - @property def repetitions(self) -> int: if not self.records: diff --git a/cirq-core/cirq/study/result_test.py b/cirq-core/cirq/study/result_test.py index abd91e9a872..a335bed2859 100644 --- a/cirq-core/cirq/study/result_test.py +++ b/cirq-core/cirq/study/result_test.py @@ -66,20 +66,6 @@ def test_repr(): cirq.testing.assert_equivalent_repr(v) -def test_result_constructor_deprecation(): - with cirq.testing.assert_deprecated("Use the ResultDict constructor", deadline="v0.15"): - result = cirq.Result(params=cirq.ParamResolver({}), measurements={}) - assert result.repetitions == 0 - - -def test_from_single_parameter_set_deprecation(): - with cirq.testing.assert_deprecated("Use the ResultDict constructor", deadline="v0.15"): - result = cirq.Result.from_single_parameter_set( - params=cirq.ParamResolver({}), measurements={} - ) - assert result.repetitions == 0 - - def test_construct_from_measurements(): r = cirq.ResultDict( params=None,