-
Notifications
You must be signed in to change notification settings - Fork 121
Sphinx documentation #74
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
Conversation
bastibe
commented
Sep 21, 2014
- translated all docstrings from Markdown to ReST
- added trivial documentation configuration
- translated all docstrings from Markdown to ReST - added trivial documentation configuration
|
This is very much work in progress and not meant for merging yet. |
- all parameters are documented - all return values are documented - every function and method has an example
we still have to add more information though
|
This still needs a bit of work. In particular, the README should be expanded, and we should select a more beautiful theme. Apart from that, this should be a workable prototype though. |
README.rst
Outdated
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.
It's actually much easier than that!
'w' is implied and channels is automatically taken from data.
Also, data.shape[1] doesn't work on one-dimensional data.
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.
true
|
That's much more than a prototype, that's great! I have a few comments/questions though: I think the files somehow clutter the main directory. Especially having a I (as so often) don't like the amount of repetition. I don't like naming (single) return arguments. Lower camelCase is a no-go in Python (except probably for compatibility with external non-Pythonic APIs), please don't use Some possible options for To show constructor docs (I like this much better than documenting |
|
You should also move the module docstring to the top of the file (see https://github.com/bastibe/PySoundFile/issues/57#issuecomment-49043385). Also, I think there is again too much repetition in the module docstring. |
README.rst
Outdated
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.
I guess this should be import pysoundfile as sf
|
Is it intentional that you write I think it's strange though, that Sphinx seems to require the dot, otherwise the link points to the Also in case of the function references, the explicit |
pysoundfile.py
Outdated
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.
Most of the above paragraph is redundant because it's repeated below in the parameter list.
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.
I think it is a nice summary. It's always nice to have a more readable introduction and example. We could probably get rid of it though.
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.
It is indeed a nice summary with nice examples.
I guess I was mainly disturbed by the listing of the endian-nesses, which is repeated below (and not that important).
What about this?
* an *endian-ness*, which doesn't have to be specified at all in
most cases (because the default ``'FILE'`` should do fine).
Maybe the thing in parentheses is not even necessary.
BTW, we should mention default_subtype() in the "Parameters" section!
|
I added a few commits as discussed. |
The current path is needed for the mock modules. The parent path is needed to actually enable the "show source" option on readthedocs.org (everything else works fine without it ...).
The arguments which are forwarded to the SoundFile constructor, are moved to the back (because they are very seldomly used). See also #78.
Those seem to be not available on http://readthedocs.org/.
|
OK, I think I'm done for now ... |
|
I just saw that in This sounds totally reasonable to me. The problem is, in libsndfile this is actually always optional, even for |
|
This is absolutely terrific! I love the new documentation! Regarding endian-ness: I don't know. Presumably, RAW files would use the machine convention if no endian-ness is given. |
|
I'm also quite content with the new docs! The RAW-thing is a bit strange, but I think it's best if we leave our current description, because users should actually specify an endian-ness for RAW files, even if they don't have to according to libsndfile. Is there anything I should change or are we merge-ready? |
|
BTW, when merging, we'll have to change the documentation of Instead of returning
Should be changed to:
I don't think we have to explicitly mention the exception. |
|
Let's merge! |
Pull Request #74. Conflicts: README.md pysoundfile.py tests/test_pysoundfile.py