Metadata-Version: 2.4
Name: voila-sus
Version: 0.2.0
Summary: Target-driven double-wishbone suspension optimiser with a Lotus-validated kinematic solver
Author: Owais Sadiqque
License-Expression: MIT
Project-URL: Homepage, https://github.com/owais-sadiqque-dayderh/Voila
Project-URL: Repository, https://github.com/owais-sadiqque-dayderh/Voila
Project-URL: Issues, https://github.com/owais-sadiqque-dayderh/Voila/issues
Keywords: suspension,kinematics,hardpoints,optimization,automotive
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Scientific/Engineering
Classifier: Operating System :: OS Independent
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: numpy
Requires-Dist: scipy
Requires-Dist: fastapi>=0.110
Requires-Dist: pydantic>=2
Requires-Dist: uvicorn[standard]>=0.29
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: httpx; extra == "dev"
Requires-Dist: build; extra == "dev"
Requires-Dist: twine; extra == "dev"

# voila-sus

A local workstation for double-wishbone suspension geometry. Choose movable
hardpoints, define engineering targets, and compare candidate designs with your
baseline using the same kinematic solver throughout.

## Install and run

Python 3.10 or newer is required. Node.js is not needed to run the installed app.

```bash
python -m pip install --upgrade voila-sus
voila-sus
```

The app opens at http://127.0.0.1:8000. Stop it with Ctrl+C before upgrading,
then restart it. Use the Python environment in which you originally installed
it; Windows users can use `py -m pip` instead of `python -m pip`.

```bash
voila-sus --port 9000
voila-sus --no-browser
python -m pip show voila-sus
```

Saved geometries remain in `~/Desktop/Suspension Geometries` (or
`~/Suspension Geometries` when Desktop does not exist). Set `SUSP_GEO_DIR` to use
another directory. Runs are held in memory; export results before closing the
server. Do not expose this local app on a public network.

## Workflow

The left rail walks through four steps and always shows what is still missing
before a run; **Run optimisation** (or ⌘/Ctrl + Enter) is available from any step.

1. **Geometry:** open a saved corner from the library, import a hardpoints JSON
   (button, or drag the file anywhere onto the window), or type coordinates in
   the editor, which draws the linkage live as you type. The geometry page shows
   true front / side / plan views plus an orbitable 3D view, the kingpin axis
   extended to the ground, and every baseline characteristic over the analysis
   sweep. Choose the axle and sweep travel here. Coordinates are millimetres in
   the Lotus convention (X rearward, Y outboard, Z up).
2. **Design space:** start from a preset or click individual X/Y/Z coordinates
   to free them, then set limits as offsets from the baseline (e.g. −10 … +25).
   The packaging view draws each allowed travel box on the linkage. Custom
   limits survive later selection changes; the default allowance only updates
   limits you have not edited. **Influence** runs a quick finite-difference study
   showing which free coordinate moves which metric.
3. **Targets:** switch metrics on, choose target / range / hold-baseline, and set
   tolerance, weight and whether it is a hard limit. Each row shows the baseline
   value and whether it already meets the goal; after an influence study a Reach
   column shows whether the free coordinates can move it at all.
4. **Results:** watch progress and convergence live, then compare designs. The
   scorecard shows actual values against goals; **Side effects** lists metrics you
   did not target that moved by more than one tolerance, with a one-click *Hold in
   next run*. Curves, a baseline-vs-design linkage overlay, hardpoint moves against
   their limits, the trade-off map and convergence are one tab away. Export the
   hardpoints JSON, a Lotus-format report or every design as CSV.

Light, dark and system themes are available from the bottom of the rail.

Variable influence is a local finite-difference estimate around the baseline.
Low influence does not prove a KPI is globally unreachable. Free the relevant
points: chassis pivots alone cannot alter static scrub radius or mechanical
trail when both ball joints and the wheel package are fixed.

Cost is `Σ weight × (deviation / tolerance)²`, plus a movement regularizer and
an internal constraint penalty. Target/hold constraints allow ± tolerance;
range constraints require the value inside the range. Designs that fail the
kinematic or KPI constraints are labelled and ranked behind valid designs.
Finite penalty methods do not guarantee that a feasible solution will be found.

## What is validated

Tests compare front type 1 and rear type 6 geometry with included Lotus SHARK
v4.03 reports, covering bump, both roll sides, front steering and static geometry.
Tolerances are explicit in `tests/test_lotus_validation.py`, including up to
6 mm lateral roll-centre discrepancy and 0.2° steering camber discrepancy.
This is fixture-based validation, not proof for every possible geometry.

The optimizer uses Sobol screening and multistart bounded least squares.
Trade-off studies sample category weights and identify non-dominated returned
designs; they do not guarantee a global optimum or the entire Pareto frontier.
Independent bump/roll/steering sweeps do not cover every combined motion.
The model does not validate component strength, compliance, joint angular
limits, collision clearance, tyre performance or vehicle lap time.

The target/weight and design-space workflow was informed by OptimumG's
[optimization module](https://optimumg.com/product/optimumkinematics-optimization-module/)
and [tie-rod case study](https://optimumg.com/tie-rod-optimization-using-optimumkinematics-optimization-module/).
No commercial-product accuracy or performance equivalence is claimed.

## Develop and verify

From this repository's root:

```bash
python3 -m pip install -e '.[dev]'
python3 -m pytest -q
cd src/voila_sus/optimization/web
npm ci
npm run build
```

The built frontend is committed and included in the Python package. Changes to
`web/src` must be rebuilt before they appear in the installed app.

## Publish 0.2.0 to PyPI

This branch prepares version **0.2.0**. It is not published automatically.
Versions already uploaded to PyPI cannot be replaced. For later releases,
update both `pyproject.toml` and `src/voila_sus/__init__.py` first.

From the repository root, in your development Python environment:

```bash
python3 -m pip install -e '.[dev]'
python3 -m pytest -q
bash build.sh
python3 -m twine upload dist/0.2.0/*
```

`build.sh` always rebuilds the frontend, clears generated setuptools output,
builds the wheel and source archive under the version-specific directory and
checks metadata. It does not upload. Use your PyPI account's project-scoped API
token when Twine asks for authentication (username `__token__`, token as password).
Do not put the token in source files or command history. See the
[Python Packaging Guide](https://packaging.python.org/en/latest/tutorials/packaging-projects/).

After publishing, your friend should stop the running app, activate the same
Python environment they used to install it, and run:

```bash
python -m pip install --upgrade voila-sus
python -m pip show voila-sus
voila-sus
```

The displayed version should be `0.2.0`. To require this exact release:
`python -m pip install --upgrade voila-sus==0.2.0`.

See [CHANGELOG.md](CHANGELOG.md) for the changes from 0.1.1 and their rationale.
