Restructuration - #40
Merged
Merged
Conversation
…blem and solution formats
… enhance PDF generation with KaTeX support
- Updated `_parse_solution_route_token` and `_parse_solution_product_token` to support decimal quantities. - Enhanced `parse_solution` to allow optional summary metrics and handle cases with fewer than six lines. - Modified documentation to clarify submission requirements and solution evaluation penalties. - Improved test coverage for solution parsing and verification, ensuring robustness against various input scenarios. - Adjusted frontend files for consistent styling and functionality, including cache-busting for CSS and JS assets.
… and update documentation for clarity
Merge pull request #38 from IFRI-AI-Classes/restructuration
There was a problem hiding this comment.
Pull request overview
This PR updates the MPVRP-CC benchmark platform to clarify the public specification and align backend parsing/verification with more flexible solution files (optional summaries, decimal quantities, compact product lines), while also refreshing the static website styling/navigation and improving documentation rendering (KaTeX/PDF support).
Changes:
- Documentation/spec updates for changeover (loading-transition) costs, instance/solution formats, and LP model wording.
- Backend robustness improvements: solution parsing now supports float quantities, optional/partial summary blocks, and compact product sequences; feasibility checking recomputes metrics by default.
- Static site UI refresh: new floating navigation, updated color scheme, and math/PDF support on documentation pages.
Reviewed changes
Copilot reviewed 34 out of 39 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_utils.py | Adds coverage for decimal quantities, missing reported costs, omitted summaries, and compact product lines. |
| tests/test_score_evaluation.py | Adds coverage ensuring missing/invalid solutions are penalized consistently. |
| tests/test_feasibility.py | Updates/adds tests around optional reported-metrics checking and recomputation behavior. |
| scripts/start_frontend.sh | Adds a helper to serve the repo via python -m http.server. |
| scripts/start_backend.sh | Adds a helper to run the backend via uvicorn. |
| scripts/generate_doc_pdfs.py | Enhances doc PDF generation to render LaTeX via KaTeX in headless Chrome. |
| README.md | Clarifies scoring/penalties and updates persistence wording (removes Notion references). |
| pages/visualisation.html | Updates styling and adds shared app CSS. |
| pages/tools.html | Updates navigation labels and UI copy; adds cache-busted site assets. |
| pages/submission.html | Rebuilds the submission page layout and copy to match partial-submission rules. |
| pages/static/js/visualisation.js | Updates truck color palette to match the new theme. |
| pages/static/js/site.js | Introduces floating site navigation, mobile menu behavior, and scroll-to-top UI. |
| pages/static/js/scoreboard.js | Updates row highlight styling to match new theme. |
| pages/static/js/docs.js | Adds KaTeX math rendering and PDF-download wiring; adjusts fetch caching behavior. |
| pages/static/js/auth.js | Updates message banner colors to match new theme. |
| pages/static/css/visualisation.css | Updates primary color tokens and related UI affordances. |
| pages/static/css/tools.css | Updates accent color usage. |
| pages/static/css/submission.css | Updates accent color usage. |
| pages/static/css/style.css | Updates accent color usage across legacy styles. |
| pages/static/css/scoreboard.css | Updates accent color usage across legacy scoreboard styles. |
| pages/static/css/app.css | Adds shared accent variables and overrides to align Tailwind “blue” utilities with the new accent. |
| pages/scoreboard.html | Rebuilds scoreboard page layout and wiring to new shared header/site.js behavior. |
| pages/documentation.html | Adds KaTeX assets and PDF download control; updates nav labels. |
| pages/about.html | Adds a new “About & Partnerships” page. |
| index.html | Updates homepage layout, copy, and theme; uses shared floating header. |
| docs/solution_format.md | Rewrites solution format spec to reflect optional summaries and compact product lines. |
| docs/problem.md | Clarifies problem statement and explicitly documents station/product revisit constraints. |
| docs/lp_model.tex | Clarifies objective terms and constraints phrasing; aligns “changeover” wording with loading transitions. |
| docs/instance_format.md | Rewrites instance format spec to clarify matrix meaning and section structure. |
| backend/README.md | Updates backend documentation to reflect new persistence approach (no Notion). |
| backend/core/model/utils.py | Extends solution parsing: float quantities, optional metrics block, compact product-line expansion. |
| backend/core/model/modelisation.py | Fixes product indexing alignment (domain vs model) and export initial product configuration at departure. |
| backend/core/model/feasibility.py | Makes reported-metric validation opt-in; improves garage ID normalization; recomputes metrics by default. |
| backend/app/routes/model.py | Updates endpoint documentation to reflect automatic recomputation of metrics. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
302
to
+306
| # Les lignes non vides restantes contiennent les métriques (6 lignes) | ||
| metrics_lines = [l.strip() for l in raw_lines[i:] if l.strip()] | ||
| if len(metrics_lines) != 6: | ||
| raise ValueError(f"Expected 6 metric lines, got {len(metrics_lines)}") | ||
|
|
||
| metrics = { | ||
| "used_vehicles": int(metrics_lines[0]), | ||
| "total_changes": int(metrics_lines[1]), | ||
| "total_switch_cost": float(metrics_lines[2]), | ||
| "distance_total": float(metrics_lines[3]), | ||
| "processor": metrics_lines[4], | ||
| "time": float(metrics_lines[5]), | ||
| } | ||
| if len(metrics_lines) not in {0, 4, 5, 6}: | ||
| raise ValueError( | ||
| "The optional summary must be omitted or contain at least its four numeric metrics" |
Comment on lines
138
to
143
| subprocess.run([ | ||
| chrome, "--headless", "--disable-gpu", "--no-sandbox", | ||
| "--virtual-time-budget=5000", | ||
| f"--user-data-dir={profile}", "--no-pdf-header-footer", | ||
| f"--print-to-pdf={DOCS / output_name}", source.as_uri(), | ||
| ], check=True) |
rosasbehoundja
added a commit
that referenced
this pull request
Aug 20, 2026
Merge pull request #40 from IFRI-AI-Classes/restructuration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces several important clarifications and improvements to the documentation and backend logic of the MPVRP-CC benchmark platform. The main focus is on making the problem specification clearer, updating the solution parser and feasibility checker for better robustness and compatibility, and reflecting the shift away from Notion-based persistence. Below are the most significant changes:
Documentation and Specification Clarifications:
README.md,docs/instance_format.md,docs/lp_model.tex: Expanded and clarified explanations of changeover costs, instance file format, and modeling assumptions. The instance specification now more clearly describes all fields, vehicle visitation rules, and the meaning of the transition cost matrix. The LP model documentation better explains cost terms and the meaning of the mini-route bound. [1] [2] [3] [4] [5]README.md,backend/README.md: Updated descriptions to reflect that participant and scoreboard data is now handled internally, removing references to Notion. [1] [2] [3] [4]Solution Parser and Feasibility Improvements:
backend/core/model/feasibility.py: Theverify_solutionfunction now always recomputes all performance metrics for a solution and only validates reported metrics if explicitly requested. This makes the checker robust to rounding and summary differences. [1] [2] [3] [4]backend/core/model/utils.py: The solution parser now handles both int and float quantities, tolerates omitted product entries for final garage returns (for backward compatibility), and supports optional or partial summary metric blocks. [1] [2] [3] [4]Model Consistency and Output Fixes:
backend/core/model/modelisation.py: Fixed off-by-one errors in product indexing between domain objects and the optimization model, ensuring consistent output and correct product alignment in exported solutions. [1] [2]These changes improve the clarity, robustness, and maintainability of the platform, especially for participants and developers working with solution files and the evaluation process.