minotor 10.1.0 → 11.1.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/.cspell.json +1 -0
- package/CHANGELOG.md +2 -2
- package/README.md +2 -2
- package/dist/cli/perf.d.ts +51 -13
- package/dist/cli.mjs +730 -784
- package/dist/cli.mjs.map +1 -1
- package/dist/gtfs/__tests__/frequencies.test.d.ts +1 -0
- package/dist/gtfs/frequencies.d.ts +28 -0
- package/dist/gtfs/trips.d.ts +6 -1
- package/dist/parser.cjs.js +439 -644
- package/dist/parser.cjs.js.map +1 -1
- package/dist/parser.esm.js +439 -644
- 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 +1 -2
- 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/query.d.ts +11 -12
- package/dist/routing/result.d.ts +12 -6
- package/dist/routing/route.d.ts +5 -6
- package/dist/routing/router.d.ts +1 -2
- package/dist/stops/io.d.ts +1 -1
- package/dist/stops/proto/{stops.d.ts → v1/stops.d.ts} +8 -8
- package/dist/stops/stops.d.ts +1 -1
- package/dist/stops/stopsIndex.d.ts +1 -1
- package/dist/timetable/io.d.ts +2 -2
- package/dist/timetable/proto/{timetable.d.ts → v1/timetable.d.ts} +18 -17
- package/dist/timetable/route.d.ts +7 -10
- package/dist/timetable/time.d.ts +64 -115
- package/dist/timetable/timetable.d.ts +1 -2
- package/package.json +8 -8
- package/src/__e2e__/router.test.ts +92 -13
- package/src/__e2e__/timetable/stops.bin +2 -2
- package/src/__e2e__/timetable/timetable.bin +2 -2
- package/src/cli/minotor.ts +13 -6
- package/src/cli/perf.ts +116 -32
- package/src/cli/repl.ts +30 -22
- package/src/gtfs/__tests__/frequencies.test.ts +400 -0
- package/src/gtfs/__tests__/parser.test.ts +13 -11
- package/src/gtfs/__tests__/time.test.ts +2 -2
- package/src/gtfs/__tests__/transfers.test.ts +18 -19
- package/src/gtfs/__tests__/trips.test.ts +43 -49
- package/src/gtfs/frequencies.ts +75 -0
- package/src/gtfs/parser.ts +18 -0
- package/src/gtfs/stops.ts +3 -1
- package/src/gtfs/time.ts +2 -2
- package/src/gtfs/transfers.ts +13 -12
- package/src/gtfs/trips.ts +53 -21
- package/src/router.ts +1 -2
- package/src/routing/__tests__/plotter.test.ts +14 -15
- package/src/routing/__tests__/result.test.ts +95 -96
- package/src/routing/__tests__/route.test.ts +9 -19
- package/src/routing/__tests__/router.test.ts +191 -228
- package/src/routing/plotter.ts +11 -7
- package/src/routing/query.ts +12 -15
- package/src/routing/result.ts +97 -61
- package/src/routing/route.ts +34 -36
- package/src/routing/router.ts +28 -22
- package/src/stops/__tests__/stopFinder.test.ts +3 -3
- package/src/stops/io.ts +13 -16
- package/src/stops/proto/v1/stops.proto +27 -0
- package/src/stops/proto/{stops.ts → v1/stops.ts} +41 -54
- package/src/stops/stops.ts +1 -1
- package/src/stops/stopsIndex.ts +5 -7
- package/src/timetable/__tests__/io.test.ts +15 -26
- package/src/timetable/__tests__/route.test.ts +31 -43
- package/src/timetable/__tests__/time.test.ts +79 -461
- package/src/timetable/__tests__/timetable.test.ts +16 -17
- package/src/timetable/io.ts +38 -35
- package/src/timetable/proto/{timetable.proto → v1/timetable.proto} +29 -28
- package/src/timetable/proto/{timetable.ts → v1/timetable.ts} +103 -109
- package/src/timetable/route.ts +25 -55
- package/src/timetable/time.ts +125 -229
- package/src/timetable/timetable.ts +2 -10
- package/dist/timetable/duration.d.ts +0 -46
- package/src/stops/proto/stops.proto +0 -27
- package/src/timetable/duration.ts +0 -78
package/.cspell.json
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# [
|
|
1
|
+
# [11.1.0](https://github.com/aubryio/minotor/compare/v11.0.0...v11.1.0) (2026-04-15)
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
### Features
|
|
5
5
|
|
|
6
|
-
*
|
|
6
|
+
* basic GTFS frequency.txt support (scheduled only) ([#63](https://github.com/aubryio/minotor/issues/63)) ([05cf559](https://github.com/aubryio/minotor/commit/05cf559cd34ba336dae7f35e9eb7901ae23ea7b4)), closes [#50](https://github.com/aubryio/minotor/issues/50)
|
package/README.md
CHANGED
|
@@ -84,14 +84,14 @@ Or by location:
|
|
|
84
84
|
#### Routing (Browser or Node.js)
|
|
85
85
|
|
|
86
86
|
```
|
|
87
|
-
import { Query, Router
|
|
87
|
+
import { Query, Router } from 'minotor';
|
|
88
88
|
|
|
89
89
|
const router = new Router(timetable, stopsIndex);
|
|
90
90
|
|
|
91
91
|
const query = new Query.Builder()
|
|
92
92
|
.from('Parent8504100')
|
|
93
93
|
.to('Parent8504748')
|
|
94
|
-
.departureTime(
|
|
94
|
+
.departureTime(8*60)
|
|
95
95
|
.maxTransfers(5)
|
|
96
96
|
.build();
|
|
97
97
|
const result = router.route(query);
|
package/dist/cli/perf.d.ts
CHANGED
|
@@ -1,28 +1,66 @@
|
|
|
1
1
|
import { Query, Router, StopsIndex } from '../router.js';
|
|
2
2
|
type PerformanceResult = {
|
|
3
3
|
task: Query;
|
|
4
|
-
|
|
4
|
+
meanTimeUs: number;
|
|
5
5
|
meanMemoryMb: number;
|
|
6
6
|
};
|
|
7
7
|
/**
|
|
8
|
+
* Loads a list of routing queries from a JSON file and resolves the
|
|
9
|
+
* human-readable stop IDs to the internal numeric IDs used by the router.
|
|
8
10
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
+
* The file must contain a JSON array whose elements each have the shape:
|
|
12
|
+
* ```json
|
|
13
|
+
* { "from": "STOP_A", "to": ["STOP_B", "STOP_C"], "departureTime": "08:30:00" }
|
|
14
|
+
* ```
|
|
15
|
+
* An optional `maxTransfers` integer field is also supported.
|
|
16
|
+
*
|
|
17
|
+
* @param filePath - Path to the JSON file containing the serialized queries.
|
|
18
|
+
* @param stopsIndex - The stops index used to resolve source stop IDs to the
|
|
19
|
+
* internal numeric IDs expected by the router.
|
|
20
|
+
* @returns An array of fully constructed {@link Query} objects ready to be
|
|
21
|
+
* passed to {@link Router.route}.
|
|
22
|
+
* @throws If the file cannot be read, the JSON is malformed, or any stop ID
|
|
23
|
+
* referenced in the file cannot be found in the stops index.
|
|
11
24
|
*/
|
|
12
|
-
export declare const loadQueriesFromJson: (filePath: string) => Query[];
|
|
25
|
+
export declare const loadQueriesFromJson: (filePath: string, stopsIndex: StopsIndex) => Query[];
|
|
13
26
|
/**
|
|
27
|
+
* Benchmarks {@link Router.route} across a set of queries.
|
|
14
28
|
*
|
|
15
|
-
* @param router
|
|
16
|
-
* @param
|
|
17
|
-
*
|
|
18
|
-
* @param iterations
|
|
19
|
-
*
|
|
29
|
+
* @param router - The router instance to benchmark.
|
|
30
|
+
* @param tasks - The list of queries to run. One {@link PerformanceResult} is
|
|
31
|
+
* produced per query.
|
|
32
|
+
* @param iterations - Number of times each query is repeated. Higher values
|
|
33
|
+
* yield a more stable mean at the cost of longer wall-clock time.
|
|
34
|
+
* @returns An array of {@link PerformanceResult} objects, one per query, each
|
|
35
|
+
* containing the mean wall-clock time (µs) and mean heap delta (MB).
|
|
20
36
|
*/
|
|
21
|
-
export declare const testRouterPerformance: (router: Router,
|
|
37
|
+
export declare const testRouterPerformance: (router: Router, tasks: Query[], iterations: number) => PerformanceResult[];
|
|
22
38
|
/**
|
|
39
|
+
* Benchmarks {@link Result.bestRoute} — the path-reconstruction phase —
|
|
40
|
+
* independently of the routing phase.
|
|
41
|
+
*
|
|
42
|
+
* @param router - The router instance used to produce the routing results that
|
|
43
|
+
* are then fed into `bestRoute`.
|
|
44
|
+
* @param tasks - The list of queries to benchmark. One {@link PerformanceResult}
|
|
45
|
+
* is produced per query.
|
|
46
|
+
* @param iterations - Number of times `bestRoute` is called per query.
|
|
47
|
+
* @returns An array of {@link PerformanceResult} objects, one per query, each
|
|
48
|
+
* containing the mean wall-clock time (µs) and mean heap delta (MB) for the
|
|
49
|
+
* `bestRoute` call alone.
|
|
50
|
+
*/
|
|
51
|
+
export declare const testBestRoutePerformance: (router: Router, tasks: Query[], iterations: number) => PerformanceResult[];
|
|
52
|
+
/**
|
|
53
|
+
* Prints a human-readable summary of performance results to stdout.
|
|
54
|
+
*
|
|
55
|
+
* Displays an overall mean across all tasks followed by a per-task breakdown.
|
|
56
|
+
* An optional {@link label} is printed as a section header so that results
|
|
57
|
+
* from different benchmark phases (e.g. routing vs. reconstruction) can be
|
|
58
|
+
* told apart when several calls appear in the same run.
|
|
23
59
|
*
|
|
24
|
-
* @param results
|
|
25
|
-
* @
|
|
60
|
+
* @param results - The performance results to display, as returned by
|
|
61
|
+
* {@link testRouterPerformance} or {@link testBestRoutePerformance}.
|
|
62
|
+
* @param label - Optional heading printed above the results block.
|
|
63
|
+
* Defaults to `'Performance Results'`.
|
|
26
64
|
*/
|
|
27
|
-
export declare const prettyPrintPerformanceResults: (results: PerformanceResult[]) => void;
|
|
65
|
+
export declare const prettyPrintPerformanceResults: (results: PerformanceResult[], label?: string) => void;
|
|
28
66
|
export {};
|