-
Notifications
You must be signed in to change notification settings - Fork 106
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
Re-order functions in pysoundfile.py #57
Comments
BTW, the module docstring should move to the very top of the file. |
I think that the order of things in pysoundfile.py should be the order in which the file reads best. The biggest issue with that are the CFFI declarations at the start of the file (the long string and the dictionaries). We could move those into their own file and import them from there. After that, However, This would leave the main file pretty empty. But maybe that is not such a bad thing. Any thoughts about this? |
I'm not sure if splitting The CFFI declarations are indeed annoying, but I'm hoping that some time in the future it will be possible to load a separate header file instead of copying the code. Then our code should become much cleaner.
I'm not sure about that. I stumbled upon a source file for CPython's Sure, a single example isn't quite representative, but probably we'll find more examples. But anyway, the order of the Sphinx documentation is much more important than the order in the source file(s). |
Ordering functions before classes is fine by me. I'll experiment with splitting pysoundfile into several files a bit. We'll see how it feels. |
The order was changed in #74. Currently, I don't see a need for splitting the code into several modules. I vote for closing this issue. |
I agree. |
I think it's better if the high-level functions are listed earlier in the source file (and therefore in the Sphinx documentation, see also #27).
I think the
read()
function should be the very first, followed by thewrite()
function.Then probably
available_formats()
,available_subtypes()
,default_subtype()
andformat_check()
.After that, probably the
blocks()
function.I guess it makes sense to put all the underscore-prefixed functions right after that.
Or should we put them immediately before or after the function they are used in?
I would move the class definition of
Soundfile
to the very end.Within the class we should probably also move some methods around, but I'm not sure what's the best strategy there.
We should do this before re-writing the docstrings in NumPy style (#27), but probably after setting up Sphinx.
The text was updated successfully, but these errors were encountered: