[BC-breaking] Make I/O optional arguments kw-only (#3227)
Summary: Recently, we added bunch of options to make StreamReader/Writer flexible. As a result, their methods have many number of arguments, and some of them have semantic grouping. For example, the arguments of ``StreamWriter.add_video_stream`` are roughly grouped as follow; - Information about input media format `frame_rate`, `width`, `height`, `format` - Information about encoder `encoder`, `encoder_option` - Information about codec configuration `codec_config` - Information about encode media format `encoder_format`, `encoder_frame_rate`, `encoder_width`, `encoder_height` - Information about additional processing `filter_desc` - Hardware acceleration `hw_accel` We do not know what arguments will be added in the future, but when we do, we want to keep them roughly grouped, by inserting the new argument somewhere in a middle without breaking backward compatibility. This commit puts most of them in keyword-only argument, so that we can rearrange them without breaking backward compatibility. Pull Request resolved: https://github.com/pytorch/audio/pull/3227 Reviewed By: hwangjeff Differential Revision: D44681620 Pulled By: mthrok fbshipit-source-id: b55f6168f4c2f3d0f59731b9bb0db4ae54e5a90f
Showing
Please register or sign in to comment