wgpu-py
wgpu-py copied to clipboard
Include more docstrings
We have docstrings for most methods, but it would be nice to also have docs for the emums/flags/structs and their fields.
The docstrings for the methods are written by hand, the codegen only updates signatures in these files. Would probably be good to read through them and make them more complete ...
For flags/enums/structs we could perhaps load these from upstream definitions. Or just write them by hand in a separate document. Or a mix of both.
Possible sources to load docstrings from:
- It would have been nice if the IDL file contained docs, but it does not.
- https://github.com/webgpu-native/webgpu-headers/blob/main/webgpu.yml (also see #460). This defines the
webgpu.hbut most docstrings can be applied to the user-facing API too. However, most docs are currently missing. - Just scrape https://gpuweb.github.io/gpuweb
- The text for WebGPU spec seems to be defided in https://github.com/gpuweb/gpuweb/blob/main/spec/index.bs
Something that might be helpful: cross-refs within the documentation as well as links to the webgpu spec or wgpu docs page