NanoComp / meep

free finite-difference time-domain (FDTD) software for electromagnetic simulations
GNU General Public License v2.0
1.19k stars 610 forks source link

Various improvements to the documentation involving type hints #2527

Closed oskooi closed 1 year ago

oskooi commented 1 year ago

Various improvements to the documentation including additional type hints and fixes to the formatting of the docstrings of the class PadeDFT and the functions get_array and get_dft_array. Also, there were several instances where the type hint Optional had to be removed because it was being used incorrectly. The correct usage of Optional is described in https://docs.python.org/3/library/typing.html#typing.Optional:

An optional argument with a default does not require the `Optional` qualifier on its type
annotation just because it is optional … if an explicit value of `None` is allowed, the use 
of `Optional` is appropriate, whether the argument is optional or not.

Once the readthedocs build failure is fixed, a separate PR will be created for regenerating the markdown pages of the user manual from the docstrings to include these changes.