diff --git a/CHANGELOG.md b/CHANGELOG.md index 7bafd45c3..6b587ce19 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## v1.68.1 (2024-01-29) + +### Bug Fixes and Other Changes + + * add force flag for import testing + ## v1.68.0 (2024-01-25) ### Features diff --git a/doc/conf.py b/doc/conf.py index 23e9abdcf..2a8193e55 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -1,4 +1,5 @@ """Sphinx configuration.""" + import datetime import pkg_resources diff --git a/src/braket/_sdk/_version.py b/src/braket/_sdk/_version.py index 051177529..36ac7a1eb 100644 --- a/src/braket/_sdk/_version.py +++ b/src/braket/_sdk/_version.py @@ -15,4 +15,4 @@ Version number (major.minor.patch[-label]) """ -__version__ = "1.68.1.dev0" +__version__ = "1.68.2.dev0" diff --git a/src/braket/aws/aws_device.py b/src/braket/aws/aws_device.py index 503834dd8..14adacb3a 100644 --- a/src/braket/aws/aws_device.py +++ b/src/braket/aws/aws_device.py @@ -332,9 +332,11 @@ def _get_regional_device_session(self, session: AwsSession) -> AwsSession: self._populate_properties(region_session) return region_session except ClientError as e: - raise ValueError(f"'{self._arn}' not found") if e.response["Error"][ - "Code" - ] == "ResourceNotFoundException" else e + raise ( + ValueError(f"'{self._arn}' not found") + if e.response["Error"]["Code"] == "ResourceNotFoundException" + else e + ) def _get_non_regional_device_session(self, session: AwsSession) -> AwsSession: current_region = session.region diff --git a/src/braket/aws/aws_quantum_job.py b/src/braket/aws/aws_quantum_job.py index 562c61ba8..31347311e 100644 --- a/src/braket/aws/aws_quantum_job.py +++ b/src/braket/aws/aws_quantum_job.py @@ -609,9 +609,11 @@ def _initialize_regional_device_session( aws_session.get_device(device) return aws_session except ClientError as e: - raise ValueError(f"'{device}' not found.") if e.response["Error"][ - "Code" - ] == "ResourceNotFoundException" else e + raise ( + ValueError(f"'{device}' not found.") + if e.response["Error"]["Code"] == "ResourceNotFoundException" + else e + ) @staticmethod def _initialize_non_regional_device_session( diff --git a/src/braket/aws/aws_quantum_task.py b/src/braket/aws/aws_quantum_task.py index 0785c03c5..7b349310b 100644 --- a/src/braket/aws/aws_quantum_task.py +++ b/src/braket/aws/aws_quantum_task.py @@ -534,9 +534,9 @@ def _download_result( "has_reservation_arn": self._has_reservation_arn_from_metadata(current_metadata), } try: - task_event[ - "execution_duration" - ] = self._result.additional_metadata.simulatorMetadata.executionDuration + task_event["execution_duration"] = ( + self._result.additional_metadata.simulatorMetadata.executionDuration + ) except AttributeError: pass broadcast_event(_TaskCompletionEvent(**task_event)) diff --git a/src/braket/circuits/gate.py b/src/braket/circuits/gate.py index 2183a2329..907c495ce 100644 --- a/src/braket/circuits/gate.py +++ b/src/braket/circuits/gate.py @@ -180,9 +180,11 @@ def _to_openqasm( for state, group in groupby(control_basis_state.as_tuple): modifier_name = "neg" * (not state) + "ctrl" control_modifiers += [ - f"{modifier_name}" - if (num_control := len(list(group))) == 1 - else f"{modifier_name}({num_control})" + ( + f"{modifier_name}" + if (num_control := len(list(group))) == 1 + else f"{modifier_name}({num_control})" + ) ] control_modifiers.append("") qubits = control_qubits + target_qubits diff --git a/src/braket/pulse/pulse_sequence.py b/src/braket/pulse/pulse_sequence.py index bb783c69b..98ea3c381 100644 --- a/src/braket/pulse/pulse_sequence.py +++ b/src/braket/pulse/pulse_sequence.py @@ -387,10 +387,10 @@ def _parse_from_calibration_schema( argument_value.update(QubitSet(int(argument["value"]))) instr_args["qubits_or_frames"] = argument_value elif argument["name"] in instr_args_keys: - instr_args[ - argument["name"] - ] = calibration_sequence._parse_arg_from_calibration_schema( - argument, waveforms, frames + instr_args[argument["name"]] = ( + calibration_sequence._parse_arg_from_calibration_schema( + argument, waveforms, frames + ) ) else: instr_args["qubits_or_frames"] = [] diff --git a/src/braket/quantum_information/pauli_string.py b/src/braket/quantum_information/pauli_string.py index 8dca06625..f1ca55406 100644 --- a/src/braket/quantum_information/pauli_string.py +++ b/src/braket/quantum_information/pauli_string.py @@ -101,9 +101,11 @@ def weight_n_substrings(self, weight: int) -> tuple[PauliString, ...]: substrings = [] for indices in itertools.combinations(self._nontrivial, weight): factors = [ - self._nontrivial[qubit] - if qubit in set(indices).intersection(self._nontrivial) - else "I" + ( + self._nontrivial[qubit] + if qubit in set(indices).intersection(self._nontrivial) + else "I" + ) for qubit in range(self._qubit_count) ] substrings.append( diff --git a/test/unit_tests/braket/aws/common_test_utils.py b/test/unit_tests/braket/aws/common_test_utils.py index 2975912f1..f1d6d96df 100644 --- a/test/unit_tests/braket/aws/common_test_utils.py +++ b/test/unit_tests/braket/aws/common_test_utils.py @@ -353,12 +353,14 @@ def _create_task_args_and_kwargs( create_kwargs = extra_kwargs or {} create_kwargs.update( { - "poll_timeout_seconds": poll_timeout_seconds - if poll_timeout_seconds is not None - else default_poll_timeout, - "poll_interval_seconds": poll_interval_seconds - if poll_interval_seconds is not None - else default_poll_interval, + "poll_timeout_seconds": ( + poll_timeout_seconds if poll_timeout_seconds is not None else default_poll_timeout + ), + "poll_interval_seconds": ( + poll_interval_seconds + if poll_interval_seconds is not None + else default_poll_interval + ), "inputs": inputs, "gate_definitions": gate_definitions, "reservation_arn": reservation_arn, diff --git a/test/unit_tests/braket/test_imports.py b/test/unit_tests/braket/test_imports.py index bd545d943..728c6311f 100644 --- a/test/unit_tests/braket/test_imports.py +++ b/test/unit_tests/braket/test_imports.py @@ -13,7 +13,7 @@ def test_for_import_cycles(): # parameterized version wasn't able to correctly detect some circular imports when running tox. modules = get_modules_to_test() processes = [] - multiprocessing.set_start_method("spawn") + multiprocessing.set_start_method("spawn", force=True) for module in modules: # We create a separate process to make sure the imports do not interfere with each-other. process = multiprocessing.Process(target=import_module, args=(module,))