Closed josiah-wolf-oberholtzer closed 3 years ago
I am new to actual collaboration and Pull Requests in Github. So I sent you this: #37 I hope this is the correct way to do so.
Like I commented in your PR, you can find class stubs in pendingugentools
. They're usually almost totally done. There are some steps you'll need to take to make them perfect:
pendingugentools
into ugentools
.ajv doctest MyUgenName.py
to verify that the docstrings are correct.If I run ajv doctest supriya/tools/ugentools/SyncSaw.py
at project root or ajv doctest SyncSaw.py
in supriya/tools/ugentools/
directory, the command fails with NameError: name 'ugentools' is not defined
if I run ajv doctest SyncSaw.py
at project root, unsuprisingly, it says 0 passed, 0 failed out of 0 tests in 0 modules
as it cannot find the file. I guess it ignores .ajv file. I am not familiar with abjad or ajv, so what am I missing?
ajv
is a set of tools that I built to help develop Abjad and Supriya (and other projects using them). Running ajv doctest
from within ugentools
was the correct action. Can you do that again and include the entire output of the script?
Here:
SyncSaw.py FAILED
**********************************************************************
File "SyncSaw.py", line 10, in SyncSaw.py
Failed example:
sync_saw = ugentools.SyncSaw.ar(
saw_frequency=440,
sync_frequency=440,
)
Exception raised:
Traceback (most recent call last):
File "/usr/local/Cellar/python3/3.5.2_3/Frameworks/Python.framework/Versions/3.5/lib/python3.5/doctest.py", line 1321, in __run
compileflags, 1), test.globs)
File "<doctest SyncSaw.py[0]>", line 1, in <module>
sync_saw = ugentools.SyncSaw.ar(
NameError: name 'ugentools' is not defined
**********************************************************************
File "SyncSaw.py", line 14, in SyncSaw.py
Failed example:
sync_saw
Exception raised:
Traceback (most recent call last):
File "/usr/local/Cellar/python3/3.5.2_3/Frameworks/Python.framework/Versions/3.5/lib/python3.5/doctest.py", line 1321, in __run
compileflags, 1), test.globs)
File "<doctest SyncSaw.py[1]>", line 1, in <module>
sync_saw
NameError: name 'sync_saw' is not defined
**********************************************************************
File "SyncSaw.py", line 59, in SyncSaw.py
Failed example:
sync_saw = ugentools.SyncSaw.ar(
saw_frequency=440,
sync_frequency=440,
)
Exception raised:
Traceback (most recent call last):
File "/usr/local/Cellar/python3/3.5.2_3/Frameworks/Python.framework/Versions/3.5/lib/python3.5/doctest.py", line 1321, in __run
compileflags, 1), test.globs)
File "<doctest SyncSaw.py[2]>", line 1, in <module>
sync_saw = ugentools.SyncSaw.ar(
NameError: name 'ugentools' is not defined
**********************************************************************
File "SyncSaw.py", line 63, in SyncSaw.py
Failed example:
sync_saw
Exception raised:
Traceback (most recent call last):
File "/usr/local/Cellar/python3/3.5.2_3/Frameworks/Python.framework/Versions/3.5/lib/python3.5/doctest.py", line 1321, in __run
compileflags, 1), test.globs)
File "<doctest SyncSaw.py[3]>", line 1, in <module>
sync_saw
NameError: name 'sync_saw' is not defined
**********************************************************************
File "SyncSaw.py", line 87, in SyncSaw.py
Failed example:
sync_saw = ugentools.SyncSaw.kr(
saw_frequency=440,
sync_frequency=440,
)
Exception raised:
Traceback (most recent call last):
File "/usr/local/Cellar/python3/3.5.2_3/Frameworks/Python.framework/Versions/3.5/lib/python3.5/doctest.py", line 1321, in __run
compileflags, 1), test.globs)
File "<doctest SyncSaw.py[4]>", line 1, in <module>
sync_saw = ugentools.SyncSaw.kr(
NameError: name 'ugentools' is not defined
**********************************************************************
File "SyncSaw.py", line 91, in SyncSaw.py
Failed example:
sync_saw
Exception raised:
Traceback (most recent call last):
File "/usr/local/Cellar/python3/3.5.2_3/Frameworks/Python.framework/Versions/3.5/lib/python3.5/doctest.py", line 1321, in __run
compileflags, 1), test.globs)
File "<doctest SyncSaw.py[5]>", line 1, in <module>
sync_saw
NameError: name 'sync_saw' is not defined
**********************************************************************
File "SyncSaw.py", line 113, in SyncSaw.py
Failed example:
sync_saw = ugentools.SyncSaw.ar(
saw_frequency=440,
sync_frequency=440,
)
Exception raised:
Traceback (most recent call last):
File "/usr/local/Cellar/python3/3.5.2_3/Frameworks/Python.framework/Versions/3.5/lib/python3.5/doctest.py", line 1321, in __run
compileflags, 1), test.globs)
File "<doctest SyncSaw.py[6]>", line 1, in <module>
sync_saw = ugentools.SyncSaw.ar(
NameError: name 'ugentools' is not defined
**********************************************************************
File "SyncSaw.py", line 117, in SyncSaw.py
Failed example:
sync_saw.saw_frequency
Exception raised:
Traceback (most recent call last):
File "/usr/local/Cellar/python3/3.5.2_3/Frameworks/Python.framework/Versions/3.5/lib/python3.5/doctest.py", line 1321, in __run
compileflags, 1), test.globs)
File "<doctest SyncSaw.py[7]>", line 1, in <module>
sync_saw.saw_frequency
NameError: name 'sync_saw' is not defined
**********************************************************************
File "SyncSaw.py", line 131, in SyncSaw.py
Failed example:
sync_saw = ugentools.SyncSaw.ar(
saw_frequency=440,
sync_frequency=440,
)
Exception raised:
Traceback (most recent call last):
File "/usr/local/Cellar/python3/3.5.2_3/Frameworks/Python.framework/Versions/3.5/lib/python3.5/doctest.py", line 1321, in __run
compileflags, 1), test.globs)
File "<doctest SyncSaw.py[8]>", line 1, in <module>
sync_saw = ugentools.SyncSaw.ar(
NameError: name 'ugentools' is not defined
**********************************************************************
File "SyncSaw.py", line 135, in SyncSaw.py
Failed example:
sync_saw.sync_frequency
Exception raised:
Traceback (most recent call last):
File "/usr/local/Cellar/python3/3.5.2_3/Frameworks/Python.framework/Versions/3.5/lib/python3.5/doctest.py", line 1321, in __run
compileflags, 1), test.globs)
File "<doctest SyncSaw.py[9]>", line 1, in <module>
sync_saw.sync_frequency
NameError: name 'sync_saw' is not defined
**********************************************************************
1 items had failures:
10 of 10 in SyncSaw.py
***Test Failed*** 10 failures.
FAILED: SyncSaw.py
0 passed, 10 failed out of 10 tests in 1 module.
It just ignores the .ajv file at the project root (I guess)
Did you both download and install Abjad from source? Make sure you pulled the latest version. The changes that look for .ajv
files are very recent.
Also, sorry if this is a bit confusing right now. This project is undergoing a lot of changes, and I wasn't really prepared for contributors yet.
I installed the git version but I guess I already had pip version installed so that messed things up. I reinstalled it and everything's fine. So now my tests pass.
I have finished 5 more UGens, should I create a different PR for each of them?
@kureta Let's try a single PR.
By the way, what would you think about PEP8ifying your code? Adding newline to the end of files, using """ instead of ''' for docstrings
Yes! Please add newlines to the ends of the files.
For docstrings, I also agree. I have an issue open to change all docstrings like this:
def foo():
'''blah blah blah.
'''
... into docstrings like this:
def foo():
"""
blah blah blah.
"""
See #34.
I'm using PyCharm and it complains about a few more issues regarding PEP8, such as continuation lines being the same level as logical lines, which is apparently a controversial issue. I will just apply all PEP8 fixes recommended by PyCharm and push it. See if there is anything you don't like about it, due to personal style/preference.
I would leave continuation lines alone, mainly. I'm happy with the general indentation style here, and too much of that will result in code churn.
FYI, I'm ignoring the following errors in my syntax checker (flake8):
ignore = E123,E125,E128,E129,E131,E265,E266,E501,E241
OK. I have added those too. We should be on the same page now.
Remaining UGens to implement: