-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve documentation, add documentation testing, and make all examples into scripts. #101
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing to say except that this is going to be super useful!
I'm wondering if this kind of "good practice" won't eventually (in 5-year time?) be included in a more user-friendly way to GitHub. I hope so.
The advantage is that we really get to know how this all works (well.. mostly you Erik!)
@@ -9,35 +9,9 @@ DEM subtraction and volume change | |||
|
|||
Example data in this chapter are loaded as follows: | |||
|
|||
.. code-block:: python | |||
.. literalinclude:: code/comparison.py |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so literalinclude
is kind of the key here :D
""" | ||
Make sure readthedocs finds the module. | ||
|
||
Maybe this is not needed? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
time will tell !
import warnings | ||
|
||
|
||
class TestDocs: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very nice
Thank you for the feedback, @rhugonnet! I wanted to see if other packages used similar testing, so I checked rasterio.
|
Does this mean we're now doing better than rasterio?! :-) |
This was a hard one, including environment variables and all kinds of weird errors!
Fixed warnings and incorrect docstrings
There were quite many warnings before when building the documentation. I've made sure that all of them have been fixed.
Documentation build tests
I've added tests for all example scripts (I'll get more to that in a second) and for building the documentation. Now, theoretically, ReadTheDocs should always build if the build check on GitHub passes. Makes for easier maintainability in the long term, as a PR that passes the build check should be compatible with ReadTheDocs (right now, builds might pass but then the documentation fails to build!).
More future-frendly examples structure.
Finally, since we already have had trouble with outdated examples, all example code is now in
docs/source/code/*.py
. This has many advantages:See the result
If you're interested, you can see how the documentation will look here:
https://xdem-erikm.readthedocs.io/en/improve_docs/index.html