|
6 | 6 | "metadata": {}, |
7 | 7 | "source": [ |
8 | 8 | "\n", |
9 | | - "# Filling Non-tidal Quantities Based on a Neighbor\n", |
10 | | - "\n", |
11 | | - "**neighbor_fill.ipynb — user guide** \n", |
12 | | - "*Generated 2025-11-02 05:52 UTC*\n", |
13 | | - "\n", |
14 | | - "This notebook is a practical, self-contained guide for filling gaps in a target time series using a neighboring series\n", |
15 | | - "(e.g., **San Joaquin at Vernalis** (VNS) flow filled from **Mossdale Bridge** (MSD) subtidal flow), the example we use here.\n", |
16 | | - "\n", |
17 | | - "---\n" |
| 9 | + "# Filling Non-tidal Quantities Based on a Neighbor\n" |
18 | 10 | ] |
19 | 11 | }, |
20 | 12 | { |
|
55 | 47 | "\n", |
56 | 48 | "## 2. Setup\n", |
57 | 49 | "\n", |
58 | | - "The code assumes your standard environment with `vtools`, `dms_datastore`, and `statsmodels`. \n", |
59 | | - "If you're browsing the notebook without your environment, you can still read the narrative and formulas.\n", |
60 | | - "\n", |
61 | | - "> **Modules** \n", |
62 | | - "> - Data & utilities: `vtools`, `vtools.data.gap` \n", |
63 | | - "> - Gap filling: `vtools.functions.neighbor_fill.fill_from_neighbor` \n", |
64 | | - "> - Optional data provider: `dms_datastore.read_multi.read_ts_repo`\n" |
| 50 | + "The code assumes your standard environment with `vtools`, `dms_datastore`, and by extension `statsmodels`. The first steps have to \n", |
| 51 | + "do with imports, acquisition etc.\n", |
| 52 | + "\n" |
65 | 53 | ] |
66 | 54 | }, |
67 | 55 | { |
68 | 56 | "cell_type": "code", |
69 | | - "execution_count": 1, |
| 57 | + "execution_count": null, |
70 | 58 | "id": "b8546bcb", |
71 | 59 | "metadata": {}, |
72 | 60 | "outputs": [], |
|
107 | 95 | }, |
108 | 96 | { |
109 | 97 | "cell_type": "code", |
110 | | - "execution_count": 2, |
| 98 | + "execution_count": null, |
111 | 99 | "id": "26bf5859", |
112 | 100 | "metadata": {}, |
113 | 101 | "outputs": [], |
114 | 102 | "source": [ |
115 | 103 | "\n", |
116 | | - "# You may replace this with a project-specific provider using dms_datastore.\n", |
| 104 | + "# These series are provided in the examples. You could replace this \n", |
| 105 | + "# with a project-specific provider using dms_datastore.\n", |
117 | 106 | "# The function must return (target: Series, neighbor: Series|DataFrame, regime: Series|None),\n", |
118 | 107 | "# aligned (or alignable) by time.\n", |
119 | 108 | "def provide_example_data(start='2017-02-01', end='2022-12-01'):\n", |
|
140 | 129 | "y, x, regime = provide_example_data()\n", |
141 | 130 | "\n", |
142 | 131 | "\n", |
143 | | - "\n", |
144 | | - "\n", |
145 | | - "\n", |
146 | 132 | "# --- Stable, colorblind-safe colors and a label->color lookup ----------------\n", |
147 | 133 | "# Okabe–Ito palette (colorblind friendly)\n", |
148 | 134 | "OKABE_ITO = [\n", |
|
156 | 142 | " \"#F0E442\", # 3 yellow \n", |
157 | 143 | "]\n", |
158 | 144 | "\n", |
159 | | - "# Fixed order for algorithms you commonly plot (extend as needed)\n", |
| 145 | + "# Fixed order for algorithms in the notebook and plots\n", |
160 | 146 | "ALGO_ORDER = [\n", |
161 | 147 | " \"ols\",\n", |
162 | 148 | " \"huber\",\n", |
|
366 | 352 | }, |
367 | 353 | { |
368 | 354 | "cell_type": "code", |
369 | | - "execution_count": 3, |
| 355 | + "execution_count": null, |
370 | 356 | "id": "e7eb4b9c", |
371 | 357 | "metadata": {}, |
372 | 358 | "outputs": [ |
|
445 | 431 | }, |
446 | 432 | { |
447 | 433 | "cell_type": "code", |
448 | | - "execution_count": 4, |
| 434 | + "execution_count": null, |
449 | 435 | "id": "616da888", |
450 | 436 | "metadata": {}, |
451 | 437 | "outputs": [ |
|
516 | 502 | }, |
517 | 503 | { |
518 | 504 | "cell_type": "code", |
519 | | - "execution_count": 5, |
| 505 | + "execution_count": null, |
520 | 506 | "id": "85929d59", |
521 | 507 | "metadata": {}, |
522 | 508 | "outputs": [ |
|
616 | 602 | }, |
617 | 603 | { |
618 | 604 | "cell_type": "code", |
619 | | - "execution_count": 6, |
| 605 | + "execution_count": null, |
620 | 606 | "id": "06ee9218", |
621 | 607 | "metadata": {}, |
622 | 608 | "outputs": [ |
|
823 | 809 | }, |
824 | 810 | { |
825 | 811 | "cell_type": "code", |
826 | | - "execution_count": 7, |
| 812 | + "execution_count": null, |
827 | 813 | "id": "5e46f183", |
828 | 814 | "metadata": {}, |
829 | 815 | "outputs": [ |
|
0 commit comments