Skip to content

feat(referential): format 2, stations with their accesses (v1.1.0) - #3

Merged
MaxLeb merged 1 commit into
mainfrom
feat/format-2-acces
Sep 28, 2026
Merged

MaxLeb merged 1 commit into
mainfrom
feat/format-2-acces

Conversation

@MaxLeb

@MaxLeb MaxLeb commented Sep 28, 2026

Copy link
Copy Markdown
Owner

What

Format 2 of the stations referential: format 1 plus, for every station, the accesses (entrances and exits) of its stop areas.

  • Data: from the IDFM datasets acces (2,523 accesses) and relations-acces, both under the Licence Ouverte 2.0.
  • Access fields: id (IDFM:<access id>), name, number (signage number or null), lat, lon, entry, exit.
  • Rules: every access linked to the station's areas, listed once and sorted by numeric id; [] when none is published.
  • Version: computed over the seven datasets.
  • Format 1 is still produced unchanged: this is a minor release, v1.1.0, following the README « Versioning ».

Why

The Everyday France app measures the walk to the nearest entrance instead of the hub centre, and shows that entrance's name. Its decision records are D-05 and ADR-0044.

Exits are kept because the IDFM positionnement-dans-la-rame dataset points to access ids: 3,834 out of 3,834 match this dataset.

How it's tested

  • Tests: 212 tests (22 new) on real extracts, with acces and relations-acces added for the fixture hubs. They cover the access fields, the counts per station, deduplication and order, the areas of the selected modes, null numbers, exit-only accesses, source errors, schema closure, and the CLI for both formats.
  • Real export, Paris subset: 987 stations, 2,491 accesses, 993 KB (408 KB in format 1). All modes: 15,126 stations, 11 MB.
  • Data quality checked: no orphan relation, no duplicate, no empty name, every access has coordinates. 49 accesses serve two stop areas and are deduplicated per station.
  • Tooling: ruff and actionlint clean.

To test by hand:

uv sync && uv run export-referential --format 2 --modes METRO,RER,TRAIN,TRAM -o /tmp/stations.json

Visible in the app: no, not before the app PR that reads format 2.

Limits

  • The CLI default stays --format 1, so a v1.0.0 command keeps its output. The README says to always pass --format.
  • Coverage: 100 % of metro stations, 99 % of RER, 91 % of trains. There are no accesses for trams, which is expected since tram stops are on the street, nor for about twenty TER stations outside Île-de-France.
  • release.yml has only been checked with actionlint: it runs at the first tag.

After merge

Push the v1.1.0 tag. It freezes format 2 and publishes both formats.

🤖 Generated with Claude Code

https://claude.ai/code/session_01L4aZBkZFaLEiu7ax7RdwiD

Format 2 is format 1 plus, for every station, the entrances and exits of its
stop areas (IDFM acces + relations-acces, Licence Ouverte), with the id used
by platform positioning. Format 1 is still produced unchanged (minor
release). Closed schema stations.format-2.schema.json, CLI format registry,
release publishing every format and schema, tests on real extracts.
@MaxLeb

MaxLeb commented Sep 28, 2026

Copy link
Copy Markdown
Owner Author

Agent review

Checked: ruff (lint and format), 212 tests, actionlint, a real export of both formats (987 / 15,126 stations, 2,491 accesses for the Paris subset), and the quality of the two new datasets.

Worth reading first

  • prim_api/referential/format2.py builds format 1, then attaches the accesses. The stations are strictly the same as in format 1: a test compares them.
  • release.yml exports format 2 first, which downloads the seven datasets, then format 1 with --no-download. Both files therefore describe the same data.
  • The CLI default stays --format 1, deliberately, for compatibility with v1.0.0.

Not tested: the release workflow end to end, since it runs at the tag.

Not merged, not tagged.

@MaxLeb
MaxLeb merged commit b20c1e8 into main Sep 28, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant