symforce icon indicating copy to clipboard operation
symforce copied to clipboard

Add `skip_type_generation` argument to `generate_function` to suppress type generation

Open gareth-cross opened this issue 2 years ago • 1 comments

This change adds an optional argument to generate_function to allow skipping generation of any code-generation types (c++/python/lcm).

When true, only the function code is generated and no other files are written. The logic proceeds normally otherwise, and the typenames_dict and namespaces_dict are filled out as expected.

This configuration is useful if you intend to define types manually elsewhere, and want to suppress any extra emitted files.

This is a more minimal version of the proposal raised here: https://github.com/symforce-org/symforce/discussions/183

CC @anuragmakineni

gareth-cross avatar Aug 17 '23 03:08 gareth-cross

I think you could also accomplish this by passing shared_types as all the types the function takes, although it's maybe annoying to have to build that - I do think we maybe want to merge the flags, e.g. have a singleton ALL as something you can pass for shared_types to indicate that all types are shared, instead of adding an additional argument?

aaron-skydio avatar Aug 22 '23 02:08 aaron-skydio