Skip to content

Fix non-snake case conversion to pascal case#456

Closed
tordnat wants to merge 1 commit into
symforce-org:mainfrom
tordnat:tordnat/fix-pascal-case-caspar
Closed

Fix non-snake case conversion to pascal case#456
tordnat wants to merge 1 commit into
symforce-org:mainfrom
tordnat:tordnat/fix-pascal-case-caspar

Conversation

@tordnat
Copy link
Copy Markdown
Contributor

@tordnat tordnat commented Apr 28, 2026

Closes #455

@aaron-skydio
Copy link
Copy Markdown
Member

Cool, thanks for this - my initial question was going to be whether we can avoid generating these hybrid case python function names like PinholePose_pred_decrease_times_two, but I see Caspar is doing that internally I guess by concatenating the class name and a snake_case function name. Feels like you could instead have Caspar convert the class names to snake_case for use in the kernel name, but that could be confusing in more complicated cases.

I think this seems reasonable, partly curious what @emillma thinks for whether it'd be more reasonable for Caspar to handle this somewhere else instead

@emillma
Copy link
Copy Markdown

emillma commented Apr 29, 2026

I'm pretty sure Caspar could handle stuff better, but I'm afraid you will end up breaking some conventions no matter what you do. We are generating names for C++ and Python where certain names are partially used for both class names, function names and variables 🍝 If this fix solves it I think it might be a good enough solution for now.

@emillma
Copy link
Copy Markdown

emillma commented Apr 29, 2026

In the future it might be a good idea to add a strict keyword argument, to make the conversation only support names that follow the expected convention.

@aaron-skydio
Copy link
Copy Markdown
Member

Makes sense, thanks

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.

Caspar generates inconsistent PascalCase

3 participants