Skip to content

006 download rinf topology#9

Merged
MathiasVDA merged 19 commits into
mainfrom
006-download-rinf-topology
May 25, 2026
Merged

006 download rinf topology#9
MathiasVDA merged 19 commits into
mainfrom
006-download-rinf-topology

Conversation

@MathiasVDA
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds feature 006 to automatically retrieve railway topology (netelements + netrelations) from the ERA RINF SPARQL endpoint when a local network file is not provided, and surfaces this across the Rust core, CLI, Python bindings, and .NET bindings. The PR also extends timestamp parsing to accept naive ISO-8601 datetimes (interpreted in host local time) in addition to RFC3339.

Changes:

  • Introduces tp-core retrieval workflow (resolve_topology, retrieval models, SPARQL client/query builders, topology validation) and exports it from the public API.
  • Updates CLI, Python, and .NET surfaces to support “no network provided ⇒ auto-retrieve via RINF”, including new option/config types and new .NET “*Auto” entry points + typed exception mapping.
  • Expands timestamp parsing to accept RFC3339 or naive ISO-8601 inputs (local timezone), and updates docs/tests accordingly.

Reviewed changes

Copilot reviewed 52 out of 63 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
tp-py/src/lib.rs Python bindings: optional network + RINF retrieval options; error mapping updates.
tp-py/README.md Python docs: timestamps + RINF retrieval usage.
tp-py/python/tp_lib/init.py Python wrapper signatures updated for optional network + RINF options.
tp-py/python/tests/test_projection.py Python tests: precedence + unreachable-endpoint cases; minor assertion cleanup.
tp-py/python/tests/test_path_calculation.py Python tests: auto-retrieval failure + precedence scenarios.
tp-net/src/lib.rs Rust FFI: adds auto-retrieval entry points and typed error envelope support.
tp-net/README.md .NET docs: RINF retrieval usage + timestamp semantics.
tp-net/csharp/TpLib.cs C# API: adds ProjectGnssAuto / CalculateTrainPathAuto and auto-error deserializer.
tp-net/csharp/Tests/ProjectionTests.cs C# tests for auto projection precedence and endpoint failure.
tp-net/csharp/Tests/PathCalculationTests.cs C# tests for auto path precedence and endpoint failure.
tp-net/csharp/NativeMethods.g.cs C# P/Invoke declarations for the new auto FFI entry points.
tp-net/csharp/Models.cs Adds RinfRetrievalOptions model for .NET callers.
tp-net/csharp/Exceptions.cs Adds typed RINF exception hierarchy for .NET.
tp-core/tests/rinf_topology.rs Offline integration tests for retrieval via mocked SPARQL client.
tp-core/tests/fixtures/rinf_smoke_netrelations.json Fixture SPARQL JSON for netrelations retrieval.
tp-core/tests/fixtures/rinf_smoke_netelements.json Fixture SPARQL JSON for netelements retrieval.
tp-core/tests/contract/rinf_query_shape_test.rs Contract tests for SPARQL query shape.
tp-core/tests/contract.rs Registers the new RINF contract test module.
tp-core/src/workflow.rs Implements retrieval-area construction, validation, and resolve_topology.
tp-core/src/temporal.rs Adds flexible timestamp parsing (RFC3339 or naive local time).
tp-core/src/models/retrieval.rs Adds retrieval domain models/constants/status enums.
tp-core/src/models.rs Re-exports retrieval models in tp-core public model surface.
tp-core/src/lib.rs Exposes new retrieval APIs and SPARQL helpers in the top-level crate API.
tp-core/src/io/rinf.rs Adds SPARQL client trait + ureq client + query builders + parsing/mapping helpers.
tp-core/src/io/geojson/detections.rs Uses flexible timestamp parsing for detection timestamps.
tp-core/src/io/geojson.rs Uses flexible timestamp parsing; adds write_network_geojson.
tp-core/src/io/csv/detections.rs Uses flexible timestamp parsing for detection timestamps.
tp-core/src/io/csv.rs Switches to shared flexible timestamp parsing.
tp-core/src/io.rs Exports the new RINF IO module + network writer.
tp-core/src/errors.rs Adds RINF retrieval error variants.
tp-core/Cargo.toml Adds dependencies needed for RINF retrieval.
tp-cli/tests/cli_integration_test.rs CLI tests for supplied-topology reporting and RINF failure exit codes + ignored live test.
tp-cli/src/main.rs CLI: makes network optional for path flows; adds RINF flags and fetch-topology command.
tp-cli/README.md CLI docs: auto retrieval and new fetch-topology command.
test-data/rinf-kvg/gnss.geojson New GNSS fixture for RINF download feature walkthrough.
test-data/rinf_uncovered_gnss.geojson New GNSS fixture for uncovered-area testing.
test-data/rinf_smoke_gnss.geojson New GNSS fixture for covered-area smoke testing.
test-data/rinf_empty_gnss.geojson New GNSS fixture for invalid/empty-input testing.
test-data/README.md Adds RINF download feature walkthrough + screenshots/commands.
specs/006-download-rinf-topology/tasks.md Task checklist for feature 006 implementation/verification.
specs/006-download-rinf-topology/spec.md Feature spec for auto RINF topology retrieval.
specs/006-download-rinf-topology/research.md Research notes: query shape, validation rules, retrieval geometry.
specs/006-download-rinf-topology/quickstart.md Quickstart validation guide for CLI/Python/.NET.
specs/006-download-rinf-topology/plan.md Implementation plan for feature 006.
specs/006-download-rinf-topology/data-model.md Retrieval data model documentation.
specs/006-download-rinf-topology/contracts/api.md API contracts for CLI/Python/.NET and SPARQL boundary.
specs/006-download-rinf-topology/checklists/requirements.md Spec quality checklist.
README.md Root docs: timestamp semantics + RINF retrieval overview + CLI examples.
Cargo.toml Workspace deps: adds ureq + url.
.github/workflows/ci.yml CI: adds ruff and runs it in Python job.
.github/agents/copilot-instructions.md Updates generated contributor guidance to include feature 006.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tp-py/src/lib.rs
Comment thread tp-net/src/lib.rs
Comment thread tp-net/src/lib.rs
Comment thread tp-core/src/workflow.rs
Comment thread tp-core/src/io/rinf.rs
Comment thread tp-net/csharp/TpLib.cs
Comment thread test-data/README.md Outdated
Comment thread .github/agents/copilot-instructions.md
Comment thread tp-py/README.md
Comment thread specs/006-download-rinf-topology/contracts/api.md
@codecov
Copy link
Copy Markdown

codecov Bot commented May 25, 2026

Codecov Report

❌ Patch coverage is 92.90954% with 58 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
tp-core/src/io/rinf.rs 86.41% 53 Missing ⚠️
tp-core/src/workflow.rs 99.09% 3 Missing ⚠️
tp-core/src/io/geojson.rs 96.72% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@MathiasVDA MathiasVDA merged commit 48633bb into main May 25, 2026
8 checks passed
@MathiasVDA MathiasVDA deleted the 006-download-rinf-topology branch May 25, 2026 19:39
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.

2 participants