Skip to content

Suggestions for minor improvements to code quality #331

Description

@MatthijsMars

Here's a list of minor inconsistencies and improvements that could improve the readability, consistency, interpretability, and re-usability of the code:

In src/dLux/layers/optical_layers.py

  • there's FourierBasis, which is a FourierBasisLayer (inconsistency in naming convention of layers)
  • The FourierBasis generates the basis automatically whereas the BasisLayer doesn't (inconsistency of behaviour) I can see why but it is a bit confusing. Also if there's a FourierBasis class that generates them automatically you should maybe also have a Zernike that generates it.
  • In the FourierBasis it is not easy to scale the basis (should have a scale parameter that is passed to dlu.fourier_kernels( )
  • The FourierBasis doesn't have the as_phase option which all the other layers do.
  • There should be amplitude bases as well, could just be by having the option of as_amplitude in addition to as_phase. (or have an as={'opd', 'phase', 'amplitude'})

Happy to implement these myself, just let me know if there's any points you don't agree with and don't want to change.

If I find more things I'll add to this

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions