Updates to allow for upgraded vehicle repository#259
Open
kylecarow wants to merge 76 commits into
Open
Conversation
kylecarow
marked this pull request as draft
June 26, 2026 18:39
Updated Anaconda setup instructions to specify environment name and include pip upgrade.
Closed
…t drive cycle section
… started to use plotly and new demo conventions, small tweak to test demos to render plots as JSON (replacement for SHOW_PLOTS)
updated getting started demo with mines demo content, updated getting…
…st using pytest --nbmake (which is set to run by default in pyproject.toml with parallelization - you may need to reinstall dev dependencies before use)
# Conflicts: # pixi.lock
This was referenced Jul 17, 2026
…hema info is encoded in the path) and relevant pyi change
Collaborator
Author
|
@robinsteuteville This PR is ready to review! You may want to review the PRs it builds upon #265 & #267 first to not have to look at a huge diff. Like other PRs with huge diffs I've made recently much of it comes from the |
# Conflicts: # pixi.lock
kylecarow
force-pushed
the
f3/vehicle-repo-changes
branch
from
July 18, 2026 03:06
062b05b to
84962e2
Compare
Collaborator
Author
|
|
Open
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.
Resolves #274 and #289
Master issue for all vehicle database work: #288
Based off of #265 / #267, review those first to not get overwhelmed by the huge diff
PR Summary: Vehicle Repository Schema,
from_dbAPI, and Related ChangesNew: Vehicle Database Schema v1
A new
DatabaseSchemaV1struct (schema_v1.rs) formalizes the directory layout for thefastsim-vehiclesrepository. It encodes an 8-segment path:v1fastsim-3conv/hev/phev/bev/fcev)hevtoyotacamry-xle2015thermalv1Example full filepath:
v1/fastsim-3/hev/toyota/camry-xle/2015/thermal/v1.yamlThe struct serializes to/from a plain string, so it stores compactly in YAML as a single field.
New:
Vehicle.from_dband underlying Rust methodsThe high-level Python entry point is
Vehicle.from_db(db_path_or_url, schema=1, **kwargs).db_path_or_urlisNone(default remote), anhttps://...URL, or a local filesystem path. It supports two input modes:Mode 1 — Path string (caller supplies the pre-serialized schema path):
Mode 2 — Individual fields (schema path is constructed internally):
The underlying
Vehicle.from_db_path_v1andVehicle.from_db_fields_v1are also exposed directly to Python for lower-level use. All methods auto-detect local vs. remote loading.New Vehicle Metadata Fields
VehicleModelnow carries:min_fastsim_version: Version: minimum FASTSim version required to load this file (defaults to current version at serialization time; emits a pre-deserialization warning if the running version is older)db_path: Option<Schema>: optional field recording where in the database this vehicle lives, enabling CI to verify files are stored in the correct locationmake: Option<String>,model: Option<String>— new optional identity fieldsyear: Option<String>: changed fromu32toOption<String>to support year ranges and missing datasimdrivelabeluses a newparse_model_year_or_2017()helper that falls back to 2017 adjustment coefficients with astderrwarning ifyearcan't be parsed as an integer.Empty History Fixes
Vehicle history is now skipped when empty (
skip_serializing_if = "VehicleStateHistoryVec::is_empty"), reducing file size for vehicles with asave_intervalofNone. Related Python fixes:to_pydict(flatten=True)andto_dataframe()no longer assert that history is non-empty; both work correctly with no historyget_flattened()type signature updated tohist_len: int | Nonewith appropriate guardsVehicle YAML Files Updated
All f3-vehicles and vehicles files were regenerated to include the new
min_fastsim_version,make,modelfields and remove stale fields (~70 lines removed per file across ~70 vehicles).Follow-on Work
fastsim-core/resources/vehiclescal_and_val/*/f2-vehiclesandcal_and_val/*/f3-vehiclesfastsim-calibrationfastsim-core/src/vehicles/fastsim-2*.yaml