diff --git a/notebooks/Aramis/load_save_demo.ipynb b/notebooks/Aramis/load_save_demo.ipynb index af79315..888e810 100644 --- a/notebooks/Aramis/load_save_demo.ipynb +++ b/notebooks/Aramis/load_save_demo.ipynb @@ -25,7 +25,8 @@ "from solardatatools import DataHandler\n", "from solardatatools.dataio import load_redshift_data\n", "from solardatatools.algorithms import Dilation\n", - "from spcqe.quantiles import SmoothPeriodicQuantiles" + "from spcqe.quantiles import SmoothPeriodicQuantiles\n", + "from spcqe.quantiles import save, load" ] }, { @@ -80,7 +81,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "task list: 100%|██████████████████████████████████| 7/7 [00:11<00:00, 1.69s/it]" + "task list: 100%|██████████████████████████████████| 7/7 [00:03<00:00, 1.91it/s]" ] }, { @@ -89,17 +90,17 @@ "text": [ "\n", "\n", - "total time: 11.85 seconds\n", + "total time: 3.67 seconds\n", "--------------------------------\n", "Breakdown\n", "--------------------------------\n", - "Preprocessing 2.00s\n", - "Cleaning 0.10s\n", - "Filtering/Summarizing 9.75s\n", - " Data quality 0.08s\n", - " Clear day detect 0.13s\n", - " Clipping detect 2.62s\n", - " Capacity change detect 6.91s\n", + "Preprocessing 0.58s\n", + "Cleaning 0.03s\n", + "Filtering/Summarizing 3.07s\n", + " Data quality 0.02s\n", + " Clear day detect 0.04s\n", + " Clipping detect 2.23s\n", + " Capacity change detect 0.78s\n", "\n" ] }, @@ -119,7 +120,7 @@ " }\n", "df = load_redshift_data(**query)\n", "dh = DataHandler(df, convert_to_ts=True)\n", - "dh.run_pipeline()" + "dh.run_pipeline(start_day_ix=918)" ] }, { @@ -152,7 +153,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "100%|███████████████████████████████████████████| 11/11 [08:59<00:00, 49.03s/it]\n" + "100%|███████████████████████████████████████████| 11/11 [02:12<00:00, 12.05s/it]\n" ] } ], @@ -188,33 +189,16 @@ "metadata": {}, "outputs": [], "source": [ - "from spcqe.quantiles import save, load" + "save('saved_data/spq1.spq', spq)" ] }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 8, "metadata": {}, "outputs": [], "source": [ - "save('saved_data/spq.pkl', spq)" - ] - }, - { - "cell_type": "code", - "execution_count": 10, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "SmoothPeriodicQuantiles object has been loaded from saved_data/spq.pkl.\n" - ] - } - ], - "source": [ - "spq2 = load('saved_data/spq.pkl')" + "spq2 = load('saved_data/spq1.spq')" ] }, { @@ -226,7 +210,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 9, "metadata": {}, "outputs": [ { @@ -657,7 +641,7 @@ " solver='qss', standing_wave=[True, False], weight=10)" ] }, - "execution_count": 11, + "execution_count": 9, "metadata": {}, "output_type": "execute_result" } @@ -675,7 +659,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 10, "metadata": {}, "outputs": [ { @@ -684,7 +668,7 @@ "True" ] }, - "execution_count": 13, + "execution_count": 10, "metadata": {}, "output_type": "execute_result" } @@ -692,6 +676,13 @@ "source": [ "np.allclose(spq.fit_quantiles, spq2.fit_quantiles)" ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Note : The object above is quite large (25 MB) because of the basis. Not saving the basis would save memory space." + ] } ], "metadata": {