From eda776d3703e033e9431b84bf244bcb3903e06a1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 21 Dec 2025 05:56:51 +0000 Subject: [PATCH 1/3] Bump numpy from 2.3.5 to 2.4.0 Bumps [numpy](https://github.com/numpy/numpy) from 2.3.5 to 2.4.0. - [Release notes](https://github.com/numpy/numpy/releases) - [Changelog](https://github.com/numpy/numpy/blob/main/doc/RELEASE_WALKTHROUGH.rst) - [Commits](https://github.com/numpy/numpy/compare/v2.3.5...v2.4.0) --- updated-dependencies: - dependency-name: numpy dependency-version: 2.4.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 875cc0034bb..8676e9e96c3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -211,7 +211,7 @@ networkx==3.6.1 # via # qcodes (pyproject.toml) # qcodes -numpy==2.3.5 +numpy==2.4.0 # via # qcodes (pyproject.toml) # broadbean From a79d4e5fcafe94438e2a8f7811918b895bafab2d Mon Sep 17 00:00:00 2001 From: "Jens H. Nielsen" Date: Sun, 21 Dec 2025 06:56:20 +0100 Subject: [PATCH 2/3] Update tests for numpy 2.4 supporT --- tests/dataset/test__get_data_from_ds.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/dataset/test__get_data_from_ds.py b/tests/dataset/test__get_data_from_ds.py index 7223caee311..6440b2775b2 100644 --- a/tests/dataset/test__get_data_from_ds.py +++ b/tests/dataset/test__get_data_from_ds.py @@ -65,7 +65,6 @@ def test_datasaver_multidimarrayparameter_as_array( for datadict_list in datadicts: assert len(datadict_list) == 4 for datadict in datadict_list: - datadict["data"].shape = (int(np.prod(expected_shape)),) if datadict["name"] == "dummy_SA_Frequency0": temp_data = np.linspace( array_param.start, array_param.stop, array_param.npts[0] @@ -91,6 +90,7 @@ def test_datasaver_multidimarrayparameter_as_array( expected_data = inserted_data.ravel() else: raise RuntimeError(f"Unexpected datadict item {datadict['name']}") + expected_data = expected_data.reshape(expected_shape) assert_allclose(datadict["data"], expected_data) @@ -123,7 +123,6 @@ def test_datasaver_multidimarrayparameter_as_numeric( for datadict_list in datadicts: assert len(datadict_list) == 4 for datadict in datadict_list: - datadict["data"].shape = (np.prod(expected_shape),) if datadict["name"] == "dummy_SA_Frequency0": temp_data = np.linspace( array_param.start, array_param.stop, array_param.npts[0] From 3fda3bdb1303c6ec1e938b8d7ff5bef51a660986 Mon Sep 17 00:00:00 2001 From: "Jens H. Nielsen" Date: Sun, 21 Dec 2025 08:47:23 +0100 Subject: [PATCH 3/3] Fix numpy support in benchmark notebook --- docs/examples/DataSet/Benchmarking.ipynb | 231 ++++------------------- 1 file changed, 35 insertions(+), 196 deletions(-) diff --git a/docs/examples/DataSet/Benchmarking.ipynb b/docs/examples/DataSet/Benchmarking.ipynb index 82c777e3570..958344b75fd 100644 --- a/docs/examples/DataSet/Benchmarking.ipynb +++ b/docs/examples/DataSet/Benchmarking.ipynb @@ -11,25 +11,9 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 3, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Logging hadn't been started.\n", - "Activating auto-logging. Current session state plus future input saved.\n", - "Filename : C:\\Users\\Jens\\.qcodes\\logs\\command_history.log\n", - "Mode : append\n", - "Output logging : True\n", - "Raw input log : False\n", - "Timestamping : True\n", - "State : active\n", - "Qcodes Logfile : C:\\Users\\Jens\\.qcodes\\logs\\250323-2760-qcodes.log\n" - ] - } - ], + "outputs": [], "source": [ "%matplotlib inline\n", "from pathlib import Path\n", @@ -91,78 +75,8 @@ { "data": { "text/plain": [ - "benchmarking#the sample is a lie#3@C:\\Users\\jenielse\\experiments.db\n", - "-------------------------------------------------------------------\n", - "11-benchmark_data-1--0\n", - "12-doubledata-2-x,y,z-1000\n", - "13-singledata-3-y,z,x-100\n", - "14-zerodata-4-y,z,x-1\n", - "15-array1Ddata-5-y,z,x-800\n", - "16-array0Ddata-6-y,z,x-81\n", - "17-many_data-7-x,y,z-810000\n", - "68-benchmark_data-8--0\n", - "69-doubledata-9-y,z,x-1000\n", - "70-singledata-10-y,z,x-100\n", - "71-zerodata-11-y,z,x-1\n", - "72-array1Ddata-12-y,z,x-800\n", - "73-array0Ddata-13-y,z,x-81\n", - "74-many_data-14-y,z,x-810000\n", - "127-benchmark_data-15--0\n", - "128-doubledata-16-y,z,x-1000\n", - "129-singledata-17-y,z,x-100\n", - "130-zerodata-18-y,z,x-1\n", - "131-array1Ddata-19-y,z,x-800\n", - "132-array0Ddata-20-y,z,x-811\n", - "133-many_data-21-y,z,x-810000\n", - "170-benchmark_data-22--0\n", - "171-doubledata-23-z,y,x-1000\n", - "172-singledata-24-z,y,x-100\n", - "173-zerodata-25-z,y,x-1\n", - "174-array1Ddata-26-z,y,x-800\n", - "175-array0Ddata-27-z,y,x-811\n", - "176-many_data-28-z,y,x-810000\n", - "229-benchmark_data-29--0\n", - "230-doubledata-30-x,z,y-1000\n", - "231-singledata-31-y,z,x-100\n", - "232-zerodata-32-y,z,x-1\n", - "233-array1Ddata-33-y,z,x-800\n", - "234-array0Ddata-34-y,z,x-811\n", - "235-many_data-35-x,z,y-810000\n", - "288-benchmark_data-36--0\n", - "289-doubledata-37-y,z,x-1000\n", - "290-singledata-38-z,y,x-100\n", - "291-zerodata-39-z,y,x-1\n", - "292-array1Ddata-40-z,y,x-800\n", - "293-array0Ddata-41-z,y,x-811\n", - "294-many_data-42-y,z,x-810000\n", - "347-benchmark_data-43--0\n", - "348-doubledata-44-x,y,z-1000\n", - "349-singledata-45-y,z,x-100\n", - "350-zerodata-46-y,z,x-1\n", - "351-array1Ddata-47-y,z,x-800\n", - "352-array0Ddata-48-y,z,x-811\n", - "353-many_data-49-x,y,z-810000\n", - "406-benchmark_data-50--0\n", - "407-doubledata-51-y,x,z-1000\n", - "408-singledata-52-y,x,z-100\n", - "409-zerodata-53-y,x,z-1\n", - "410-array1Ddata-54-y,x,z-800\n", - "411-array0Ddata-55-y,x,z-811\n", - "412-many_data-56-y,x,z-810000\n", - "662-benchmark_data-57--0\n", - "663-doubledata-58-z,y,x-1000\n", - "664-singledata-59-y,x,z-100\n", - "665-zerodata-60-y,x,z-1\n", - "666-array1Ddata-61-y,x,z-800\n", - "667-array0Ddata-62-y,x,z-811\n", - "668-many_data-63-z,y,x-810000\n", - "680-benchmark_data-64--0\n", - "681-doubledata-65-y,z,x-1000\n", - "682-singledata-66-y,z,x-100\n", - "683-zerodata-67-y,z,x-1\n", - "684-array1Ddata-68-y,z,x-800\n", - "685-array0Ddata-69-y,z,x-811\n", - "686-many_data-70-y,z,x-810000" + "benchmarking#the sample is a lie#1@C:\\Users\\jensh\\experiments.db\n", + "----------------------------------------------------------------" ] }, "execution_count": 4, @@ -194,79 +108,9 @@ { "data": { "text/plain": [ - "benchmarking#the sample is a lie#3@C:\\Users\\jenielse\\experiments.db\n", - "-------------------------------------------------------------------\n", - "11-benchmark_data-1--0\n", - "12-doubledata-2-x,y,z-1000\n", - "13-singledata-3-y,z,x-100\n", - "14-zerodata-4-y,z,x-1\n", - "15-array1Ddata-5-y,z,x-800\n", - "16-array0Ddata-6-y,z,x-81\n", - "17-many_data-7-x,y,z-810000\n", - "68-benchmark_data-8--0\n", - "69-doubledata-9-y,z,x-1000\n", - "70-singledata-10-y,z,x-100\n", - "71-zerodata-11-y,z,x-1\n", - "72-array1Ddata-12-y,z,x-800\n", - "73-array0Ddata-13-y,z,x-81\n", - "74-many_data-14-y,z,x-810000\n", - "127-benchmark_data-15--0\n", - "128-doubledata-16-y,z,x-1000\n", - "129-singledata-17-y,z,x-100\n", - "130-zerodata-18-y,z,x-1\n", - "131-array1Ddata-19-y,z,x-800\n", - "132-array0Ddata-20-y,z,x-811\n", - "133-many_data-21-y,z,x-810000\n", - "170-benchmark_data-22--0\n", - "171-doubledata-23-z,y,x-1000\n", - "172-singledata-24-z,y,x-100\n", - "173-zerodata-25-z,y,x-1\n", - "174-array1Ddata-26-z,y,x-800\n", - "175-array0Ddata-27-z,y,x-811\n", - "176-many_data-28-z,y,x-810000\n", - "229-benchmark_data-29--0\n", - "230-doubledata-30-x,z,y-1000\n", - "231-singledata-31-y,z,x-100\n", - "232-zerodata-32-y,z,x-1\n", - "233-array1Ddata-33-y,z,x-800\n", - "234-array0Ddata-34-y,z,x-811\n", - "235-many_data-35-x,z,y-810000\n", - "288-benchmark_data-36--0\n", - "289-doubledata-37-y,z,x-1000\n", - "290-singledata-38-z,y,x-100\n", - "291-zerodata-39-z,y,x-1\n", - "292-array1Ddata-40-z,y,x-800\n", - "293-array0Ddata-41-z,y,x-811\n", - "294-many_data-42-y,z,x-810000\n", - "347-benchmark_data-43--0\n", - "348-doubledata-44-x,y,z-1000\n", - "349-singledata-45-y,z,x-100\n", - "350-zerodata-46-y,z,x-1\n", - "351-array1Ddata-47-y,z,x-800\n", - "352-array0Ddata-48-y,z,x-811\n", - "353-many_data-49-x,y,z-810000\n", - "406-benchmark_data-50--0\n", - "407-doubledata-51-y,x,z-1000\n", - "408-singledata-52-y,x,z-100\n", - "409-zerodata-53-y,x,z-1\n", - "410-array1Ddata-54-y,x,z-800\n", - "411-array0Ddata-55-y,x,z-811\n", - "412-many_data-56-y,x,z-810000\n", - "662-benchmark_data-57--0\n", - "663-doubledata-58-z,y,x-1000\n", - "664-singledata-59-y,x,z-100\n", - "665-zerodata-60-y,x,z-1\n", - "666-array1Ddata-61-y,x,z-800\n", - "667-array0Ddata-62-y,x,z-811\n", - "668-many_data-63-z,y,x-810000\n", - "680-benchmark_data-64--0\n", - "681-doubledata-65-y,z,x-1000\n", - "682-singledata-66-y,z,x-100\n", - "683-zerodata-67-y,z,x-1\n", - "684-array1Ddata-68-y,z,x-800\n", - "685-array0Ddata-69-y,z,x-811\n", - "686-many_data-70-y,z,x-810000\n", - "734-benchmark_data-71--0" + "benchmarking#the sample is a lie#1@C:\\Users\\jensh\\experiments.db\n", + "----------------------------------------------------------------\n", + "1-benchmark_data-1-None-0" ] }, "execution_count": 5, @@ -312,7 +156,8 @@ "name": "stdout", "output_type": "stream", "text": [ - "Wall time: 29.6 ms\n" + "CPU times: total: 15.6 ms\n", + "Wall time: 10.9 ms\n" ] } ], @@ -350,7 +195,8 @@ "name": "stdout", "output_type": "stream", "text": [ - "Wall time: 10 ms\n" + "CPU times: total: 0 ns\n", + "Wall time: 4.52 ms\n" ] } ], @@ -404,7 +250,8 @@ "name": "stdout", "output_type": "stream", "text": [ - "Wall time: 3.99 s\n" + "CPU times: total: 922 ms\n", + "Wall time: 5.34 s\n" ] } ], @@ -441,14 +288,15 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 18, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "Wall time: 521 ms\n" + "CPU times: total: 156 ms\n", + "Wall time: 756 ms\n" ] } ], @@ -458,7 +306,7 @@ " for y in range(y_shape):\n", " x_data[y] = x\n", " y_data[y] = y\n", - " z_data[y] = np.random.random_sample(1)\n", + " z_data[y] = np.random.random_sample(1)[0]\n", " single_dataset.add_results([{\"x\": x_data, \"y\": y_data, \"z\": z_data}])" ] }, @@ -471,7 +319,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 20, "metadata": {}, "outputs": [], "source": [ @@ -488,25 +336,16 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 22, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "Wall time: 40.3 ms\n" + "CPU times: total: 0 ns\n", + "Wall time: 17.3 ms\n" ] - }, - { - "data": { - "text/plain": [ - "1" - ] - }, - "execution_count": 15, - "metadata": {}, - "output_type": "execute_result" } ], "source": [ @@ -515,7 +354,7 @@ " for y in range(y_shape):\n", " x_data[x, y] = x\n", " y_data[x, y] = y\n", - " z_data[x, y] = np.random.random_sample(1)\n", + " z_data[x, y] = np.random.random_sample(1)[0]\n", "zero_dataset.add_results([{\"x\": x_data, \"y\": y_data, \"z\": z_data}])" ] }, @@ -528,7 +367,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 23, "metadata": {}, "outputs": [], "source": [ @@ -543,14 +382,14 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 24, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "497 ms ± 61.8 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)\n" + "567 ms ± 52.1 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)\n" ] } ], @@ -565,7 +404,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 25, "metadata": {}, "outputs": [], "source": [ @@ -577,7 +416,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 26, "metadata": {}, "outputs": [], "source": [ @@ -591,14 +430,14 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 27, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "10.3 ms ± 444 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)\n" + "5.66 ms ± 43.9 μs per loop (mean ± std. dev. of 7 runs, 100 loops each)\n" ] } ], @@ -620,7 +459,7 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": 28, "metadata": {}, "outputs": [], "source": [ @@ -632,7 +471,7 @@ }, { "cell_type": "code", - "execution_count": 22, + "execution_count": 29, "metadata": {}, "outputs": [], "source": [ @@ -650,14 +489,14 @@ }, { "cell_type": "code", - "execution_count": 23, + "execution_count": 30, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "43.2 ms ± 2.46 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)\n" + "15.5 ms ± 946 μs per loop (mean ± std. dev. of 7 runs, 100 loops each)\n" ] } ], @@ -669,7 +508,7 @@ ], "metadata": { "kernelspec": { - "display_name": ".venv", + "display_name": "qcodes", "language": "python", "name": "python3" }, @@ -683,7 +522,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.13.2" + "version": "3.14.2" }, "nbsphinx": { "timeout": 600