diff --git a/notebooks/AGIPD/Characterize_AGIPD_Gain_Darks_NBC.ipynb b/notebooks/AGIPD/Characterize_AGIPD_Gain_Darks_NBC.ipynb index 8c35cb47b01121884878ba62e8b0385a6571d312..d664b2c46735ed78dee5ed095c987fa51d36408c 100644 --- a/notebooks/AGIPD/Characterize_AGIPD_Gain_Darks_NBC.ipynb +++ b/notebooks/AGIPD/Characterize_AGIPD_Gain_Darks_NBC.ipynb @@ -342,7 +342,7 @@ "source": [ "parallel_num_procs = min(6, total_sequences)\n", "parallel_num_threads = multiprocessing.cpu_count() // parallel_num_procs\n", - "print(f\"Running with {parallel_num_procs} processes spawning {parallel_num_threads} threads each\")\n", + "print(f\"Will use {parallel_num_procs} processes with {parallel_num_threads} threads each\")\n", "\n", "def characterize_module(\n", " fast_data_filename: str, channel: int, gain_index: int\n", @@ -649,18 +649,9 @@ "metadata": {}, "outputs": [], "source": [ - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Retrieve existing constants for comparison\n", + "# Start retrieving existing constants for comparison\n", "qm_x_const = [(qm, const) for const in res[qm] for qm in res]\n", - "print('Retrieve pre-existing constants for comparison.')\n", - "def boom(qm, const):\n", + "def retrieve_old_constant(qm, const):\n", " qm_db = qm_dict[qm]\n", " this_karabo_da = qm_db[\"karabo_da\"]\n", " dconst = getattr(iCalibrationDB.Constants.AGIPD, const)()\n", @@ -690,26 +681,12 @@ " return data, timestamp\n", "\n", "old_retrieval_pool = multiprocessing.Pool()\n", - "old_retrieval_res = old_retrieval_pool.starmap_async(boom, qm_x_const)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ + "old_retrieval_res = old_retrieval_pool.starmap_async(\n", + " retrieve_old_constant, qm_x_const\n", + ")\n", "old_retrieval_pool.close()" ] }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - ] - }, { "cell_type": "code", "execution_count": null, @@ -912,14 +889,6 @@ " old_mdata.setdefault(qm, {})[const] = timestamp" ] }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - ] - }, { "cell_type": "code", "execution_count": null,