Skip to content
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

Directivity example notebook is broken #32

Open
MitchellAcoustics opened this issue Oct 30, 2024 · 0 comments · May be fixed by #35
Open

Directivity example notebook is broken #32

MitchellAcoustics opened this issue Oct 30, 2024 · 0 comments · May be fixed by #35
Assignees
Labels
bug Something isn't working documentation Improvements or additions to documentation

Comments

@MitchellAcoustics
Copy link
Collaborator

MitchellAcoustics commented Oct 30, 2024

Looks like we have an issue with directivity.Directivity.using_spherical() not being passed the right args. This is not caught in the directivity tests.

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[2], [line 2](vscode-notebook-cell:?execution_count=2&line=2)
      [1](vscode-notebook-cell:?execution_count=2&line=1) d = Omni()
----> [2](vscode-notebook-cell:?execution_count=2&line=2) fig = d.plot()

File ~/Documents/GitHub/acoustic-toolbox/acoustic_toolbox/directivity.py:157, in Directivity.plot(***failed resolving arguments***)
    [155](https://file+.vscode-resource.vscode-cdn.net/Users/mitch/Documents/GitHub/acoustic-toolbox/examples/~/Documents/GitHub/acoustic-toolbox/acoustic_toolbox/directivity.py:155) # TODO: filename
    [156](https://file+.vscode-resource.vscode-cdn.net/Users/mitch/Documents/GitHub/acoustic-toolbox/examples/~/Documents/GitHub/acoustic-toolbox/acoustic_toolbox/directivity.py:156) del filename
--> [157](https://file+.vscode-resource.vscode-cdn.net/Users/mitch/Documents/GitHub/acoustic-toolbox/examples/~/Documents/GitHub/acoustic-toolbox/acoustic_toolbox/directivity.py:157) return plot(self, include_rotation)

File ~/Documents/GitHub/acoustic-toolbox/acoustic_toolbox/directivity.py:257, in plot(d, sphere)
    [252](https://file+.vscode-resource.vscode-cdn.net/Users/mitch/Documents/GitHub/acoustic-toolbox/examples/~/Documents/GitHub/acoustic-toolbox/acoustic_toolbox/directivity.py:252) theta, phi = np.meshgrid(
    [253](https://file+.vscode-resource.vscode-cdn.net/Users/mitch/Documents/GitHub/acoustic-toolbox/examples/~/Documents/GitHub/acoustic-toolbox/acoustic_toolbox/directivity.py:253)     np.linspace(0.0, np.pi, 50), np.linspace(0.0, +2.0 * np.pi, 50)
    [254](https://file+.vscode-resource.vscode-cdn.net/Users/mitch/Documents/GitHub/acoustic-toolbox/examples/~/Documents/GitHub/acoustic-toolbox/acoustic_toolbox/directivity.py:254) )
    [256](https://file+.vscode-resource.vscode-cdn.net/Users/mitch/Documents/GitHub/acoustic-toolbox/examples/~/Documents/GitHub/acoustic-toolbox/acoustic_toolbox/directivity.py:256) # Directivity strength. Real-valued. Can be positive and negative.
--> [257](https://file+.vscode-resource.vscode-cdn.net/Users/mitch/Documents/GitHub/acoustic-toolbox/examples/~/Documents/GitHub/acoustic-toolbox/acoustic_toolbox/directivity.py:257) dr = d.using_spherical(theta, phi)
    [259](https://file+.vscode-resource.vscode-cdn.net/Users/mitch/Documents/GitHub/acoustic-toolbox/examples/~/Documents/GitHub/acoustic-toolbox/acoustic_toolbox/directivity.py:259) if sphere:
    [260](https://file+.vscode-resource.vscode-cdn.net/Users/mitch/Documents/GitHub/acoustic-toolbox/examples/~/Documents/GitHub/acoustic-toolbox/acoustic_toolbox/directivity.py:260)     x, y, z = spherical_to_cartesian(1.0, theta, phi)

TypeError: Directivity.using_spherical() missing 1 required positional argument: 'phi'
@MitchellAcoustics MitchellAcoustics added bug Something isn't working documentation Improvements or additions to documentation labels Oct 30, 2024
@MitchellAcoustics MitchellAcoustics self-assigned this Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant