microsegments 0.2.3__tar.gz → 0.2.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {microsegments-0.2.3 → microsegments-0.2.4}/PKG-INFO +1 -1
- {microsegments-0.2.3 → microsegments-0.2.4}/src/microsegments/_version.py +2 -2
- {microsegments-0.2.3 → microsegments-0.2.4}/src/microsegments/html/template.html +19 -3
- {microsegments-0.2.3 → microsegments-0.2.4}/.github/workflows/publish.yml +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/.github/workflows/test.yml +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/.gitignore +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/LICENSE +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/README.md +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/docs/report.jpg +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/examples/gtfsrt_csv.toml +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/examples/make_synth.py +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/examples/stib1_platform.toml +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/examples/stib55.toml +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/examples/stib55_full.toml +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/examples/stib71_platform.toml +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/examples/synth.toml +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/pyproject.toml +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/src/microsegments/__init__.py +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/src/microsegments/aggregate.py +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/src/microsegments/cli.py +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/src/microsegments/compare.py +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/src/microsegments/config.py +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/src/microsegments/contract.py +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/src/microsegments/hotspots.py +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/src/microsegments/html/__init__.py +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/src/microsegments/html/export.py +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/src/microsegments/html/leaflet.min.css +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/src/microsegments/io/__init__.py +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/src/microsegments/io/coverage.py +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/src/microsegments/io/events.py +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/src/microsegments/io/gtfsrt.py +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/src/microsegments/io/ids.py +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/src/microsegments/io/stib.py +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/src/microsegments/io/tabular.py +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/src/microsegments/io/timeutil.py +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/src/microsegments/locate/__init__.py +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/src/microsegments/locate/common.py +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/src/microsegments/locate/linear.py +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/src/microsegments/locate/mapmatch.py +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/src/microsegments/locate/resample.py +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/src/microsegments/metrics.py +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/src/microsegments/network/__init__.py +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/src/microsegments/network/calendar.py +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/src/microsegments/network/geometry.py +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/src/microsegments/network/keys.py +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/src/microsegments/network/patterns.py +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/src/microsegments/pipeline.py +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/src/microsegments/plot.py +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/src/microsegments/py.typed +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/src/microsegments/report.py +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/src/microsegments/scale.py +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/src/microsegments/schema.py +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/src/microsegments/segments.py +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/src/microsegments/simulate.py +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/src/microsegments/tracks.py +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/src/microsegments/tune.py +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/tests/fixtures/stib55/golden/buckets.parquet +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/tests/fixtures/stib55/golden/drops.parquet +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/tests/fixtures/stib55/golden/flen.parquet +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/tests/fixtures/stib55/golden/obs_day.parquet +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/tests/fixtures/stib55/golden/obs_dow.parquet +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/tests/fixtures/stib55/golden/passages.parquet +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/tests/fixtures/stib55/golden/summary.json +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/tests/fixtures/stib55/golden/validation.parquet +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/tests/fixtures/stib55/gtfs/agency.parquet +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/tests/fixtures/stib55/gtfs/calendar.parquet +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/tests/fixtures/stib55/gtfs/calendar_dates.parquet +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/tests/fixtures/stib55/gtfs/routes.parquet +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/tests/fixtures/stib55/gtfs/shapes.parquet +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/tests/fixtures/stib55/gtfs/stop_times.parquet +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/tests/fixtures/stib55/gtfs/stops.parquet +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/tests/fixtures/stib55/gtfs/trips.parquet +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/tests/fixtures/stib55/punctuality/route55.parquet +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/tests/fixtures/stib55/speed55_ref.json +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/tests/fixtures/stib55/vd55/20250318.parquet +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/tests/fixtures/stib55/vd55/20250318.snaps.parquet +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/tests/fixtures/stib55/vd55/20250319.parquet +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/tests/fixtures/stib55/vd55/20250319.snaps.parquet +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/tests/gtfs_fixtures.py +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/tests/regression/make_golden.py +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/tests/t4_fixtures.py +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/tests/test_aggregate.py +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/tests/test_compare.py +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/tests/test_coverage.py +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/tests/test_hotspots.py +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/tests/test_hotspots_criteria.py +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/tests/test_io_events.py +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/tests/test_io_gtfsrt.py +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/tests/test_io_stib.py +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/tests/test_io_tabular.py +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/tests/test_locate_linear.py +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/tests/test_locate_mapmatch.py +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/tests/test_metrics.py +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/tests/test_network_geometry.py +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/tests/test_network_patterns.py +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/tests/test_pipeline_cli.py +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/tests/test_regression_stib55.py +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/tests/test_report_html.py +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/tests/test_scaffold.py +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/tests/test_segments.py +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/tests/test_simulate.py +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/tests/test_tracks.py +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/tests/test_tune.py +0 -0
- {microsegments-0.2.3 → microsegments-0.2.4}/tests/test_versions_merge.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: microsegments
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.4
|
|
4
4
|
Summary: Where do transit vehicles linger? Count vehicle position observations per micro-segment of a line, from GTFS + AVL / GTFS-RT positions.
|
|
5
5
|
Project-URL: Homepage, https://github.com/GaspardMerten/microsegments
|
|
6
6
|
Project-URL: Repository, https://github.com/GaspardMerten/microsegments
|
|
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
|
|
|
18
18
|
commit_id: str | None
|
|
19
19
|
__commit_id__: str | None
|
|
20
20
|
|
|
21
|
-
__version__ = version = '0.2.
|
|
22
|
-
__version_tuple__ = version_tuple = (0, 2,
|
|
21
|
+
__version__ = version = '0.2.4'
|
|
22
|
+
__version_tuple__ = version_tuple = (0, 2, 4)
|
|
23
23
|
|
|
24
24
|
__commit_id__ = commit_id = None
|
|
@@ -213,7 +213,7 @@ const MODE = {fr: {tram: 'Tram', bus: 'Bus', trolleybus: 'Trolleybus', metro: 'M
|
|
|
213
213
|
const T = {
|
|
214
214
|
fr: {
|
|
215
215
|
title: (m, l) => `Où les ${m} s'attardent-ils\u00a0?`,
|
|
216
|
-
lede: (L, tk, m1, m) => `La ligne est découpée en
|
|
216
|
+
lede: (L, tk, m1, m) => `Toutes les ${tk} secondes, on note la position de chaque ${m1}. La ligne est découpée en tronçons d'environ ${L} m et on compte combien de fois un ${m1} y est vu : 1 observation ≈ ${tk} s passées là. Vert = ça roule, rouge = ça bloque. « Écart avec le soir » : le temps en plus par rapport à ${REFH[0]}–${REFH[1]} h, quand la circulation est fluide.`,
|
|
217
217
|
days: 'Jours', dir: 'Sens', ver: 'Version du tracé', bands: 'Moyennes', metric: 'Mesure', unit: 'Par', stops: 'Arrêts',
|
|
218
218
|
dow: ['Lu', 'Ma', 'Me', 'Je', 'Ve', 'Sa', 'Di'], dowl: ['lundis', 'mardis', 'mercredis', 'jeudis', 'vendredis', 'samedis', 'dimanches'],
|
|
219
219
|
dowd: ['lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi', 'samedi', 'dimanche'],
|
|
@@ -300,7 +300,7 @@ const T = {
|
|
|
300
300
|
},
|
|
301
301
|
en: {
|
|
302
302
|
title: (m, l) => `Where do ${m} linger?`,
|
|
303
|
-
lede: (L, tk, m1, m) => `The line is cut into
|
|
303
|
+
lede: (L, tk, m1, m) => `Every ${tk} seconds, we note where each ${m1} is. The line is cut into stretches of about ${L} m and we count how often a ${m1} is seen there: 1 observation ≈ ${tk} s spent there. Green = moving, red = stuck. "Excess over the evening": the extra time compared with ${REFH[0]}–${REFH[1]} h, when traffic flows.`,
|
|
304
304
|
days: 'Days', dir: 'Direction', ver: 'Route version', bands: 'Averages', metric: 'Measure', unit: 'Per', stops: 'Stops',
|
|
305
305
|
dow: ['Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su'], dowl: ['Mondays', 'Tuesdays', 'Wednesdays', 'Thursdays', 'Fridays', 'Saturdays', 'Sundays'],
|
|
306
306
|
dowd: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'],
|
|
@@ -516,7 +516,11 @@ const fmtShort = s => fmtDate(s, {day: '2-digit', month: '2-digit', year: '2-dig
|
|
|
516
516
|
const DIRS = D.dirs || [];
|
|
517
517
|
const PRESENT = [0,1,2,3,4,5,6].filter(w => (D.period.per_dow || [])[w] > 0);
|
|
518
518
|
st.days = PRESENT.slice();
|
|
519
|
-
|
|
519
|
+
// direction: ?dir= (or the embedding page's own control, see DIR_CONTROL), else the first one
|
|
520
|
+
st.dir = DIRS.some(d => String(d.dir) === qs.get('dir')) ? +qs.get('dir') : DIRS.length ? DIRS[0].dir : null;
|
|
521
|
+
// contract options for an embedding page: dir_control false hides the page's direction buttons (the
|
|
522
|
+
// host drives the direction with postMessage({ms: 'dir', dir})); method false drops the method section
|
|
523
|
+
const DIR_CONTROL = D.dir_control !== false, METHOD = D.method !== false;
|
|
520
524
|
st.hour = D.hours.includes(8) ? 8 : D.hours[0];
|
|
521
525
|
const dirOf = () => DIRS.find(x => x.dir === st.dir);
|
|
522
526
|
// the entry shown: the display version of the direction, or one of its other versions
|
|
@@ -874,6 +878,7 @@ function buttons(el, items, onclick) {
|
|
|
874
878
|
el.innerHTML = '';
|
|
875
879
|
for (const [k, t, title] of items) { const b = document.createElement('button'); b.type = 'button'; b.textContent = t; b.dataset.k = k; if (title) b.title = title; b.onclick = () => onclick(k); el.append(b); }
|
|
876
880
|
}
|
|
881
|
+
let SETDIR = null;
|
|
877
882
|
function buildControls() {
|
|
878
883
|
const l = tx();
|
|
879
884
|
buttons($('langs'), [['fr', 'FR'], ['en', 'EN']], k => { st.lang = k; buildControls(); texts(); tiles(); drawAll(); });
|
|
@@ -889,6 +894,8 @@ function buildControls() {
|
|
|
889
894
|
const setDir = k => { st.dir = +k; st.ver = null; st.hot = null; st.chg = null; drawAll(); };
|
|
890
895
|
buttons($('dirs'), dirItems, setDir);
|
|
891
896
|
buttons($('mxdirs'), dirItems, setDir);
|
|
897
|
+
$('dirs').closest('.grp').style.display = DIR_CONTROL ? '' : 'none'; $('mxdirs').style.display = DIR_CONTROL ? '' : 'none';
|
|
898
|
+
SETDIR = setDir;
|
|
892
899
|
buttons($('bands'), Object.keys(BANDDEF).map(k => [k, l.bandl[k], `${BANDDEF[k][0]}–${BANDDEF[k][1]} h`]), k => { stop(); st.band = st.band === k ? null : k; render(); });
|
|
893
900
|
$('g_mode').hidden = !CMP;
|
|
894
901
|
if (CMP) buttons($('modes'), [['one', l.modes.one], ['cmp', l.modes.cmp]], k => { st.mode = k; st.ver = null; st.hot = null; st.chg = null; buildControls(); texts(); tiles(); drawAll(); });
|
|
@@ -1213,6 +1220,15 @@ document.addEventListener('fullscreenchange', () => { if (!document.fullscreenEl
|
|
|
1213
1220
|
document.addEventListener('keydown', e => { if (e.key === 'Escape' && mxCard.classList.contains('full')) setFull(false); });
|
|
1214
1221
|
|
|
1215
1222
|
buildControls(); texts(); tiles(); initMap(); drawAll();
|
|
1223
|
+
document.querySelector('section.method').hidden = !METHOD;
|
|
1224
|
+
// embedded: tell the host the directions, follow its direction control
|
|
1225
|
+
if (window.parent !== window) {
|
|
1226
|
+
try { parent.postMessage({ms: 'dirs', dir: st.dir, dirs: DIRS.map(d => ({dir: d.dir, from: d.from, to: d.to}))}, '*'); } catch (x) {}
|
|
1227
|
+
window.addEventListener('message', e => {
|
|
1228
|
+
const m = e.data || {};
|
|
1229
|
+
if (m.ms === 'dir' && SETDIR && DIRS.some(d => d.dir === +m.dir) && +m.dir !== st.dir) SETDIR(m.dir);
|
|
1230
|
+
});
|
|
1231
|
+
}
|
|
1216
1232
|
</script>
|
|
1217
1233
|
</body>
|
|
1218
1234
|
</html>
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{microsegments-0.2.3 → microsegments-0.2.4}/tests/fixtures/stib55/gtfs/calendar_dates.parquet
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{microsegments-0.2.3 → microsegments-0.2.4}/tests/fixtures/stib55/punctuality/route55.parquet
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{microsegments-0.2.3 → microsegments-0.2.4}/tests/fixtures/stib55/vd55/20250318.snaps.parquet
RENAMED
|
File without changes
|
|
File without changes
|
{microsegments-0.2.3 → microsegments-0.2.4}/tests/fixtures/stib55/vd55/20250319.snaps.parquet
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|