minotor 12.0.0 → 13.0.0
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.
- package/CHANGELOG.md +4 -4
- package/README.md +7 -4
- package/dist/cli/perf.d.ts +19 -9
- package/dist/cli.mjs +289 -206
- package/dist/cli.mjs.map +1 -1
- package/dist/parser.cjs.js +37 -19
- package/dist/parser.cjs.js.map +1 -1
- package/dist/parser.esm.js +37 -19
- package/dist/parser.esm.js.map +1 -1
- package/dist/router.cjs.js +1 -1
- package/dist/router.cjs.js.map +1 -1
- package/dist/router.d.ts +2 -1
- package/dist/router.esm.js +1 -1
- package/dist/router.esm.js.map +1 -1
- package/dist/router.umd.js +1 -1
- package/dist/router.umd.js.map +1 -1
- package/dist/routing/rangeResult.d.ts +34 -25
- package/dist/routing/result.d.ts +28 -9
- package/dist/routing/resultInternals.d.ts +4 -0
- package/dist/routing/routingResult.d.ts +29 -0
- package/dist/routing/state.d.ts +2 -2
- package/dist/stops/stopsIndex.d.ts +1 -1
- package/dist/timetable/route.d.ts +2 -0
- package/package.json +2 -2
- package/src/cli/minotor.ts +20 -3
- package/src/cli/perf.ts +98 -111
- package/src/cli/repl.ts +1 -1
- package/src/router.ts +3 -0
- package/src/routing/__tests__/plotter.test.ts +0 -11
- package/src/routing/__tests__/rangeResult.test.ts +1470 -46
- package/src/routing/__tests__/rangeRouter.test.ts +14 -8
- package/src/routing/__tests__/result.test.ts +375 -76
- package/src/routing/__tests__/state.test.ts +29 -0
- package/src/routing/plainRouter.ts +1 -6
- package/src/routing/plotter.ts +6 -5
- package/src/routing/rangeResult.ts +67 -52
- package/src/routing/rangeRouter.ts +3 -8
- package/src/routing/result.ts +95 -36
- package/src/routing/resultInternals.ts +5 -0
- package/src/routing/routingResult.ts +34 -0
- package/src/routing/state.ts +11 -3
- package/src/stops/__tests__/stopFinder.test.ts +13 -0
- package/src/stops/stopsIndex.ts +13 -19
- package/src/timetable/__tests__/io.test.ts +27 -0
- package/src/timetable/__tests__/route.test.ts +30 -0
- package/src/timetable/io.ts +15 -1
- package/src/timetable/route.ts +19 -5
- package/src/timetable/timetable.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
# [
|
|
1
|
+
# [13.0.0](https://github.com/aubryio/minotor/compare/v12.0.1...v13.0.0) (2026-10-30)
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
### Code Refactoring
|
|
5
5
|
|
|
6
|
-
*
|
|
6
|
+
* improve public results APIs ([#81](https://github.com/aubryio/minotor/issues/81)) ([bc45e33](https://github.com/aubryio/minotor/commit/bc45e3345bbcfb57210cad0bd2ee748abfc5f8fe))
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
### BREAKING CHANGES
|
|
10
10
|
|
|
11
|
-
*
|
|
12
|
-
|
|
11
|
+
* result and rangeResult public API changes (routingGraph not accessible anymore,
|
|
12
|
+
harmonized methods signatures)
|
package/README.md
CHANGED
|
@@ -126,6 +126,8 @@ const route = result.bestRoute(); // Route | undefined
|
|
|
126
126
|
|
|
127
127
|
// Earliest arrival at any individual stop (useful for isochrone computation)
|
|
128
128
|
const arrival = result.arrivalAt(stop.id); // { arrival: Time, legNumber: number } | undefined
|
|
129
|
+
// Earliest arrival at every reachable stop
|
|
130
|
+
const arrivals = result.arrivals();
|
|
129
131
|
```
|
|
130
132
|
|
|
131
133
|
Query options:
|
|
@@ -166,11 +168,12 @@ for (const { departureTime, result } of rangeResult) {
|
|
|
166
168
|
const earliest = rangeResult.bestRoute(); // earliest arrival
|
|
167
169
|
const latest = rangeResult.latestDepartureRoute(); // latest possible departure
|
|
168
170
|
const fastest = rangeResult.fastestRoute(); // shortest travel duration
|
|
169
|
-
const all = rangeResult.
|
|
171
|
+
const all = rangeResult.routes(); // lazy iterator, earliest-departure-first
|
|
170
172
|
|
|
171
|
-
// Earliest arrival at every reachable stop
|
|
172
|
-
const arrivals = rangeResult.
|
|
173
|
-
|
|
173
|
+
// Earliest arrival at every reachable stop
|
|
174
|
+
const arrivals = rangeResult.arrivals();
|
|
175
|
+
// Shortest duration to every reachable stop
|
|
176
|
+
const durations = rangeResult.shortestDurations();
|
|
174
177
|
```
|
|
175
178
|
|
|
176
179
|
### CLI Usage
|
package/dist/cli/perf.d.ts
CHANGED
|
@@ -2,7 +2,17 @@ import { Query, RangeQuery, Router, StopsIndex } from '../router.js';
|
|
|
2
2
|
type PerformanceResult = {
|
|
3
3
|
label: string;
|
|
4
4
|
meanTimeUs: number;
|
|
5
|
-
|
|
5
|
+
meanHeapMiB: number;
|
|
6
|
+
meanArrayBuffersMiB: number;
|
|
7
|
+
};
|
|
8
|
+
/** Observed deltas, not peak memory or total allocations; GC can make them negative. */
|
|
9
|
+
export declare const measurePerformance: (operation: () => unknown, iterations: number) => Omit<PerformanceResult, "label">;
|
|
10
|
+
/** Measure retained storage after collection, keeping only the returned value alive. */
|
|
11
|
+
export declare const measureRetainedMemory: <T>(operation: () => T) => {
|
|
12
|
+
value: T;
|
|
13
|
+
loadTimeMs: number;
|
|
14
|
+
retainedHeapMiB?: number;
|
|
15
|
+
retainedArrayBuffersMiB?: number;
|
|
6
16
|
};
|
|
7
17
|
/**
|
|
8
18
|
* Loads a list of routing queries from a JSON file and resolves the
|
|
@@ -46,7 +56,7 @@ export declare const loadRangeQueriesFromJson: (filePath: string, stopsIndex: St
|
|
|
46
56
|
* yield a more stable mean at the cost of longer wall-clock time.
|
|
47
57
|
* @param stopsIndex - Used to resolve stop names for result labels.
|
|
48
58
|
* @returns An array of {@link PerformanceResult} objects, one per query, each
|
|
49
|
-
* containing the mean wall-clock time (µs) and mean heap
|
|
59
|
+
* containing the mean wall-clock time (µs) and mean heap and ArrayBuffer deltas (MiB).
|
|
50
60
|
*/
|
|
51
61
|
export declare const testRouterPerformance: (router: Router, tasks: Query[], iterations: number, stopsIndex: StopsIndex) => PerformanceResult[];
|
|
52
62
|
/**
|
|
@@ -60,7 +70,7 @@ export declare const testRouterPerformance: (router: Router, tasks: Query[], ite
|
|
|
60
70
|
* @param iterations - Number of times `bestRoute` is called per query.
|
|
61
71
|
* @param stopsIndex - Used to resolve stop names for result labels.
|
|
62
72
|
* @returns An array of {@link PerformanceResult} objects, one per query, each
|
|
63
|
-
* containing the mean wall-clock time (µs) and mean heap
|
|
73
|
+
* containing the mean wall-clock time (µs) and mean heap and ArrayBuffer deltas (MiB) for the
|
|
64
74
|
* `bestRoute` call alone.
|
|
65
75
|
*/
|
|
66
76
|
export declare const testBestRoutePerformance: (router: Router, tasks: Query[], iterations: number, stopsIndex: StopsIndex) => PerformanceResult[];
|
|
@@ -73,22 +83,22 @@ export declare const testBestRoutePerformance: (router: Router, tasks: Query[],
|
|
|
73
83
|
* @param iterations - Number of times each query is repeated.
|
|
74
84
|
* @param stopsIndex - Used to resolve stop names for result labels.
|
|
75
85
|
* @returns An array of {@link PerformanceResult} objects, one per query, each
|
|
76
|
-
* containing the mean wall-clock time (µs) and mean heap
|
|
86
|
+
* containing the mean wall-clock time (µs) and mean heap and ArrayBuffer deltas (MiB).
|
|
77
87
|
*/
|
|
78
88
|
export declare const testRangeRouterPerformance: (router: Router, tasks: RangeQuery[], iterations: number, stopsIndex: StopsIndex) => PerformanceResult[];
|
|
79
89
|
/**
|
|
80
|
-
* Benchmarks {@link RangeResult.
|
|
90
|
+
* Benchmarks {@link RangeResult.routes} — the full Pareto-frontier
|
|
81
91
|
* reconstruction phase — independently of the range routing phase.
|
|
82
92
|
*
|
|
83
93
|
* @param router - The router instance used to produce the range results that
|
|
84
|
-
* are then fed into `
|
|
94
|
+
* are then fed into `routes`.
|
|
85
95
|
* @param tasks - The list of range queries to benchmark. One
|
|
86
96
|
* {@link PerformanceResult} is produced per query.
|
|
87
|
-
* @param iterations - Number of times `
|
|
97
|
+
* @param iterations - Number of times `routes` is fully consumed per query.
|
|
88
98
|
* @param stopsIndex - Used to resolve stop names for result labels.
|
|
89
99
|
* @returns An array of {@link PerformanceResult} objects, one per query, each
|
|
90
|
-
* containing the mean wall-clock time (µs) and mean heap
|
|
91
|
-
* `
|
|
100
|
+
* containing the mean wall-clock time (µs) and mean heap and ArrayBuffer deltas (MiB) for the
|
|
101
|
+
* full `routes` iteration alone.
|
|
92
102
|
*/
|
|
93
103
|
export declare const testRangeResultPerformance: (router: Router, tasks: RangeQuery[], iterations: number, stopsIndex: StopsIndex) => PerformanceResult[];
|
|
94
104
|
/**
|