v0lta / PyTorch-Wavelet-Toolbox

Differentiable fast wavelet transforms in PyTorch with GPU support.
https://pytorch-wavelet-toolbox.readthedocs.io
European Union Public License 1.2
289 stars 36 forks source link

Use typing.Literal for boundary mode, padding mode, and orthogonalization mode #77

Closed cthoyt closed 9 months ago

cthoyt commented 9 months ago

This PR does the following:

  1. Creates a Literal type annotation for ptwt boundary modes
  2. Uses this literal for type annotations. This has the benefit that it makes the type checker much smarter and also auto-generates docs
  3. Re-write the docs for mode in many places to point to a centralized place where we can expand on padding.
  4. Sets a lot of these parameters to be keyword-only. This will make code much more understandable in the future, and also allows for easier development/debugging

Did the same thing for convolutional boundaries as well as orthogonalization method.

cthoyt commented 9 months ago

@v0lta this is blocked by @v0lta since I want to isolate the formatting updates from the new black style