supriya-project / supriya

A Python API for SuperCollider
http://supriya-project.github.io/supriya
MIT License
250 stars 28 forks source link

Implement all UGens. #5

Closed josiah-wolf-oberholtzer closed 3 years ago

josiah-wolf-oberholtzer commented 10 years ago

Remaining UGens to implement:

kureta commented 8 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.

josiah-wolf-oberholtzer commented 8 years ago

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:

kureta commented 8 years ago

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?

josiah-wolf-oberholtzer commented 8 years ago

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?

kureta commented 8 years ago

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.
kureta commented 8 years ago

It just ignores the .ajv file at the project root (I guess)

josiah-wolf-oberholtzer commented 8 years ago

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.

josiah-wolf-oberholtzer commented 8 years ago

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.

kureta commented 8 years ago

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.

kureta commented 8 years ago

I have finished 5 more UGens, should I create a different PR for each of them?

josiah-wolf-oberholtzer commented 8 years ago

@kureta Let's try a single PR.

kureta commented 8 years ago

By the way, what would you think about PEP8ifying your code? Adding newline to the end of files, using """ instead of ''' for docstrings

josiah-wolf-oberholtzer commented 8 years ago

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.

kureta commented 8 years ago

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.

josiah-wolf-oberholtzer commented 8 years ago

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
kureta commented 8 years ago

OK. I have added those too. We should be on the same page now.