0

In my docs/source/conf.py file, I have the numpydoc extension enabled, and it's generally working, except I'm getting docstring errors from different python files showing up as being caused in line 1, column 1 of the conf.py file instead of the source file.

Is there anyway to get these warnings to show up on the correct file?

enter image description here

mzjn
  • 48,958
  • 13
  • 128
  • 248
DilithiumMatrix
  • 17,795
  • 22
  • 77
  • 119
  • To me it looks like the warning is about `holodeck.cosmology.Cosmology.a_to_tage`. – mzjn Jul 22 '22 at 16:32
  • @mzjn yes. Which is a different file than `conf.py`, and hence the problem – DilithiumMatrix Jul 22 '22 at 17:59
  • The error is from numpydoc validation. See https://numpydoc.readthedocs.io/en/latest/validation.html. Add a `returns` section to your docstring, and it should be fixed. – Steve Piercy Jul 23 '22 at 07:08
  • Thanks for pointing me to the validation section @StevePiercy, that's a helpful start for me. The issue I'm having isn't with the warning given by numpydoc, but that the warnings are being associated with `conf.py` instead of the file actually triggering the warning. – DilithiumMatrix Jul 23 '22 at 13:54
  • Does it really? What does the warning say? – Steve Piercy Jul 24 '22 at 05:37
  • @StevePiercy the attached image shows the Warning (RT01) showing up for `docs/source/conf.py`, whereas the warning itself pertains to the separate `Cosmology.py` file. – DilithiumMatrix Jul 25 '22 at 02:47
  • 1
    Are you asking why your editor makes the association to `conf.py`? Maybe it's an unreported bug? In any case, the warning is clear to me that the docstring in `Cosmology.py` lacks a `returns` section. – Steve Piercy Jul 25 '22 at 07:10

0 Answers0