Skip to content

feat(template-generator): add TOML template generation function and our first example - #54

Merged
Arseni10Lk merged 12 commits into
mainfrom
vehicle-template-generator
Sep 7, 2026
Merged

Arseni10Lk merged 12 commits into
mainfrom
vehicle-template-generator

Conversation

@Arseni10Lk

@Arseni10Lk Arseni10Lk commented Sep 6, 2026

Copy link
Copy Markdown
Member

Description of Changes:

Closes #21

This PR implements the backend vehicle template generator and assembly subsystem for the YAADO CLI (Terminal/Assembly/), resolves the "default parameters" dilemma via schema-embedded examples, and adds realistic reference configurations based on flight-proven hardware (AGM-84 Harpoon).

1. Vehicle Assembly & Template Generator (Terminal/Assembly/)

  • VehicleTemplateGenerator Class (Terminal/Assembly/template_generator.py):
    • generate_template(name, component_classes, pre_filled=False): Generates and writes vehicle TOML configs directly into Hangar/<name>/<name>.toml.
    • Pre-filled Mode (pre_filled=True): Dynamically inspects Pydantic schemas and instantiates components using embedded field_info.examples. Yields an immediately runnable, physically consistent baseline configuration for interactive studies and demos.
    • Production Skeleton Mode (pre_filled=False): Uses Pydantic's model_construct() to scaffold a blank template structure without tripping validation errors, allowing users to manually fill in parameters.
    • assemble_vehicle(name, components): Type-checks and routes instantiated components into their appropriate subsystem dictionaries (aero_surfaces, bodies, propulsion, or mass_properties) on BaseVehicleConfig.
    • prefill_component_values(component_class): Dynamically reflects on component schema fields to populate instances from examples.
  • Module Documentation (Terminal/Assembly/README.md):
    • Fully documents the architecture, the "Physics-Owned Fallback" pattern, and the 3 interactive CLI prompt scenarios (full custom prompt, skip all, per-field skip).

2. ComponentStore Examples & Class Tuples (YAADO_Core/ComponentStore/)

Injected real-world specifications as examples=[...] into Field() definitions across all components

3. Hangar & Git Tracking (.gitignore, Hangar/examples/)

  • Updated .gitignore to allow committing reference configurations in Hangar/examples/ while creating ignore rules for private user configurations in Hangar/*.
  • Added verified reference template: Hangar/examples/AGM-84_HARPOON/AGM-84_HARPOON.toml.

Remaining Tasks:

  • All components have examples for each field
  • The functionality to skip one field is neatly defined in a separate method for future use
  • Test suite expanded

Verification method:
What did you do to verify that everything works as expected?
Generated two examples

Signed-off-by: Arseni10Lk <arseniy230606@gmail.com>
Signed-off-by: Arseni10Lk <arseniy230606@gmail.com>
…ator

Signed-off-by: Arseni10Lk <arseniy230606@gmail.com>
Signed-off-by: Arseni10Lk <arseniy230606@gmail.com>
Signed-off-by: Arseni10Lk <arseniy230606@gmail.com>
Signed-off-by: Arseni10Lk <arseniy230606@gmail.com>
Signed-off-by: Arseni10Lk <arseniy230606@gmail.com>
Signed-off-by: Arseni10Lk <arseniy230606@gmail.com>
Signed-off-by: Arseni10Lk <arseniy230606@gmail.com>
Signed-off-by: Arseni10Lk <arseniy230606@gmail.com>
Signed-off-by: Arseni10Lk <arseniy230606@gmail.com>
Signed-off-by: Arseni10Lk <arseniy230606@gmail.com>
@Arseni10Lk
Arseni10Lk marked this pull request as ready for review September 7, 2026 19:33
@Arseni10Lk
Arseni10Lk merged commit 16b6a9a into main Sep 7, 2026
1 check passed
@Arseni10Lk
Arseni10Lk deleted the vehicle-template-generator branch September 7, 2026 19:36
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.

Create an automated vehicle template generator (CLI)

1 participant