diff --git a/.github/workflows/refresh-external.yml b/.github/workflows/refresh-external.yml index 775daec..4b7e45a 100644 --- a/.github/workflows/refresh-external.yml +++ b/.github/workflows/refresh-external.yml @@ -1,5 +1,6 @@ # Weekly refresh of the public environmental snapshots in external/ (#22): weather, waves, -# SST, Coral Reef Watch heat stress, Papeete tides, ENSO indices and IBTrACS cyclone tracks. When anything changed, +# SST, Coral Reef Watch heat stress, Papeete tides, ENSO indices, IBTrACS cyclone tracks and school +# holidays. When anything changed, # commit it to main, cut a patch release and publish the image so servers pick up fresh data. # No spreadsheet data is involved. diff --git a/AGENTS.md b/AGENTS.md index d447cf2..329bd70 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -47,7 +47,8 @@ src/lib/server/analytics common.ts (CPUE, Fulton's K, recapture pairs…) · env events.ts (cyclones and heavy-rain days vs catches) glm.ts (NB/Poisson GLM, splines) · catchModel.ts (joint catch model) src/lib/server/astro.ts sunset/twilight/moon (local formulas) · tides.ts (extrema, interpolation) -src/lib/server/holidays.ts French Polynesia public holidays (Easter-based too) + festive window +src/lib/server/holidays.ts French Polynesia public holidays (Easter-based too), festive window, + school holidays (schoolDays) and the one-label-per-date dayType src/lib/stats.ts regression, Spearman, Welch, Wilson, binomial, histograms, box stats src/lib/components/ ChartCard, StatTile, DataTable, FindingCard, MooreaMap (SSR SVG), InteractiveMap (Leaflet, lazy; MooreaMap is its fallback), charts/* @@ -100,6 +101,12 @@ samples/fixture/ synthetic workbooks for tests/CI (committed) - The headline: sea temperature's raw link with catch rate (≈ −25% per °C) vanishes once day of the season is in the model. Don't describe SST as a driver of catches on other pages. - `glm.ts` is generic (IRLS + ML θ, Wald intervals via `contrast`); reuse it rather than writing another fitter. +### School holidays (#25) + +- `fetch-external.mjs --only=school` writes `external/school-holidays.csv` (first and last day off, local dates). 2013-14 to 2016-17 are transcribed in the script from the Polynesian government's calendar orders for collèges and lycées (arrêtés 0270/CM 2013, 0399, 0401 and 0403/CM 2014), archived from education.pf by the Wayback Machine; the national dataset only starts in 2017-18. From 2017-18 it is the Ministry's `fr-en-calendrier-scolaire` open data (Polynésie, Licence Ouverte 2.0, credit it): pupils only, a day counts when either level is off, `end_date` is the day classes resume. +- The national data has slips (the 2023 November break "starts" on 28 September): fix them in `SCHOOL_ERRATA`. The job throws if breaks overlap, so a new typo fails the weekly refresh instead of reaching the site. +- `dayType` precedence: public holiday > festive window > school holidays > weekend. The pressure page also compares school-holiday weekdays with term-time weekdays, which keeps weekends out of the contrast. + ### Adding a new season Drop the workbook in `data/` named like `Physioshark_Shark Log 2026-2027.xlsx` (the `YYYY-YYYY` in the file name sets the season). Check the Data quality page for unknown sites, unmatched headers ("Sheet not imported") and unit warnings, and extend aliases if needed. Never rename columns in the workbook to make the importer happy. diff --git a/README.md b/README.md index 092f5c6..42098a9 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ More than 130 server-rendered SVG charts and maps (several repeat per season, nu - Raw temperature logger exports (HOBO and EnvLogger `.csv` files) can sit anywhere under `data/`, e.g. `data/Temperature loggers/`. They are read the same way: never edited, never committed. - The app imports them into a derived SQLite cache on startup and re-imports automatically (within a minute) whenever a workbook is added or changed. Drop in next season's `Physioshark_Shark Log 2026-2027.xlsx` and the site updates. - Anything odd the importer notices (unit conversions, impossible measurements, out-of-season dates, tag conflicts, unknown sites) is listed on the **Data quality** page for the lab to fix in the source sheets. -- Environmental data are public and live in `external/` (Open-Meteo ERA5 weather and waves, NOAA OISST, NOAA Coral Reef Watch via PacIOOS, UHSLC Papeete tide gauge, NOAA CPC ENSO indices, NOAA IBTrACS cyclone tracks). `scripts/fetch-external.mjs` refreshes them; a weekly workflow commits updates and publishes a new image. +- Environmental data are public and live in `external/` (Open-Meteo ERA5 weather and waves, NOAA OISST, NOAA Coral Reef Watch via PacIOOS, UHSLC Papeete tide gauge, NOAA CPC ENSO indices, NOAA IBTrACS cyclone tracks, French Polynesia school holidays). `scripts/fetch-external.mjs` refreshes them; a weekly workflow commits updates and publishes a new image. - Tests, CI and the container smoke test use **synthetic** workbooks in `samples/fixture/` (`pnpm fixture` regenerates them). ## Run locally @@ -87,4 +87,4 @@ Read [AGENTS.md](AGENTS.md) before changing the importer, charts or release proc ## Credits -Survey data © the Physioshark project. Environmental data: Open-Meteo (CC BY 4.0, ERA5 © Copernicus/ECMWF), NOAA OISST v2.1, NOAA Coral Reef Watch (via PacIOOS), University of Hawaii Sea Level Center, NOAA Climate Prediction Center, NOAA IBTrACS. Coastline and street map tiles © OpenStreetMap contributors (ODbL). Satellite imagery © Esri, Maxar, Earthstar Geographics. +Survey data © the Physioshark project. Environmental data: Open-Meteo (CC BY 4.0, ERA5 © Copernicus/ECMWF), NOAA OISST v2.1, NOAA Coral Reef Watch (via PacIOOS), University of Hawaii Sea Level Center, NOAA Climate Prediction Center, NOAA IBTrACS. School calendars: Gouvernement de la Polynésie française (2013–2017 orders) and Ministère de l'Éducation nationale, « Le calendrier scolaire » (Licence Ouverte 2.0). Coastline and street map tiles © OpenStreetMap contributors (ODbL). Satellite imagery © Esri, Maxar, Earthstar Geographics. diff --git a/drizzle/0004_numerous_corsair.sql b/drizzle/0004_numerous_corsair.sql new file mode 100644 index 0000000..84bb8b7 --- /dev/null +++ b/drizzle/0004_numerous_corsair.sql @@ -0,0 +1,8 @@ +CREATE TABLE `school_holidays` ( + `id` integer PRIMARY KEY NOT NULL, + `school_year` text NOT NULL, + `name` text NOT NULL, + `start` text NOT NULL, + `end` text NOT NULL, + `source` text NOT NULL +); diff --git a/drizzle/meta/0004_snapshot.json b/drizzle/meta/0004_snapshot.json new file mode 100644 index 0000000..1c4b40e --- /dev/null +++ b/drizzle/meta/0004_snapshot.json @@ -0,0 +1,3185 @@ +{ + "version": "6", + "dialect": "sqlite", + "id": "fbbd43b9-606f-4d85-8dbd-9b4986f548a7", + "prevId": "306371d0-6bba-4eec-87f4-04d5f5c9d46f", + "tables": { + "adult_captures": { + "name": "adult_captures", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "shark_id": { + "name": "shark_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "date": { + "name": "date", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "hooked_min": { + "name": "hooked_min", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "boat_min": { + "name": "boat_min", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "released_min": { + "name": "released_min", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "fight_min": { + "name": "fight_min", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "handling_min": { + "name": "handling_min", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "lat": { + "name": "lat", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "lon": { + "name": "lon", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "site": { + "name": "site", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sex": { + "name": "sex", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "maturity": { + "name": "maturity", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "repro_code": { + "name": "repro_code", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "pcl_mm": { + "name": "pcl_mm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "fl_mm": { + "name": "fl_mm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tl_mm": { + "name": "tl_mm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "pec_girth_mm": { + "name": "pec_girth_mm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "dors_girth_mm": { + "name": "dors_girth_mm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "caud_girth_mm": { + "name": "caud_girth_mm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "clasper_inner": { + "name": "clasper_inner", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "clasper_outer": { + "name": "clasper_outer", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sperm": { + "name": "sperm", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "ultrasound": { + "name": "ultrasound", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "pregnant": { + "name": "pregnant", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "blood1_min": { + "name": "blood1_min", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "lact1": { + "name": "lact1", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "gluc1": { + "name": "gluc1", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "bhb1": { + "name": "bhb1", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "blood2_min": { + "name": "blood2_min", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "lact2": { + "name": "lact2", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "gluc2": { + "name": "gluc2", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "bhb2": { + "name": "bhb2", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tagged": { + "name": "tagged", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "bait": { + "name": "bait", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "comments": { + "name": "comments", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "source_file": { + "name": "source_file", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "source_sheet": { + "name": "source_sheet", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "source_row": { + "name": "source_row", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "adult_effort": { + "name": "adult_effort", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "date": { + "name": "date", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "session": { + "name": "session", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "bait_in_min": { + "name": "bait_in_min", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "bait_out_min": { + "name": "bait_out_min", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "soak_min": { + "name": "soak_min", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "shark_times": { + "name": "shark_times", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "n_sharks": { + "name": "n_sharks", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "comments": { + "name": "comments", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "adult_samples": { + "name": "adult_samples", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "sample": { + "name": "sample", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "size_cm": { + "name": "size_cm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sex": { + "name": "sex", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "island": { + "name": "island", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "location": { + "name": "location", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "year": { + "name": "year", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "notes": { + "name": "notes", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "blood": { + "name": "blood", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "season": { + "name": "season", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "site_id": { + "name": "site_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "date": { + "name": "date", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "species": { + "name": "species", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "experiment": { + "name": "experiment", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "shark_no": { + "name": "shark_no", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "hct": { + "name": "hct", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "hb": { + "name": "hb", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cholesterol": { + "name": "cholesterol", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "ffa": { + "name": "ffa", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "triglycerides": { + "name": "triglycerides", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "captures": { + "name": "captures", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "season": { + "name": "season", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "species": { + "name": "species", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "site_id": { + "name": "site_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "site_raw": { + "name": "site_raw", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "set_id": { + "name": "set_id", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "set_no": { + "name": "set_no", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "date": { + "name": "date", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "shark_no": { + "name": "shark_no", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "capture_no": { + "name": "capture_no", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "kind": { + "name": "kind", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "tag": { + "name": "tag", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tags": { + "name": "tags", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "individual_id": { + "name": "individual_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sex": { + "name": "sex", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "age_class": { + "name": "age_class", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "umbilical": { + "name": "umbilical", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "uss": { + "name": "uss", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "pcl_mm": { + "name": "pcl_mm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "fl_mm": { + "name": "fl_mm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tl_mm": { + "name": "tl_mm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "pec_girth_mm": { + "name": "pec_girth_mm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "dors_girth_mm": { + "name": "dors_girth_mm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "caud_girth_mm": { + "name": "caud_girth_mm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "mass_kg": { + "name": "mass_kg", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "clasper_l": { + "name": "clasper_l", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "clasper_r": { + "name": "clasper_r", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "capture_min": { + "name": "capture_min", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "landing_min": { + "name": "landing_min", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "release_min": { + "name": "release_min", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "workup_min": { + "name": "workup_min", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "to_lab": { + "name": "to_lab", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "died": { + "name": "died", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "blood": { + "name": "blood", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "dna": { + "name": "dna", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "us_area": { + "name": "us_area", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "us_perimeter": { + "name": "us_perimeter", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "habitat": { + "name": "habitat", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tide_raw": { + "name": "tide_raw", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "notes": { + "name": "notes", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "lavage": { + "name": "lavage", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "stomach": { + "name": "stomach", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "stomach_contents": { + "name": "stomach_contents", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "min_after_sunset": { + "name": "min_after_sunset", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "min_after_net_in": { + "name": "min_after_net_in", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tide_mm": { + "name": "tide_mm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tide_trend": { + "name": "tide_trend", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "moon_illum": { + "name": "moon_illum", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "moon_phase": { + "name": "moon_phase", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sst": { + "name": "sst", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "dhw": { + "name": "dhw", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "source_file": { + "name": "source_file", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "source_sheet": { + "name": "source_sheet", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "source_row": { + "name": "source_row", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "captures_season": { + "name": "captures_season", + "columns": [ + "season" + ], + "isUnique": false + }, + "captures_site": { + "name": "captures_site", + "columns": [ + "site_id" + ], + "isUnique": false + }, + "captures_individual": { + "name": "captures_individual", + "columns": [ + "individual_id" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "climate_monthly": { + "name": "climate_monthly", + "columns": { + "ym": { + "name": "ym", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "oni": { + "name": "oni", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "soi": { + "name": "soi", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "cyclone_points": { + "name": "cyclone_points", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "sid": { + "name": "sid", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "ts": { + "name": "ts", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "lat": { + "name": "lat", + "type": "real", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "lon": { + "name": "lon", + "type": "real", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "wind_kt": { + "name": "wind_kt", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "pres_hpa": { + "name": "pres_hpa", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "dist_km": { + "name": "dist_km", + "type": "real", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "data_issues": { + "name": "data_issues", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "severity": { + "name": "severity", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "category": { + "name": "category", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "message": { + "name": "message", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "file": { + "name": "file", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sheet": { + "name": "sheet", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "row": { + "name": "row", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "column": { + "name": "column", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "value": { + "name": "value", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "field_notes": { + "name": "field_notes", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "season": { + "name": "season", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "date": { + "name": "date", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "site_id": { + "name": "site_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "kind": { + "name": "kind", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "ref_id": { + "name": "ref_id", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "species": { + "name": "species", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "text": { + "name": "text", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "field_wq": { + "name": "field_wq", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "season": { + "name": "season", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "date": { + "name": "date", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "site_id": { + "name": "site_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_min": { + "name": "time_min", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "depth_cm": { + "name": "depth_cm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "salinity": { + "name": "salinity", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "do_mg": { + "name": "do_mg", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "do_pct": { + "name": "do_pct", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "temp": { + "name": "temp", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "ph": { + "name": "ph", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "source": { + "name": "source", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "hobo": { + "name": "hobo", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "season": { + "name": "season", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "site_id": { + "name": "site_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "site_raw": { + "name": "site_raw", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "logger": { + "name": "logger", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "deployed": { + "name": "deployed", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "retrieved": { + "name": "retrieved", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "notes": { + "name": "notes", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "individuals": { + "name": "individuals", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "species": { + "name": "species", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "sex": { + "name": "sex", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "first_date": { + "name": "first_date", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "last_date": { + "name": "last_date", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "n_captures": { + "name": "n_captures", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "n_seasons": { + "name": "n_seasons", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "sites": { + "name": "sites", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "first_tl_mm": { + "name": "first_tl_mm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "last_tl_mm": { + "name": "last_tl_mm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tags": { + "name": "tags", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "conflict": { + "name": "conflict", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "lab_feeding": { + "name": "lab_feeding", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "season": { + "name": "season", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "date": { + "name": "date", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tank": { + "name": "tank", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "shark": { + "name": "shark", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tag": { + "name": "tag", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "food_g": { + "name": "food_g", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "rejected_g": { + "name": "rejected_g", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "pct": { + "name": "pct", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "notes": { + "name": "notes", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "lab_sharks": { + "name": "lab_sharks", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "season": { + "name": "season", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "shark_no": { + "name": "shark_no", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tag": { + "name": "tag", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "individual_id": { + "name": "individual_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "species": { + "name": "species", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sex": { + "name": "sex", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "site_id": { + "name": "site_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "arrival_date": { + "name": "arrival_date", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "release_date": { + "name": "release_date", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "days": { + "name": "days", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "arr_tl_mm": { + "name": "arr_tl_mm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "arr_fl_mm": { + "name": "arr_fl_mm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "arr_mass_kg": { + "name": "arr_mass_kg", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "rel_tl_mm": { + "name": "rel_tl_mm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "rel_fl_mm": { + "name": "rel_fl_mm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "rel_mass_kg": { + "name": "rel_mass_kg", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tank": { + "name": "tank", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "project": { + "name": "project", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "died": { + "name": "died", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "notes": { + "name": "notes", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "source_file": { + "name": "source_file", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "source_sheet": { + "name": "source_sheet", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "source_row": { + "name": "source_row", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "lab_wq": { + "name": "lab_wq", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "season": { + "name": "season", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "date": { + "name": "date", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_min": { + "name": "time_min", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tank": { + "name": "tank", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "temp": { + "name": "temp", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "ph": { + "name": "ph", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "do_mg": { + "name": "do_mg", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "do_pct": { + "name": "do_pct", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "salinity": { + "name": "salinity", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "recorder": { + "name": "recorder", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "notes": { + "name": "notes", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "logger_daily": { + "name": "logger_daily", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "site_id": { + "name": "site_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "date": { + "name": "date", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "mean": { + "name": "mean", + "type": "real", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "min": { + "name": "min", + "type": "real", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "max": { + "name": "max", + "type": "real", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "hours": { + "name": "hours", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "loggers": { + "name": "loggers", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "logger_daily_site": { + "name": "logger_daily_site", + "columns": [ + "site_id" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "logger_diel": { + "name": "logger_diel", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "site_id": { + "name": "site_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "month": { + "name": "month", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "hour": { + "name": "hour", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "temp": { + "name": "temp", + "type": "real", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "n": { + "name": "n", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "logger_files": { + "name": "logger_files", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "file": { + "name": "file", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "system": { + "name": "system", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "logger": { + "name": "logger", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "serial": { + "name": "serial", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "site_id": { + "name": "site_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "site_basis": { + "name": "site_basis", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "start": { + "name": "start", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "end": { + "name": "end", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "samples": { + "name": "samples", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "kept": { + "name": "kept", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "lat": { + "name": "lat", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "lon": { + "name": "lon", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "excluded": { + "name": "excluded", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "meta": { + "name": "meta", + "columns": { + "key": { + "name": "key", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "value": { + "name": "value", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "mouth": { + "name": "mouth", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "season": { + "name": "season", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "shark_no": { + "name": "shark_no", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "site_id": { + "name": "site_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tag": { + "name": "tag", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "species": { + "name": "species", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sex": { + "name": "sex", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "mol": { + "name": "mol", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "mow": { + "name": "mow", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "ocean_daily": { + "name": "ocean_daily", + "columns": { + "date": { + "name": "date", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "oisst": { + "name": "oisst", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "crw_sst": { + "name": "crw_sst", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "crw_anom": { + "name": "crw_anom", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "crw_hotspot": { + "name": "crw_hotspot", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "crw_dhw": { + "name": "crw_dhw", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "crw_baa": { + "name": "crw_baa", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "wave_max": { + "name": "wave_max", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "wave_period": { + "name": "wave_period", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "wave_dir": { + "name": "wave_dir", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "swell_max": { + "name": "swell_max", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "prey": { + "name": "prey", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "season": { + "name": "season", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "date": { + "name": "date", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "location": { + "name": "location", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "size": { + "name": "size", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "notes": { + "name": "notes", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "school_holidays": { + "name": "school_holidays", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "school_year": { + "name": "school_year", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "start": { + "name": "start", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "end": { + "name": "end", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "source": { + "name": "source", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "set_crew": { + "name": "set_crew", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "set_id": { + "name": "set_id", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "person": { + "name": "person", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "set_crew_set": { + "name": "set_crew_set", + "columns": [ + "set_id" + ], + "isUnique": false + }, + "set_crew_person": { + "name": "set_crew_person", + "columns": [ + "person" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "sets": { + "name": "sets", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "season": { + "name": "season", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "set_no": { + "name": "set_no", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "site_id": { + "name": "site_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "site_raw": { + "name": "site_raw", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "date": { + "name": "date", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "weekday": { + "name": "weekday", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "gear": { + "name": "gear", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "visit": { + "name": "visit", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "crew_raw": { + "name": "crew_raw", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "crew_size": { + "name": "crew_size", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "start_min": { + "name": "start_min", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "end_min": { + "name": "end_min", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "duration_min": { + "name": "duration_min", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "n_cm": { + "name": "n_cm", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "n_na": { + "name": "n_na", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "n_nf": { + "name": "n_nf", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "n_total": { + "name": "n_total", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "n_linked": { + "name": "n_linked", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cpue": { + "name": "cpue", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cpue_cm": { + "name": "cpue_cm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cpue_na": { + "name": "cpue_na", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cpue_sheet": { + "name": "cpue_sheet", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tide_raw": { + "name": "tide_raw", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "moon_raw": { + "name": "moon_raw", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "weather_raw": { + "name": "weather_raw", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cloud_cover": { + "name": "cloud_cover", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "water_temp": { + "name": "water_temp", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "ph": { + "name": "ph", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "do_mg": { + "name": "do_mg", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "do_pct": { + "name": "do_pct", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "salinity": { + "name": "salinity", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "depth_cm": { + "name": "depth_cm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "notes": { + "name": "notes", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sunset_min": { + "name": "sunset_min", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "civil_dusk_min": { + "name": "civil_dusk_min", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "moon_phase": { + "name": "moon_phase", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "moon_illum": { + "name": "moon_illum", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "moon_alt_mid": { + "name": "moon_alt_mid", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tide_start_mm": { + "name": "tide_start_mm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tide_mid_mm": { + "name": "tide_mid_mm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tide_trend": { + "name": "tide_trend", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tide_range_mm": { + "name": "tide_range_mm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "air_temp": { + "name": "air_temp", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "wind_speed": { + "name": "wind_speed", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "wind_dir": { + "name": "wind_dir", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "gusts": { + "name": "gusts", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "rain_24h": { + "name": "rain_24h", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "rain_evening": { + "name": "rain_evening", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cloud_evening": { + "name": "cloud_evening", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "pressure": { + "name": "pressure", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sst": { + "name": "sst", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sst_anom": { + "name": "sst_anom", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "dhw": { + "name": "dhw", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "wave_height": { + "name": "wave_height", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "swell_height": { + "name": "swell_height", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "oni": { + "name": "oni", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "insitu_temp": { + "name": "insitu_temp", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "source_file": { + "name": "source_file", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "source_sheet": { + "name": "source_sheet", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "source_row": { + "name": "source_row", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "sets_season": { + "name": "sets_season", + "columns": [ + "season" + ], + "isUnique": false + }, + "sets_site": { + "name": "sets_site", + "columns": [ + "site_id" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "sites": { + "name": "sites", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "code": { + "name": "code", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "island": { + "name": "island", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "kind": { + "name": "kind", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "lat": { + "name": "lat", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "lon": { + "name": "lon", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "coord_source": { + "name": "coord_source", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "retired": { + "name": "retired", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "fishing_effort": { + "name": "fishing_effort", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "human_impact": { + "name": "human_impact", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "artificialisation": { + "name": "artificialisation", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "pressure_composite": { + "name": "pressure_composite", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "pressure_tier": { + "name": "pressure_tier", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "directions": { + "name": "directions", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "habitat": { + "name": "habitat", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "aliases": { + "name": "aliases", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "tide_extrema": { + "name": "tide_extrema", + "columns": { + "ts": { + "name": "ts", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "kind": { + "name": "kind", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "mm": { + "name": "mm", + "type": "real", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "tide_hourly": { + "name": "tide_hourly", + "columns": { + "ts": { + "name": "ts", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "mm": { + "name": "mm", + "type": "real", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "weather_daily": { + "name": "weather_daily", + "columns": { + "date": { + "name": "date", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "tmax": { + "name": "tmax", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tmin": { + "name": "tmin", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tmean": { + "name": "tmean", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "precip": { + "name": "precip", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "wind_max": { + "name": "wind_max", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "gust_max": { + "name": "gust_max", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "wind_dir": { + "name": "wind_dir", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "radiation": { + "name": "radiation", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cloud": { + "name": "cloud", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "pressure": { + "name": "pressure", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "humidity": { + "name": "humidity", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sunshine_h": { + "name": "sunshine_h", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "weather_hourly": { + "name": "weather_hourly", + "columns": { + "ts": { + "name": "ts", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "temp": { + "name": "temp", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "precip": { + "name": "precip", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cloud": { + "name": "cloud", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "wind": { + "name": "wind", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "wind_dir": { + "name": "wind_dir", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "gust": { + "name": "gust", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "pressure": { + "name": "pressure", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + } + }, + "views": {}, + "enums": {}, + "_meta": { + "schemas": {}, + "tables": {}, + "columns": {} + }, + "internal": { + "indexes": {} + } +} \ No newline at end of file diff --git a/drizzle/meta/_journal.json b/drizzle/meta/_journal.json index 65fa05f..cc2a586 100644 --- a/drizzle/meta/_journal.json +++ b/drizzle/meta/_journal.json @@ -29,6 +29,13 @@ "when": 1793678941733, "tag": "0003_careless_blue_blade", "breakpoints": true + }, + { + "idx": 4, + "version": "6", + "when": 1793692150045, + "tag": "0004_numerous_corsair", + "breakpoints": true } ] } \ No newline at end of file diff --git a/external/school-holidays.csv b/external/school-holidays.csv new file mode 100644 index 0000000..9841473 --- /dev/null +++ b/external/school-holidays.csv @@ -0,0 +1,113 @@ +school_year,name,start,end,source +2013-2014,September break,2013-09-15,2013-09-29,arrêté 0270/CM 2013 +2013-2014,November break,2013-11-01,2013-11-10,arrêté 0270/CM 2013 +2013-2014,Christmas break,2013-12-15,2014-01-12,arrêté 0270/CM 2013 +2013-2014,February break,2014-02-16,2014-02-23,arrêté 0270/CM 2013 +2013-2014,Easter break,2014-03-30,2014-04-13,arrêté 0270/CM 2013 +2013-2014,Summer holidays,2014-06-29,2014-08-12,arrêté 0270/CM 2013 +2014-2015,September break,2014-09-21,2014-09-28,arrêté 0399/CM 2014 +2014-2015,November break,2014-11-01,2014-11-11,arrêté 0399/CM 2014 +2014-2015,Christmas break,2014-12-14,2015-01-11,arrêté 0399/CM 2014 +2014-2015,February break,2015-02-15,2015-02-22,arrêté 0399/CM 2014 +2014-2015,Easter break,2015-03-29,2015-04-12,arrêté 0399/CM 2014 +2014-2015,May break,2015-05-14,2015-05-17,arrêté 0399/CM 2014 +2014-2015,Summer holidays,2015-06-26,2015-08-11,arrêté 0399/CM 2014 +2015-2016,September break,2015-09-20,2015-09-27,arrêté 0401/CM 2014 +2015-2016,November break,2015-11-01,2015-11-08,arrêté 0401/CM 2014 +2015-2016,Christmas break,2015-12-13,2016-01-10,arrêté 0401/CM 2014 +2015-2016,February break,2016-02-14,2016-02-21,arrêté 0401/CM 2014 +2015-2016,Easter break,2016-03-25,2016-04-10,arrêté 0401/CM 2014 +2015-2016,May break,2016-05-05,2016-05-08,arrêté 0401/CM 2014 +2015-2016,Summer holidays,2016-06-23,2016-08-09,arrêté 0401/CM 2014 +2016-2017,September break,2016-09-18,2016-09-25,arrêté 0403/CM 2014 +2016-2017,November break,2016-10-30,2016-11-06,arrêté 0403/CM 2014 +2016-2017,November break,2016-11-11,2016-11-13,arrêté 0403/CM 2014 +2016-2017,Christmas break,2016-12-11,2017-01-08,arrêté 0403/CM 2014 +2016-2017,February break,2017-02-12,2017-02-19,arrêté 0403/CM 2014 +2016-2017,Easter break,2017-03-26,2017-04-09,arrêté 0403/CM 2014 +2016-2017,Easter break,2017-04-14,2017-04-17,arrêté 0403/CM 2014 +2016-2017,May break,2017-05-25,2017-05-28,arrêté 0403/CM 2014 +2016-2017,Summer holidays,2017-06-22,2017-08-08,arrêté 0403/CM 2014 +2017-2018,September break,2017-09-16,2017-09-24,data.education.gouv.fr +2017-2018,November break,2017-10-28,2017-11-12,data.education.gouv.fr +2017-2018,Christmas break,2017-12-16,2018-01-14,data.education.gouv.fr +2017-2018,February break,2018-02-17,2018-02-25,data.education.gouv.fr +2017-2018,Easter break,2018-03-31,2018-04-15,data.education.gouv.fr +2017-2018,May break,2018-05-19,2018-05-27,data.education.gouv.fr +2017-2018,Summer holidays,2018-07-05,2018-08-16,data.education.gouv.fr +2018-2019,September break,2018-09-15,2018-09-23,data.education.gouv.fr +2018-2019,November break,2018-10-27,2018-11-11,data.education.gouv.fr +2018-2019,Christmas break,2018-12-15,2019-01-13,data.education.gouv.fr +2018-2019,February break,2019-02-16,2019-02-24,data.education.gouv.fr +2018-2019,Easter break,2019-04-06,2019-04-21,data.education.gouv.fr +2018-2019,May break,2019-05-25,2019-06-02,data.education.gouv.fr +2018-2019,Summer holidays,2019-07-04,2019-08-13,data.education.gouv.fr +2019-2020,September break,2019-09-14,2019-09-22,data.education.gouv.fr +2019-2020,November break,2019-10-26,2019-11-11,data.education.gouv.fr +2019-2020,Christmas break,2019-12-14,2020-01-12,data.education.gouv.fr +2019-2020,February break,2020-02-15,2020-02-23,data.education.gouv.fr +2019-2020,Easter break,2020-03-28,2020-04-13,data.education.gouv.fr +2019-2020,May break,2020-05-16,2020-05-24,data.education.gouv.fr +2019-2020,Summer holidays,2020-07-02,2020-08-11,data.education.gouv.fr +2020-2021,September break,2020-09-12,2020-09-20,data.education.gouv.fr +2020-2021,November break,2020-10-24,2020-11-08,data.education.gouv.fr +2020-2021,Christmas break,2020-12-12,2021-01-10,data.education.gouv.fr +2020-2021,February break,2021-02-20,2021-02-28,data.education.gouv.fr +2020-2021,Easter break,2021-04-03,2021-04-18,data.education.gouv.fr +2020-2021,May break,2021-05-22,2021-05-30,data.education.gouv.fr +2020-2021,Summer holidays,2021-06-26,2021-08-10,data.education.gouv.fr +2021-2022,September break,2021-09-11,2021-09-19,data.education.gouv.fr +2021-2022,November break,2021-10-23,2021-11-07,data.education.gouv.fr +2021-2022,Christmas break,2021-12-11,2022-01-09,data.education.gouv.fr +2021-2022,February break,2022-02-19,2022-02-27,data.education.gouv.fr +2021-2022,Easter break,2022-04-02,2022-04-18,data.education.gouv.fr +2021-2022,May break,2022-05-21,2022-05-29,data.education.gouv.fr +2021-2022,Summer holidays,2022-06-25,2022-08-09,data.education.gouv.fr +2022-2023,September break,2022-09-10,2022-09-18,data.education.gouv.fr +2022-2023,November break,2022-10-22,2022-11-06,data.education.gouv.fr +2022-2023,Christmas break,2022-12-10,2023-01-08,data.education.gouv.fr +2022-2023,February break,2023-02-18,2023-02-26,data.education.gouv.fr +2022-2023,Easter break,2023-04-01,2023-04-16,data.education.gouv.fr +2022-2023,May break,2023-05-20,2023-05-29,data.education.gouv.fr +2022-2023,Summer holidays,2023-06-30,2023-08-15,data.education.gouv.fr +2023-2024,September break,2023-09-16,2023-09-24,data.education.gouv.fr +2023-2024,November break,2023-10-28,2023-11-12,data.education.gouv.fr +2023-2024,Christmas break,2023-12-16,2024-01-14,data.education.gouv.fr +2023-2024,February break,2024-02-17,2024-02-25,data.education.gouv.fr +2023-2024,Easter break,2024-03-30,2024-04-14,data.education.gouv.fr +2023-2024,May break,2024-05-18,2024-05-26,data.education.gouv.fr +2023-2024,Summer holidays,2024-07-05,2024-08-13,data.education.gouv.fr +2024-2025,September break,2024-09-14,2024-09-22,data.education.gouv.fr +2024-2025,November break,2024-10-26,2024-11-11,data.education.gouv.fr +2024-2025,Christmas break,2024-12-14,2025-01-12,data.education.gouv.fr +2024-2025,February break,2025-02-15,2025-02-23,data.education.gouv.fr +2024-2025,Easter break,2025-03-28,2025-04-13,data.education.gouv.fr +2024-2025,May break,2025-05-24,2025-06-01,data.education.gouv.fr +2024-2025,Summer holidays,2025-07-04,2025-08-12,data.education.gouv.fr +2025-2026,September break,2025-09-13,2025-09-21,data.education.gouv.fr +2025-2026,November break,2025-10-25,2025-11-09,data.education.gouv.fr +2025-2026,Christmas break,2025-12-13,2026-01-11,data.education.gouv.fr +2025-2026,February break,2026-02-14,2026-02-22,data.education.gouv.fr +2025-2026,Easter break,2026-03-28,2026-04-12,data.education.gouv.fr +2025-2026,May break,2026-05-23,2026-05-31,data.education.gouv.fr +2025-2026,Summer holidays,2026-07-03,2026-08-10,data.education.gouv.fr +2026-2027,September break,2026-09-12,2026-09-20,data.education.gouv.fr +2026-2027,November break,2026-10-24,2026-11-08,data.education.gouv.fr +2026-2027,Christmas break,2026-12-12,2027-01-10,data.education.gouv.fr +2026-2027,February break,2027-02-13,2027-02-21,data.education.gouv.fr +2026-2027,Easter break,2027-03-27,2027-04-11,data.education.gouv.fr +2026-2027,May break,2027-05-15,2027-05-23,data.education.gouv.fr +2026-2027,Summer holidays,2027-07-02,2027-08-23,data.education.gouv.fr +2027-2028,September break,2027-09-25,2027-10-03,data.education.gouv.fr +2027-2028,November break,2027-11-06,2027-11-14,data.education.gouv.fr +2027-2028,Christmas break,2027-12-18,2028-01-16,data.education.gouv.fr +2027-2028,February break,2028-02-19,2028-03-05,data.education.gouv.fr +2027-2028,Easter break,2028-04-08,2028-04-17,data.education.gouv.fr +2027-2028,May break,2028-05-20,2028-05-28,data.education.gouv.fr +2027-2028,Summer holidays,2028-07-07,2028-08-21,data.education.gouv.fr +2028-2029,September break,2028-09-23,2028-10-01,data.education.gouv.fr +2028-2029,November break,2028-11-04,2028-11-12,data.education.gouv.fr +2028-2029,Christmas break,2028-12-16,2029-01-14,data.education.gouv.fr +2028-2029,February break,2029-02-17,2029-03-05,data.education.gouv.fr +2028-2029,Easter break,2029-04-07,2029-04-15,data.education.gouv.fr +2028-2029,May break,2029-05-19,2029-05-27,data.education.gouv.fr diff --git a/scripts/fetch-external.mjs b/scripts/fetch-external.mjs index cc32627..de8cda2 100644 --- a/scripts/fetch-external.mjs +++ b/scripts/fetch-external.mjs @@ -13,6 +13,9 @@ * - UHSLC fast-delivery hourly sea level, Papeete (station 015) * - NOAA CPC Oceanic Niño Index and Southern Oscillation Index * - NOAA IBTrACS v04r01 South Pacific best tracks (cyclone positions near Moorea, #24) + * - French Polynesia school holidays (#25): the Ministère de l'Éducation nationale's + * "Le calendrier scolaire" open data (Licence Ouverte 2.0) since 2017-18, and the Polynesian + * government's archived calendar orders for 2013-14 to 2016-17 * * Output files are small CSVs (hourly series gzipped) committed to the repo, so the app and CI * never need network access. No spreadsheet data is read or sent anywhere. @@ -395,7 +398,119 @@ async function cyclones() { console.log(`[external] cyclones: ${rows.length} track points`); } -const jobs = { weather, ocean, tide, climate, cyclones }; +/** + * French Polynesia school holidays before 2017-18, transcribed from the Council of Ministers' + * orders (arrêtés) for collèges and lycées, archived from education.pf by the Wayback Machine: + * https://web.archive.org/web/2017/http://education.pf/des.pf.old/fichiers_des/Calendriers/ + * Dates are the first and last day off; the orders say "from after classes + * to ". Lone Saturdays without morning classes (2 and 9 May 2015) are left out. + */ +const ARCHIVED_SCHOOL_HOLIDAYS = [ + // 2013-14: arrêté 332/CM of 17 March 2011, amended by 0270/CM of 28 February 2013 (September + // and summer); the other breaks are read from the amended calendar published with it. + ['2013-2014', 'September break', '2013-09-15', '2013-09-29', 'arrêté 0270/CM 2013'], + ['2013-2014', 'November break', '2013-11-01', '2013-11-10', 'arrêté 0270/CM 2013'], + ['2013-2014', 'Christmas break', '2013-12-15', '2014-01-12', 'arrêté 0270/CM 2013'], + ['2013-2014', 'February break', '2014-02-16', '2014-02-23', 'arrêté 0270/CM 2013'], + ['2013-2014', 'Easter break', '2014-03-30', '2014-04-13', 'arrêté 0270/CM 2013'], + ['2013-2014', 'Summer holidays', '2014-06-29', '2014-08-12', 'arrêté 0270/CM 2013'], + // 2014-15: arrêté 0399/CM of 12 March 2014. + ['2014-2015', 'September break', '2014-09-21', '2014-09-28', 'arrêté 0399/CM 2014'], + ['2014-2015', 'November break', '2014-11-01', '2014-11-11', 'arrêté 0399/CM 2014'], + ['2014-2015', 'Christmas break', '2014-12-14', '2015-01-11', 'arrêté 0399/CM 2014'], + ['2014-2015', 'February break', '2015-02-15', '2015-02-22', 'arrêté 0399/CM 2014'], + ['2014-2015', 'Easter break', '2015-03-29', '2015-04-12', 'arrêté 0399/CM 2014'], + ['2014-2015', 'May break', '2015-05-14', '2015-05-17', 'arrêté 0399/CM 2014'], + ['2014-2015', 'Summer holidays', '2015-06-26', '2015-08-11', 'arrêté 0399/CM 2014'], + // 2015-16: arrêté 0401/CM of 12 March 2014. + ['2015-2016', 'September break', '2015-09-20', '2015-09-27', 'arrêté 0401/CM 2014'], + ['2015-2016', 'November break', '2015-11-01', '2015-11-08', 'arrêté 0401/CM 2014'], + ['2015-2016', 'Christmas break', '2015-12-13', '2016-01-10', 'arrêté 0401/CM 2014'], + ['2015-2016', 'February break', '2016-02-14', '2016-02-21', 'arrêté 0401/CM 2014'], + ['2015-2016', 'Easter break', '2016-03-25', '2016-04-10', 'arrêté 0401/CM 2014'], + ['2015-2016', 'May break', '2016-05-05', '2016-05-08', 'arrêté 0401/CM 2014'], + ['2015-2016', 'Summer holidays', '2016-06-23', '2016-08-09', 'arrêté 0401/CM 2014'], + // 2016-17: arrêté 0403/CM of 12 March 2014. + ['2016-2017', 'September break', '2016-09-18', '2016-09-25', 'arrêté 0403/CM 2014'], + ['2016-2017', 'November break', '2016-10-30', '2016-11-06', 'arrêté 0403/CM 2014'], + ['2016-2017', 'November break', '2016-11-11', '2016-11-13', 'arrêté 0403/CM 2014'], + ['2016-2017', 'Christmas break', '2016-12-11', '2017-01-08', 'arrêté 0403/CM 2014'], + ['2016-2017', 'February break', '2017-02-12', '2017-02-19', 'arrêté 0403/CM 2014'], + ['2016-2017', 'Easter break', '2017-03-26', '2017-04-09', 'arrêté 0403/CM 2014'], + ['2016-2017', 'Easter break', '2017-04-14', '2017-04-17', 'arrêté 0403/CM 2014'], + ['2016-2017', 'May break', '2017-05-25', '2017-05-28', 'arrêté 0403/CM 2014'], + ['2016-2017', 'Summer holidays', '2017-06-22', '2017-08-08', 'arrêté 0403/CM 2014'] +]; + +const SCHOOL_BREAK_NAMES = { + 'Vacances de Septembre': 'September break', + 'Vacances de Novembre': 'November break', + 'Vacances de Noël': 'Christmas break', + 'Vacances de Février': 'February break', + 'Vacances de Pâques': 'Easter break', + 'Vacances de Mai': 'May break', + 'Grandes Vacances': 'Summer holidays' +}; + +/** + * Known slips in the national dataset: [school year, break, field, wrong date, right date]. The + * 2023 November break "starts" on 28 September, inside the September break; every other year it + * starts on the Saturday about two weeks before classes resume in November. + */ +const SCHOOL_ERRATA = [['2023-2024', 'November break', 'start', '2023-09-28', '2023-10-28']]; + +/** Local calendar date in Paris (the dataset's timestamps are Paris midnights in UTC). */ +const parisDay = (ts) => new Date(ts).toLocaleDateString('sv-SE', { timeZone: 'Europe/Paris' }); + +/** School holidays since 2013-14: archived orders, then the Ministry's open data (Etalab 2.0). */ +async function school() { + console.log('[external] school holidays (archived orders + data.education.gouv.fr)'); + // The export endpoint returns every match (records/ stops at 100). + const results = await get( + 'https://data.education.gouv.fr/api/explore/v2.1/catalog/datasets/fr-en-calendrier-scolaire/exports/json?' + + new URLSearchParams({ where: 'location="Polynésie"', order_by: 'start_date' }), + { json: true } + ); + // Pupils only: a day counts when pupils at either level are off. Teachers' dates are dropped. + const merged = new Map(); + for (const r of results) { + if (/^enseignants/i.test(r.population ?? '')) continue; + const name = SCHOOL_BREAK_NAMES[r.description]; + // e.g. "Début des Grandes Vacances", a start-only marker for a year not yet fully set. + if (!name) { + console.warn(`[external] school holidays: skipped "${r.description}" ${r.annee_scolaire}`); + continue; + } + const key = `${r.annee_scolaire}|${name}`; + const start = parisDay(r.start_date); + // end_date is the day classes resume. + const end = isoDay(new Date(Date.parse(`${parisDay(r.end_date)}T00:00:00Z`) - 86_400_000)); + const m = merged.get(key); + if (m) { + m[2] = start < m[2] ? start : m[2]; + m[3] = end > m[3] ? end : m[3]; + } else merged.set(key, [r.annee_scolaire, name, start, end, 'data.education.gouv.fr']); + } + for (const [year, name, field, wrong, right] of SCHOOL_ERRATA) { + const m = merged.get(`${year}|${name}`); + const i = field === 'start' ? 2 : 3; + if (m?.[i] === wrong) m[i] = right; + } + const firstYear = '2017-2018'; + const rows = [ + ...ARCHIVED_SCHOOL_HOLIDAYS, + ...[...merged.values()].filter((r) => r[0] >= firstYear) + ].sort((a, b) => a[2].localeCompare(b[2])); + // Breaks must not overlap or run backwards: a typo upstream would otherwise go unnoticed. + for (let i = 0; i < rows.length; i++) { + const [year, name, start, end] = rows[i]; + if (end < start || (i > 0 && start <= rows[i - 1][3])) + throw new Error(`school holidays: ${year} ${name} ${start}–${end} overlaps or is reversed`); + } + writeCsv('school-holidays.csv', ['school_year', 'name', 'start', 'end', 'source'], rows); +} + +const jobs = { weather, ocean, tide, climate, cyclones, school }; for (const [name, job] of Object.entries(jobs)) { if (!want(name)) continue; try { diff --git a/src/lib/server/data.ts b/src/lib/server/data.ts index 2d638b0..d819b22 100644 --- a/src/lib/server/data.ts +++ b/src/lib/server/data.ts @@ -46,6 +46,7 @@ export interface Dataset { ocean: OceanDay[]; climate: (typeof schema.climateMonthly.$inferSelect)[]; cyclones: (typeof schema.cyclonePoints.$inferSelect)[]; + schoolHolidays: (typeof schema.schoolHolidays.$inferSelect)[]; issues: DataIssue[]; seasons: string[]; } @@ -98,6 +99,11 @@ export function dataset(): Dataset { ocean: db.select().from(schema.oceanDaily).orderBy(asc(schema.oceanDaily.date)).all(), climate: db.select().from(schema.climateMonthly).orderBy(asc(schema.climateMonthly.ym)).all(), cyclones: db.select().from(schema.cyclonePoints).orderBy(asc(schema.cyclonePoints.ts)).all(), + schoolHolidays: db + .select() + .from(schema.schoolHolidays) + .orderBy(asc(schema.schoolHolidays.start)) + .all(), issues: db.select().from(schema.dataIssues).all(), seasons }; diff --git a/src/lib/server/db/schema.ts b/src/lib/server/db/schema.ts index 337caf4..cdf5871 100644 --- a/src/lib/server/db/schema.ts +++ b/src/lib/server/db/schema.ts @@ -498,6 +498,16 @@ export const cyclonePoints = sqliteTable('cyclone_points', { distKm: real('dist_km').notNull() }); +/** French Polynesia school holidays: first and last day off, local dates (#25). */ +export const schoolHolidays = sqliteTable('school_holidays', { + id: integer('id').primaryKey(), + schoolYear: text('school_year').notNull(), // 2017-2018 + name: text('name').notNull(), // Christmas break… + start: text('start').notNull(), + end: text('end').notNull(), + source: text('source').notNull() +}); + export const climateMonthly = sqliteTable('climate_monthly', { ym: text('ym').primaryKey(), // YYYY-MM oni: real('oni'), diff --git a/src/lib/server/holidays.test.ts b/src/lib/server/holidays.test.ts index d9d1ee8..537feb7 100644 --- a/src/lib/server/holidays.test.ts +++ b/src/lib/server/holidays.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest'; -import { dayType, easter, holidayOn, publicHolidays } from './holidays'; +import { dayType, easter, holidayOn, publicHolidays, schoolDays } from './holidays'; describe('French Polynesia holidays', () => { it('computes Easter', () => { @@ -30,4 +30,18 @@ describe('French Polynesia holidays', () => { expect(dayType('2023-11-18')).toBe('Weekend'); expect(dayType('2023-11-21')).toBe('Weekday'); }); + + it('spreads school breaks over their days', () => { + const school = schoolDays([ + { name: 'November break', start: '2023-10-28', end: '2023-11-12' }, + { name: 'Christmas break', start: '2023-12-16', end: '2024-01-14' } + ]); + expect(school.size).toBe(16 + 30); + expect(school.get('2023-12-31')).toBe('Christmas break'); + expect(dayType('2023-11-01', school)).toBe('Public holiday'); + expect(dayType('2023-11-04', school)).toBe('School holidays'); // a Saturday + expect(dayType('2023-11-13', school)).toBe('Weekday'); + expect(dayType('2023-12-18', school)).toBe('School holidays'); + expect(dayType('2023-12-20', school)).toBe('Festive period'); + }); }); diff --git a/src/lib/server/holidays.ts b/src/lib/server/holidays.ts index 4ed6e22..b4b352d 100644 --- a/src/lib/server/holidays.ts +++ b/src/lib/server/holidays.ts @@ -1,10 +1,10 @@ /** * Human-activity proxies for French Polynesia (#25): public holidays (computed, including the - * Easter-based ones) and the Christmas–New Year festive period. Dates are local (UTC−10) ISO - * strings, like set dates. + * Easter-based ones), the Christmas–New Year festive period and school holidays. Dates are local + * (UTC−10) ISO strings, like set dates. * - * School holidays are not included: the Polynesian school calendar changes every year and isn't - * derivable from rules. The festive window below is a deliberately generic stand-in. + * School holidays change every year, so they come from `external/school-holidays.csv` (archived + * calendar orders for 2013-14 to 2016-17, the Ministry's open data since) via `schoolDays`. */ /** Easter Sunday (Gregorian, anonymous algorithm) as an ISO date. */ @@ -68,13 +68,37 @@ export function isFestive(iso: string): boolean { return md >= '12-20' || md <= '01-05'; } -export type DayType = 'Public holiday' | 'Festive period' | 'Weekend' | 'Weekday'; -export const DAY_TYPES: DayType[] = ['Weekday', 'Weekend', 'Public holiday', 'Festive period']; +export interface SchoolBreak { + name: string; + start: string; // first day off + end: string; // last day off +} + +/** Every day of the school breaks: ISO date → break name. */ +export function schoolDays(breaks: SchoolBreak[]): Map { + const out = new Map(); + for (const b of breaks) for (let d = b.start; d <= b.end; d = addDays(d, 1)) out.set(d, b.name); + return out; +} -/** One label per date; a holiday wins over the festive window, which wins over the weekend. */ -export function dayType(iso: string): DayType { +export type DayType = + 'Public holiday' | 'Festive period' | 'School holidays' | 'Weekend' | 'Weekday'; +export const DAY_TYPES: DayType[] = [ + 'Weekday', + 'Weekend', + 'School holidays', + 'Public holiday', + 'Festive period' +]; + +/** + * One label per date: a public holiday wins over the festive window, which wins over the school + * holidays, which win over the weekend. + */ +export function dayType(iso: string, school: Map = new Map()): DayType { if (holidayOn(iso)) return 'Public holiday'; if (isFestive(iso)) return 'Festive period'; + if (school.has(iso)) return 'School holidays'; const wd = new Date(`${iso}T00:00:00Z`).getUTCDay(); return wd === 0 || wd === 6 ? 'Weekend' : 'Weekday'; } diff --git a/src/lib/server/import/external.ts b/src/lib/server/import/external.ts index 360e906..f6f715f 100644 --- a/src/lib/server/import/external.ts +++ b/src/lib/server/import/external.ts @@ -34,5 +34,6 @@ export const EXTERNAL_FILES = [ 'ocean-daily.csv', 'tide-papeete-hourly.csv.gz', 'climate-monthly.csv', - 'cyclones.csv' + 'cyclones.csv', + 'school-holidays.csv' ]; diff --git a/src/lib/server/import/import.test.ts b/src/lib/server/import/import.test.ts index c6480c8..8802028 100644 --- a/src/lib/server/import/import.test.ts +++ b/src/lib/server/import/import.test.ts @@ -4,6 +4,7 @@ import { diet } from '../analytics/diet'; import { weatherEvents } from '../analytics/events'; import { topFindings } from '../analytics/findings'; import { seasonRewind } from '../analytics/rewind'; +import { schoolDays } from '../holidays'; // DATA_DIR points at samples/fixture (synthetic) and DATABASE_PATH at :memory: (vitest.config.ts). describe('import of the synthetic fixture', () => { @@ -82,6 +83,17 @@ describe('import of the synthetic fixture', () => { expect(ev.threshold).toBeGreaterThan(20); }); + it('loads French Polynesia school holidays (#25)', () => { + // external/ is the committed public snapshot (official calendars), not synthetic data. + const years = new Set(d.schoolHolidays.map((b) => b.schoolYear)); + for (let y = 2013; y <= 2025; y++) expect(years.has(`${y}-${y + 1}`)).toBe(true); + const days = schoolDays(d.schoolHolidays); + expect(days.get('2014-12-25')).toBe('Christmas break'); + expect(days.get('2023-11-01')).toBe('November break'); + expect(days.has('2023-10-02')).toBe(false); + for (const b of d.schoolHolidays) expect(b.start <= b.end).toBe(true); + }); + it('computes findings without throwing', () => { expect(topFindings(d).length).toBeGreaterThan(3); }); diff --git a/src/lib/server/import/index.ts b/src/lib/server/import/index.ts index 0ebbf54..3cfd073 100644 --- a/src/lib/server/import/index.ts +++ b/src/lib/server/import/index.ts @@ -73,7 +73,7 @@ import { SITE_DEFS } from './sites'; import { readWorkbook } from './xlsx'; /** Bump when import logic changes so existing caches rebuild on the next start. */ -export const IMPORTER_VERSION = '7'; +export const IMPORTER_VERSION = '8'; const MIGRATIONS = import.meta.glob('/drizzle/*.sql', { query: '?raw', @@ -531,6 +531,7 @@ export function runImport( const ocean = new Map(readCsv(opts.externalDir, 'ocean-daily.csv').map((r) => [r.date, r])); const climate = new Map(readCsv(opts.externalDir, 'climate-monthly.csv').map((r) => [r.ym, r])); const cyclones = readCsv(opts.externalDir, 'cyclones.csv'); + const school = readCsv(opts.externalDir, 'school-holidays.csv'); const tidePts: HourlyPoint[] = readCsv(opts.externalDir, 'tide-papeete-hourly.csv') .map((r) => ({ t: tsToHour(r.ts), mm: Number(r.mm) })) .filter((x) => Number.isFinite(x.mm)) @@ -1036,6 +1037,18 @@ export function runImport( distKm: val(r.dist_km)! })) ); + insert( + schema.schoolHolidays, + school + .filter((r) => r.start && r.end) + .map((r) => ({ + schoolYear: r.school_year, + name: r.name, + start: r.start, + end: r.end, + source: r.source + })) + ); insert(schema.dataIssues, log.items); const metaRows = { hash, diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 650b5ce..d29e332 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -206,7 +206,8 @@

Weather & waves: Open-Meteo (ERA5, CC BY 4.0). SST: NOAA OISST v2.1. Heat stress: NOAA Coral Reef Watch via PacIOOS. Tides: UHSLC Papeete gauge. ENSO: NOAA CPC. Cyclones: NOAA - IBTrACS. Coastline © OpenStreetMap contributors. + IBTrACS. School holidays: Ministère de l'Éducation nationale (Licence Ouverte 2.0). + Coastline © OpenStreetMap contributors.

diff --git a/src/routes/about/+page.svelte b/src/routes/about/+page.svelte index 38b5469..3e16ff6 100644 --- a/src/routes/about/+page.svelte +++ b/src/routes/about/+page.svelte @@ -60,6 +60,15 @@ Cyclones: NOAA IBTrACS v04r01 South Pacific best tracks, positions within 750 km of Mo'orea. A heavy-rain day is one of the wettest 1% of days in the ERA5 daily series. +
  • + School holidays: French Polynesia's official school calendars: the Polynesian + government's calendar orders for 2013-14 to 2016-17 (collèges and lycées, archived from + education.pf), then the French Ministry of Education's + Le calendrier scolaire + open data (Licence Ouverte 2.0). +
  • Sun and moon: computed for Mo'orea (17.53° S, 149.83° W, UTC−10) from standard astronomical formulas. diff --git a/src/routes/pressure/+page.server.ts b/src/routes/pressure/+page.server.ts index a8e2fb5..d0dd2c4 100644 --- a/src/routes/pressure/+page.server.ts +++ b/src/routes/pressure/+page.server.ts @@ -9,7 +9,7 @@ import { recapturePairs, round } from '#lib/server/analytics/common'; -import { DAY_TYPES, dayType, holidayOn } from '#lib/server/holidays'; +import { DAY_TYPES, dayType, holidayOn, schoolDays } from '#lib/server/holidays'; import { mean, median, pairs, se, spearman, welch } from '#lib/stats'; import type { PageServerLoad } from './$types'; @@ -74,6 +74,8 @@ export const load: PageServerLoad = () => // Busy days (#25): do weekends and holidays, when more people are on the water, change the // evening catch? Mean per-set catch rate with a ±1.96·SE interval. const dated = eff.filter((s) => s.date && s.cpue != null); + const school = schoolDays(d.schoolHolidays); + const type = (s: (typeof dated)[number]) => dayType(s.date!, school); const group = (ss: typeof dated, label: string) => { const ys = ss.map((s) => s.cpue); const m = mean(ys); @@ -88,7 +90,7 @@ export const load: PageServerLoad = () => }; const byType = DAY_TYPES.map((t) => group( - dated.filter((s) => dayType(s.date!) === t), + dated.filter((s) => type(s) === t), t ) ); @@ -98,17 +100,30 @@ export const load: PageServerLoad = () => ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'][i] ) ); - const busy = dated.filter((s) => dayType(s.date!) !== 'Weekday'); - const quiet = dated.filter((s) => dayType(s.date!) === 'Weekday'); + const busy = dated.filter((s) => type(s) !== 'Weekday'); + const quiet = dated.filter((s) => type(s) === 'Weekday'); const test = welch( busy.map((s) => s.cpue), quiet.map((s) => s.cpue) ); + // School holidays on weekdays only, against term-time weekdays (`quiet`): keeps weekends out. + const breakDays = dated.filter( + (s) => type(s) === 'School holidays' && s.weekday !== 0 && s.weekday !== 6 + ); + const schoolTest = welch( + breakDays.map((s) => s.cpue), + quiet.map((s) => s.cpue) + ); const holidaySets = new Map(); + const breakSets = new Map(); for (const s of dated) { const h = holidayOn(s.date!); if (h) holidaySets.set(h, (holidaySets.get(h) ?? 0) + 1); + const b = school.get(s.date!); + if (b) breakSets.set(b, (breakSets.get(b) ?? 0) + 1); } + const counts = (m: Map) => + [...m].sort((a, b) => b[1] - a[1]).map(([name, n]) => ({ name, n })); return { rows, metrics, @@ -120,7 +135,16 @@ export const load: PageServerLoad = () => busyMean: round(mean(busy.map((s) => s.cpue)), 2), quietMean: round(mean(quiet.map((s) => s.cpue)), 2), p: test ? round(test.p, 3) : null, - holidays: [...holidaySets].sort((a, b) => b[1] - a[1]).map(([name, n]) => ({ name, n })) + school: { + since: d.schoolHolidays[0]?.schoolYear ?? null, + breakMean: round(mean(breakDays.map((s) => s.cpue)), 2), + termMean: round(mean(quiet.map((s) => s.cpue)), 2), + nBreak: breakDays.length, + nTerm: quiet.length, + p: schoolTest ? round(schoolTest.p, 3) : null + }, + holidays: counts(holidaySets), + breaks: counts(breakSets) } }; }); diff --git a/src/routes/pressure/+page.svelte b/src/routes/pressure/+page.svelte index 4379779..7ece842 100644 --- a/src/routes/pressure/+page.svelte +++ b/src/routes/pressure/+page.svelte @@ -23,6 +23,15 @@ : 'That is within what chance alone would produce.'; return `Busy days average ${num(busyMean, 2)} sharks per net-hour against ${num(quietMean, 2)} on ordinary weekdays${test}. ${verdict}`; }); + const schoolText = $derived.by(() => { + const s = data.busyDays.school; + if (s.p == null) return ''; + const verdict = + s.p < 0.05 + ? `${s.breakMean! > s.termMean! ? 'higher' : 'lower'} than chance alone would explain` + : 'a difference chance alone would produce'; + return `On weekdays in the school holidays (${s.nBreak} sets), catches average ${num(s.breakMean, 2)} sharks per net-hour against ${num(s.termMean, 2)} on term-time weekdays (${s.nTerm} sets; p = ${num(s.p, 3)}): ${verdict}.`; + });
    @@ -152,9 +161,13 @@

    Busy days

    - A rough proxy for people on the water: weekends, French Polynesia's public holidays and the - Christmas–New Year period (20 Dec – 5 Jan). {busyText} - School holidays aren't included yet: the Polynesian school calendar changes every year. + A rough proxy for people on the water: weekends, French Polynesia's public holidays, the + Christmas–New Year period (20 Dec – 5 Jan) and the Polynesian school holidays{data.busyDays + .school.since + ? ` (official calendars since ${data.busyDays.school.since})` + : ''}. Each date gets one label: a public holiday beats the Christmas–New Year period, which + beats the school holidays, which beat the weekend. {busyText} + {schoolText}

    {/if} + {#if data.busyDays.breaks.length} +

    + Sets in the school holidays: {data.busyDays.breaks + .map((h) => `${h.name} (${h.n})`) + .join(', ')}. School calendars: the Polynesian government's archived orders for 2013-14 to + 2016-17 (collèges and lycées), then the French Ministry of Education's open data (Licence + Ouverte 2.0). +

    + {/if}