From 378d7e428f370ea8acceec799d04722a1c1fb408 Mon Sep 17 00:00:00 2001 From: ThomasReisser90 Date: Mon, 29 Apr 2024 11:31:00 +0200 Subject: [PATCH] Changed macOS test version to 13 instead of latest due to missing Python versions, increased QuOCS version number, added plt.close() to pytests --- .github/workflows/unit_testing_macOS.yml | 2 +- src/quocslib/__init__.py | 2 +- tests/test_custom_scaling_only_t.py | 2 ++ tests/test_custom_scaling_t_and_pulse.py | 2 ++ tests/test_dCRAB_Fourier_NM_OneQubit.py | 2 ++ tests/test_dCRAB_Fourier_NM_OneQubit_json_dump.py | 2 ++ tests/test_dCRAB_drift_compensation.py | 2 ++ tests/test_dCRAB_noisy_and_reeval_steps.py | 2 ++ tests/test_dCRAB_shrink_option.py | 2 ++ tests/test_mixed_dCRAB_Fourier_NM_OneQubit.py | 2 ++ 10 files changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/unit_testing_macOS.yml b/.github/workflows/unit_testing_macOS.yml index adfc010..01d39ba 100644 --- a/.github/workflows/unit_testing_macOS.yml +++ b/.github/workflows/unit_testing_macOS.yml @@ -11,7 +11,7 @@ on: jobs: test: - runs-on: macOS-latest + runs-on: macOS-13 strategy: matrix: python-version: [ '3.6', '3.7', '3.8', '3.9', '3.10', '3.11' ] diff --git a/src/quocslib/__init__.py b/src/quocslib/__init__.py index aac089d..4527b63 100644 --- a/src/quocslib/__init__.py +++ b/src/quocslib/__init__.py @@ -1,3 +1,3 @@ from __future__ import absolute_import, division, print_function, unicode_literals -__VERSION__ = "0.0.58" +__VERSION__ = "0.0.59" diff --git a/tests/test_custom_scaling_only_t.py b/tests/test_custom_scaling_only_t.py index 4d3bff5..a028276 100644 --- a/tests/test_custom_scaling_only_t.py +++ b/tests/test_custom_scaling_only_t.py @@ -52,6 +52,7 @@ def plot_FoM(result_path, FoM_filename): plt.ylabel('FoM', fontsize=20) # plt.savefig(os.path.join(folder, save_name + '.pdf')) plt.savefig(os.path.join(result_path, save_name + '.png')) + plt.close() def plot_controls(result_path): @@ -88,6 +89,7 @@ def plot_controls(result_path): plt.ylabel('Amplitude', fontsize=20) # plt.savefig(os.path.join(folder, save_name + '.pdf')) plt.savefig(os.path.join(result_path, save_name + '.png')) + plt.close() def test_custom_scaling_only_t(): diff --git a/tests/test_custom_scaling_t_and_pulse.py b/tests/test_custom_scaling_t_and_pulse.py index 6a40fbd..465b43c 100644 --- a/tests/test_custom_scaling_t_and_pulse.py +++ b/tests/test_custom_scaling_t_and_pulse.py @@ -52,6 +52,7 @@ def plot_FoM(result_path, FoM_filename): plt.ylabel('FoM', fontsize=20) # plt.savefig(os.path.join(folder, save_name + '.pdf')) plt.savefig(os.path.join(result_path, save_name + '.png')) + plt.close() def plot_controls(result_path): @@ -88,6 +89,7 @@ def plot_controls(result_path): plt.ylabel('Amplitude', fontsize=20) # plt.savefig(os.path.join(folder, save_name + '.pdf')) plt.savefig(os.path.join(result_path, save_name + '.png')) + plt.close() def test_custom_scaling_t_and_pulse(): diff --git a/tests/test_dCRAB_Fourier_NM_OneQubit.py b/tests/test_dCRAB_Fourier_NM_OneQubit.py index 31eabb1..3b71494 100644 --- a/tests/test_dCRAB_Fourier_NM_OneQubit.py +++ b/tests/test_dCRAB_Fourier_NM_OneQubit.py @@ -55,6 +55,7 @@ def plot_FoM(result_path, FoM_filename): plt.ylabel('FoM', fontsize=20) # plt.savefig(os.path.join(folder, save_name + '.pdf')) plt.savefig(os.path.join(result_path, save_name + '.png')) + plt.close() def plot_controls(result_path): @@ -91,6 +92,7 @@ def plot_controls(result_path): plt.ylabel('Amplitude', fontsize=20) # plt.savefig(os.path.join(folder, save_name + '.pdf')) plt.savefig(os.path.join(result_path, save_name + '.png')) + plt.close() def main(optimization_dictionary: dict, args_dict: dict): diff --git a/tests/test_dCRAB_Fourier_NM_OneQubit_json_dump.py b/tests/test_dCRAB_Fourier_NM_OneQubit_json_dump.py index 8c2e24c..c445076 100644 --- a/tests/test_dCRAB_Fourier_NM_OneQubit_json_dump.py +++ b/tests/test_dCRAB_Fourier_NM_OneQubit_json_dump.py @@ -55,6 +55,7 @@ def plot_FoM(result_path, FoM_filename): plt.ylabel('FoM', fontsize=20) # plt.savefig(os.path.join(folder, save_name + '.pdf')) plt.savefig(os.path.join(result_path, save_name + '.png')) + plt.close() def plot_controls(result_path): @@ -91,6 +92,7 @@ def plot_controls(result_path): plt.ylabel('Amplitude', fontsize=20) # plt.savefig(os.path.join(folder, save_name + '.pdf')) plt.savefig(os.path.join(result_path, save_name + '.png')) + plt.close() def main(optimization_dictionary: dict, args_dict: dict): diff --git a/tests/test_dCRAB_drift_compensation.py b/tests/test_dCRAB_drift_compensation.py index fc8cefa..edec1f6 100644 --- a/tests/test_dCRAB_drift_compensation.py +++ b/tests/test_dCRAB_drift_compensation.py @@ -54,6 +54,7 @@ def plot_FoM(result_path, FoM_filename): plt.ylabel('FoM', fontsize=20) # plt.savefig(os.path.join(folder, save_name + '.pdf')) plt.savefig(os.path.join(result_path, save_name + '.png')) + plt.close() def plot_controls(result_path): @@ -90,6 +91,7 @@ def plot_controls(result_path): plt.ylabel('Amplitude', fontsize=20) # plt.savefig(os.path.join(folder, save_name + '.pdf')) plt.savefig(os.path.join(result_path, save_name + '.png')) + plt.close() def test_drift_compensation_average_3_FoM_minimization(): diff --git a/tests/test_dCRAB_noisy_and_reeval_steps.py b/tests/test_dCRAB_noisy_and_reeval_steps.py index 6066eb0..0db5d40 100644 --- a/tests/test_dCRAB_noisy_and_reeval_steps.py +++ b/tests/test_dCRAB_noisy_and_reeval_steps.py @@ -55,6 +55,7 @@ def plot_FoM(result_path, FoM_filename): plt.ylabel('FoM', fontsize=20) # plt.savefig(os.path.join(folder, save_name + '.pdf')) plt.savefig(os.path.join(result_path, save_name + '.png')) + plt.close() def plot_controls(result_path): @@ -91,6 +92,7 @@ def plot_controls(result_path): plt.ylabel('Amplitude', fontsize=20) # plt.savefig(os.path.join(folder, save_name + '.pdf')) plt.savefig(os.path.join(result_path, save_name + '.png')) + plt.close() def main(optimization_dictionary: dict, args_dict: dict): diff --git a/tests/test_dCRAB_shrink_option.py b/tests/test_dCRAB_shrink_option.py index 39b12bd..2a6480f 100644 --- a/tests/test_dCRAB_shrink_option.py +++ b/tests/test_dCRAB_shrink_option.py @@ -54,6 +54,7 @@ def plot_FoM(result_path, FoM_filename): plt.ylabel('FoM', fontsize=20) # plt.savefig(os.path.join(folder, save_name + '.pdf')) plt.savefig(os.path.join(result_path, save_name + '.png')) + plt.close() def plot_controls(result_path): @@ -90,6 +91,7 @@ def plot_controls(result_path): plt.ylabel('Amplitude', fontsize=20) # plt.savefig(os.path.join(folder, save_name + '.pdf')) plt.savefig(os.path.join(result_path, save_name + '.png')) + plt.close() def test_pulse_shrinking(): diff --git a/tests/test_mixed_dCRAB_Fourier_NM_OneQubit.py b/tests/test_mixed_dCRAB_Fourier_NM_OneQubit.py index 5e7ae4b..a4f7d04 100644 --- a/tests/test_mixed_dCRAB_Fourier_NM_OneQubit.py +++ b/tests/test_mixed_dCRAB_Fourier_NM_OneQubit.py @@ -55,6 +55,7 @@ def plot_FoM(result_path, FoM_filename): plt.ylabel('FoM', fontsize=20) # plt.savefig(os.path.join(folder, save_name + '.pdf')) plt.savefig(os.path.join(result_path, save_name + '.png')) + plt.close() def plot_controls(result_path): @@ -91,6 +92,7 @@ def plot_controls(result_path): plt.ylabel('Amplitude', fontsize=20) # plt.savefig(os.path.join(folder, save_name + '.pdf')) plt.savefig(os.path.join(result_path, save_name + '.png')) + plt.close() def main(optimization_dictionary: dict, args_dict: dict):