Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,16 @@ uv run quarto render
- **Testing:** add or update tests for non-trivial logic.
- **Paradigm:** prefer functional programming patterns over object-oriented programming.

### Dashboard changes

- When editing files under `dashboards/`, check whether the change affects published dashboard data,
interpretation, navigation, metadata, or presentation.
- Record relevant dashboard changes in `dashboards/_data/hei-changelog.json`, including the commit
SHA once available; keep `tests/test_common.py::test_latest_hei_changelog_date` aligned when the
latest changelog date changes.
- Purely internal refactors that do not affect rendered dashboards or published data may be omitted,
but note that decision in the PR or final summary.

Common commands:

```bash
Expand Down
14 changes: 7 additions & 7 deletions dashboards/_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@
"Univ. Inst.": "University institutes",
"UAS": "Universities of applied sciences (UAS)",
"UAS Inst.": "UAS institutes",
"UTE": "Teacher education institutions",
"UTE": "Universities of Teacher Education (UTE)",
}

INSTITUTION_TYPE_ROWS: list[tuple[str, str]] = [
("University", "Cantonal universities and federal institutes of technology"),
("Univ. Inst.", "University institutes"),
("UAS", "Universities of applied sciences"),
("UAS Inst.", "UAS institutes"),
("UTE", "Teacher education institutions"),
("UTE", "Universities of Teacher Education"),
]

# -- Formatting helpers --------------------------------------------------------
Expand Down Expand Up @@ -129,10 +129,7 @@ def make_link(url: str, label: str) -> str:
def institution_type_table_html() -> str:
"""Return the shared institution type reference table as HTML."""
rows = "".join(
(
f"<tr><td><strong>{abbreviation}</strong></td>"
f"<td>{description}</td></tr>"
)
(f"<tr><td><strong>{abbreviation}</strong></td><td>{description}</td></tr>")
for abbreviation, description in INSTITUTION_TYPE_ROWS
)
return (
Expand Down Expand Up @@ -229,7 +226,10 @@ def ensure_csv_xlsx_export(
source_path = Path(csv_path)
output_path = Path(xlsx_path)

if output_path.exists() and output_path.stat().st_mtime >= source_path.stat().st_mtime:
if (
output_path.exists()
and output_path.stat().st_mtime >= source_path.stat().st_mtime
):
return output_path

dataframe = pd.read_csv(source_path, dtype=str).fillna("")
Expand Down
65 changes: 65 additions & 0 deletions dashboards/_data/hei-changelog.json
Original file line number Diff line number Diff line change
Expand Up @@ -205,5 +205,70 @@
"message": "fix: fix #17 and #15"
}
]
},
{
"date": "2026-05-04",
"scope": "Dashboards",
"title": "Shared dashboard helpers, site usage dashboard, and FHNW name correction",
"summary": "Dashboard maintenance centralised repeated markup, added the Matomo-backed site usage dashboard, and corrected the English and German FHNW display names in the shared HEI data.",
"row_count_before": 55,
"row_count_after": 55,
"changes": [
"Updated `FHNW` from `University of Applied Sciences Northwestern Switzerland` to `University of Applied Sciences and Arts Northwestern Switzerland` and changed `name_de` to `Fachhochschule Nordwestschweiz FHNW`.",
"Added the site usage dashboard and checked-in Matomo usage snapshot used for historic usage reporting.",
"Extracted shared dashboard table, download, and institution-type markup helpers used by the NAIF, Swiss HEI Open Data, and TOBI dashboards."
],
"corrections": [
"The HEI row count stayed unchanged; only one institution display name and shared dashboard presentation code changed."
],
"commits": [
{
"sha": "4fbcf38af71ecb28118c4fe852fe6632278058c1",
"message": "Declutter, ORD & Matomo Stats (#21)"
}
]
},
{
"date": "2026-05-19",
"scope": "Dashboards",
"title": "Dashboard index order and descriptions curated",
"summary": "The dashboards landing page was changed from date-based discovery to an explicit curated order, and dashboard listing descriptions were refreshed.",
"row_count_before": 55,
"row_count_after": 55,
"changes": [
"Set explicit dashboard listing order: Swiss HEI Open Data, DORA and CoARA, TOBI, and Site usage.",
"Refined dashboard descriptions for the index, NAIF, Swiss HEI Open Data, TOBI, and Site usage pages.",
"Added `listing-order` metadata to the individual dashboard pages."
],
"corrections": [
"This was a dashboard navigation and metadata change only; the shared HEI data rows stayed unchanged."
],
"commits": [
{
"sha": "3c47a00cf348e5261664ed874e27b01ae3d90c2c",
"message": "Dashboard index order (#27)"
}
]
},
{
"date": "2026-05-20",
"scope": "HEI + NAIF",
"title": "Teacher education type label aligned with official terminology",
"summary": "The dashboard display labels for the `UTE` institution type were updated to use the official Swiss higher education category name.",
"row_count_before": 55,
"row_count_after": 55,
"changes": [
"Changed the displayed `UTE` institution type label from teacher education institutions to `Universities of Teacher Education`.",
"Kept the underlying `UTE` code and the published HEI rows unchanged."
],
"corrections": [
"This is a terminology correction only; it does not change institution coverage, identifiers, or status flags."
],
"commits": [
{
"sha": "54757b73cd52daea8be27164a6d752c9c0e81d3c",
"message": "fix: align teacher education terminology"
}
]
}
]
2 changes: 1 addition & 1 deletion dashboards/tobi/index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ TOBI_SOURCES = [

RETRIEVAL_COLUMNS = [retrieval_column for _, _, _, retrieval_column, _ in TOBI_SOURCES]

TYPE_LABELS = {**_BASE_TYPE_LABELS, "UTE": "Teacher education institutions (UTE)"}
TYPE_LABELS = {**_BASE_TYPE_LABELS, "UTE": "Universities of Teacher Education (UTE)"}


def pct_float(value: int, denominator: int) -> float:
Expand Down
4 changes: 2 additions & 2 deletions posts/2026-02-27-naif-at-research-on-research/index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ legend_html = make_legend_html(
[
("Universities", "#F97B22"),
("Universities of Applied Sciences", "#FEE8B0"),
("Teacher Education", "#9CA777"),
("Universities of Teacher Education", "#9CA777"),
("University Institutes", "#7C9070"),
]
)
Expand Down Expand Up @@ -192,7 +192,7 @@ legend_html = make_legend_html(
[
("Universities", "#F97B22"),
("Universities of Applied Sciences", "#FEE8B0"),
("Teacher Education", "#9CA777"),
("Universities of Teacher Education", "#9CA777"),
],
note="* CoARA Member",
)
Expand Down
6 changes: 4 additions & 2 deletions tests/test_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def test_load_hei_changelog_not_empty() -> None:


def test_latest_hei_changelog_date() -> None:
assert latest_hei_changelog_date() == "22 April 2026"
assert latest_hei_changelog_date() == "20 May 2026"


# ---------------------------------------------------------------------------
Expand Down Expand Up @@ -227,7 +227,9 @@ def test_ensure_csv_xlsx_export_refreshes_stale_workbook(tmp_path: Path) -> None
csv_path = tmp_path / "source.csv"
xlsx_path = tmp_path / "source.xlsx"
pd.DataFrame({"name": ["Original"]}).to_csv(csv_path, index=False)
write_dataframe_xlsx(pd.DataFrame({"name": ["Stale"]}), xlsx_path, sheet_name="Sheet")
write_dataframe_xlsx(
pd.DataFrame({"name": ["Stale"]}), xlsx_path, sheet_name="Sheet"
)

pd.DataFrame({"name": ["Fresh"]}).to_csv(csv_path, index=False)
stale_time = csv_path.stat().st_mtime - 10
Expand Down
Loading