From 1c08a7edb39a9c3857331be870a88d2226ab7497 Mon Sep 17 00:00:00 2001 From: Matt McKay Date: Thu, 16 Jul 2026 09:28:09 +1000 Subject: [PATCH] P1 pilot: read lingcod data from data-lectures MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Repoints msy_fishery at the canonical copy in QuantEcon/data-lectures and drops the local one, which nothing else reads. This also fixes the lecture rather than merely relocating its data. The read was a relative path, 'datasets/lingcod_msy_recovery.csv', which only resolves inside a repo checkout — a downloaded notebook has no datasets/ directory, so the cell raised FileNotFoundError in Colab. Reading over https is what makes the notebook self-contained. Uses the interim URL form github.com/QuantEcon/data-lectures/raw/main/… and the data_url convention already used by long_run_growth and inflation_history. Blocked until the data is on data-lectures main (QuantEcon/data-lectures#10, then #11) — until then this URL 404s. The branch URL resolves today, but pointing at a non-default ref is exactly the bug meta#337 is cleaning up in mle.md, so it is not a shortcut worth taking. Verified by running the cell against the data over https: 82 rows, figure renders, terminal-year null in F/Fmsy handled. Output is unchanged — the migrated file is byte-identical (sha256 fc2f873f…) to the copy removed here. Part of QuantEcon/meta#338 See QuantEcon/meta#336 Co-Authored-By: Claude Fable 5 --- lectures/datasets/lingcod_msy_recovery.csv | 83 ---------------------- lectures/msy_fishery.md | 3 +- 2 files changed, 2 insertions(+), 84 deletions(-) delete mode 100644 lectures/datasets/lingcod_msy_recovery.csv diff --git a/lectures/datasets/lingcod_msy_recovery.csv b/lectures/datasets/lingcod_msy_recovery.csv deleted file mode 100644 index ca84787c7..000000000 --- a/lectures/datasets/lingcod_msy_recovery.csv +++ /dev/null @@ -1,83 +0,0 @@ -year,B_over_Bmsy,F_over_Fmsy -1928,3.859289617,0.12815534 -1929,3.842213115,0.177669903 -1930,3.825136612,0.198058252 -1931,3.790983607,0.19223301 -1932,3.756830601,0.142718447 -1933,3.756830601,0.224271845 -1934,3.705601093,0.14368932 -1935,3.705601093,0.170873786 -1936,3.671448087,0.133009709 -1937,3.671448087,0.173786408 -1938,3.654371585,0.146601942 -1939,3.637295082,0.127184466 -1940,3.637295082,0.145631068 -1941,3.637295082,0.117475728 -1942,3.637295082,0.067961165 -1943,3.654371585,0.131067961 -1944,3.654371585,0.132038835 -1945,3.654371585,0.130097087 -1946,3.637295082,0.216504854 -1947,3.603142077,0.430097087 -1948,3.50068306,0.462135922 -1949,3.398224044,0.413592233 -1950,3.31284153,0.45631068 -1951,3.227459016,0.453398058 -1952,3.142076503,0.350485437 -1953,3.090846995,0.246601942 -1954,3.073770492,0.290291262 -1955,3.056693989,0.308737864 -1956,3.039617486,0.355339806 -1957,3.005464481,0.526213592 -1958,2.920081967,0.539805825 -1959,2.851775956,0.466990291 -1960,2.800546448,0.417475728 -1961,2.74931694,0.449514563 -1962,2.698087432,0.386407767 -1963,2.663934426,0.391262136 -1964,2.629781421,0.340776699 -1965,2.612704918,0.413592233 -1966,2.578551913,0.518446602 -1967,2.527322404,0.57961165 -1968,2.476092896,0.612621359 -1969,2.407786885,0.575728155 -1970,2.339480874,0.850485437 -1971,2.237021858,1.077669903 -1972,2.117486339,1.563106796 -1973,1.929644809,1.766990291 -1974,1.741803279,1.951456311 -1975,1.572745902,1.951456311 -1976,1.449795082,2.077669903 -1977,1.321721311,1.485436893 -1978,1.270491803,1.941747573 -1979,1.166325137,2.718446602 -1980,1.00068306,3.378640777 -1981,0.840163934,3.378640777 -1982,0.712090164,3.504854369 -1983,0.594262295,2.67961165 -1984,0.544740437,2.805825243 -1985,0.488387978,3.951456311 -1986,0.403005464,3.854368932 -1987,0.37568306,4.019417476 -1988,0.37397541,4.310679612 -1989,0.358606557,4.834951456 -1990,0.3125,4.553398058 -1991,0.285177596,4.32038835 -1992,0.268101093,4.174757282 -1993,0.256147541,3.485436893 -1994,0.266393443,2.27184466 -1995,0.315915301,2.019417476 -1996,0.365437158,2.038834951 -1997,0.396174863,1.815533981 -1998,0.425204918,1.300970874 -1999,0.479849727,1.398058252 -2000,0.539617486,0.63592233 -2001,0.650614754,0.49223301 -2002,0.800887978,1.029126214 -2003,0.988729508,1.291262136 -2004,1.243169399,0.195145631 -2005,1.656420765,0.261165049 -2006,2.083333333,0.249514563 -2007,2.510245902,0.144660194 -2008,2.885928962,0.093203883 -2009,3.193306011, diff --git a/lectures/msy_fishery.md b/lectures/msy_fishery.md index 24445e2dc..4d8fa95f2 100644 --- a/lectures/msy_fishery.md +++ b/lectures/msy_fishery.md @@ -593,7 +593,8 @@ mystnb: caption: Pacific Coast lingcod recovery name: fig:lingcod --- -lingcod = pd.read_csv('datasets/lingcod_msy_recovery.csv') +data_url = "https://github.com/QuantEcon/data-lectures/raw/main/lectures/lingcod_msy_recovery.csv" +lingcod = pd.read_csv(data_url) fig, ax = plt.subplots()