Repository navigation
Docstrings for methods are missing in generated docs - #217
Conversation
|
I think the solution is going to have to involve customizing the to though we may want the method docstrings to be below the autosummary table. I wasn't sure what the best way to specify a custom template directory - @eteq, any suggestions? For info, the default which explains why only |
|
I've figured out a solution and will attach code shortly |
|
Attached is a fix. A couple of questions for @mdboom and @eteq:
|
|
Also, please check the fix to ensure that it works for you! |
|
I figured out how to automatically include reference files at the top of generated documentation, and have attached it here (see commit message for more details). Let me know if you have any suggestions. @mdboom - could you test this out with vo and wcs? |
|
@eteq - just to check, any objections to me merging this? |
There was a problem hiding this comment.
I don't fully understand why you made this change... shouldn't .rst files be in docs/autsummary rather than in the source tree? Thats my understanding of how autosummary works (although I admit I haven't yet tested it)
There was a problem hiding this comment.
By default, the base templates are in sphinx/ext/autosummary/templates in the sphinx package, so I wanted to mirror that. I tried for hours to get it to work by having the templates in docs/templates, but failed. This was the cleanest and easiest in the end.
If you figure out how to do it with docs/templates let me know though.
There was a problem hiding this comment.
Just to clarify what I said above - the templates were originally in the sphinx source tree, so it turned out the easiest thing to do was just move them to our source tree rather than try and have a mechanism for specifying custom templates. If you look here you'll see that there is no mechanism for adding custom templates if a builder is specified (which it is) so if we wanted to have a mechanism to replace the autosummary templates, we'd have to implement it (hence why the above was simpler). It's just the only way I could figure out without more extensive changes to the template infrastructure in this file. I might be wrong though!
There was a problem hiding this comment.
Ok, I will look into this. I have a vague memory of encountering a way to do this while writing automodsumm, but I'll have to investigate it further. (It doesn't necessarily block this PR given that it works right now as-is, though, so if I don't get to this soon enough, I can do it as a separate PR of astropy.)
|
I also agree that it makes sense to remove |
|
Regarding the references: I'm a little hesitant to force the docs structure to parallel the source structure - that seems rather restrictive and could lead to much confusion. Maybe instead include an additional option to automodsumm that can be used to specify where the references file can be found? @mdboom - would that work for you? |
|
@eteq - agree with the option idea, that would indeed be less restrictive. I do think that the docs should mirror the code structure better than they do at the moment (e.g. we should have docs/io, but I agree that we don't necessarily want to make it compulsory). |
|
@eteq - how do you think we should proceed for this? I agree a :references: attribute would be nice, but I had trouble implementing it in practice as I'm not sure I understand all the subtleties of autosummary. |
|
@astrofrog - I'm not sure if "subtleties" is so much it as "confusingness" :) I haven't had a chance to look at this, as I was very busy last week, but I should be able to either implement this or judge it "unimplementable" by Friday. |
|
Ok - sounds good. I will merge this tonight if you don't get |
|
Personally, I think keeping the docs mirroring the source is a minor inconvenience and in some ways a nice thing. Adding the |
|
I'm looking at this now, so depending on what timezone "tonight" means, please hold off for just abit on merging, @astrofrog . And I see your point, @mdboom - it depends on just how complicated in ends up having to be. |
|
Alright, I think I could implement the Also, @astrofrog , there's a PR astrofrog#12 that addresses the template location issue (and #243 as a bonus). |
…rated docs. If the module is a directory, e.g. astropy.wcs, then the reference file should be in docs/wcs/references.txt, while if the module is a file, e.g. astropy.config.logging_helper then the reference file is in docs/config/references.txt
|
Ok, I merged in your PR and have also removed |
Docstrings for methods are missing in generated docs
|
@eteq - for some reason, the docs on readthedocs don't reflect the template change - any ideas? |
|
@eteq - I think it's a cache problem, I added the logging docs back (they had disappeared due to the move) and those are ok, but other generated pages are not. I'll see if we can make a clean build. |
|
Try sending a POST to http://readthedocs.org/wipe/astropy/ - that clears the build environment and has fixed similar issues before |
|
Ok, it seems to be fixed now - I had opened an issue with readthedocs, so maybe they did just that. Good to know for future! |
|
Actually, I did it just now because I discovered you can just go to that address with a regular webbrowser and click a button to do the wipe. If you ever need to do this in the future, note that you have to manually trigger a new build after the wipe. |
|
Ok, awesome! I'll close the issue with readthedocs. |
…thods Docstrings for methods are missing in generated docs
…mmary-methods Docstrings for methods are missing in generated docs
CSS fixes for documentation overflows
Adding dust_extinction package
In the following page:
http://astropy.readthedocs.org/en/latest/_generated/astropy.config.logging_helper.AstropyLogger.html#astropy.config.logging_helper.AstropyLogger
The full docstrings for the methods are not shown (except for
__init__.py)