Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: cleanup extra cars #1905

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

docs: cleanup extra cars #1905

wants to merge 9 commits into from

Conversation

sshane
Copy link
Contributor

@sshane sshane commented Mar 3, 2025

No description provided.

@github-actions github-actions bot added the car related to opendbc/car/ label Mar 3, 2025
@sshane sshane changed the title docs: cleanup and support type test docs: cleanup extra cars Mar 3, 2025
@github-actions github-actions bot added the toyota label Mar 3, 2025
@sshane
Copy link
Contributor Author

sshane commented Mar 3, 2025

@jyoung8607 I don't have time for this now, but this is a good proof of concept. Want to take it over? Does this look reasonable to you?

You just need to ignore != SupportType.UPSTREAM on the site jinja template

ExtraPlatform = Platform | EXTRA
EXTRA_BRANDS = get_args(ExtraPlatform)
EXTRA_PLATFORMS: dict[str, ExtraPlatform] = {str(platform): platform for brand in EXTRA_BRANDS for platform in brand}


def get_params_for_docs(platform) -> CarParams:
cp_platform = platform if platform in interfaces else MOCK.MOCK
Copy link
Contributor Author

Choose a reason for hiding this comment

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

we can remove this once done

@jyoung8607
Copy link
Collaborator

@jyoung8607 I don't have time for this now, but this is a good proof of concept. Want to take it over? Does this look reasonable to you?

You just need to ignore != SupportType.UPSTREAM on the site jinja template

It's more than the CARS.md jinja template, it's the functions consumed by comma.ai/vehicles and shop.comma.ai. At the time I wasn't free to alter that interface at all. Hence the EXTRA_STUFF, so those original functions could continue filtering down to the set of release-supported cars.

# CAUTION: This function is imported by shop.comma.ai and comma.ai/vehicles, test changes carefully
def get_all_car_docs() -> list[CarDocs]:
collected_footnotes = get_all_footnotes()
sorted_list: list[CarDocs] = build_sorted_car_docs_list(PLATFORMS, footnotes=collected_footnotes)
return sorted_list

# CAUTION: This function is imported by shop.comma.ai and comma.ai/vehicles, test changes carefully
def generate_cars_md(all_car_docs: list[CarDocs], template_fn: str) -> str:
with open(template_fn) as f:
template = jinja2.Template(f.read(), trim_blocks=True, lstrip_blocks=True)
footnotes = [fn.value.text for fn in get_all_footnotes()]
cars_md: str = template.render(all_car_docs=all_car_docs, PartType=PartType,
group_by_make=group_by_make, footnotes=footnotes,
Device=Device, Column=Column, BaseCarHarness=BaseCarHarness)
return cars_md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
car related to opendbc/car/ toyota
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants