-
Notifications
You must be signed in to change notification settings - Fork 20
new mono drivingfunction handling #125
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
I would vote for the suggested changes! |
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.
Thanks, this looks really nice!
I would put the secondary source functions directly into the sfs.mono
namespace, i.e. define them in sfs/mono/__init__.py
, right next to sfs.mono.synthesize()
.
Looks like you didn't delete |
I wasn't aware of this before. I thought Do you put all stuff there that doesn't fit into another file? |
Well all non-module (and non-package) contents of a Python "package" (i.e. defined by a directory) has to come from
I think that's a matter of taste. Some people define their stuff right there, but others make separate submodules (often "hidden", like from ._stuff import * Neither of those methods are really nice, but that's how it is in Python ... I slightly prefer putting definitions directly into |
Just one random example for an |
0a05464
to
bcc8239
Compare
OK, wasn't completely aware of the |
With the new handling we could adapt the init source code within the docstring examples to the specific SFS approach, such as SDM gets a linear SSD and so on. |
@fs446 Yeah that's a good idea, but probably for a separate, later PR? |
I'm not a big friend of it either, but I'm sure we find an elegant place for it when the changes evolve. At the moment the handling for most user friendly API is good, I like the API very much now. We furthermore should think about the SFS categories as well: |
First of all, thank's a lot for the changes. I really like them.
For now, I'd also keep the current naming scheme. I have one suggestion, though. |
sfs/mono/__init__.py
Outdated
from . import esaedge | ||
from . import nfchoa | ||
from . import sdm | ||
from . import wfs |
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.
You could move those 4 import
statements to the very bottom of the file, to make clear that they are not needed in the code below.
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.
Ordering seems to make a difference
this works:
9a7b091
def below the imports not.
In Then you should be free to choose any ordering for the functions. I would not define |
Idea from @narahahn
is great. I've changed esaedge to esa in 7424338 |
I'd make a suggestion to improve readability and code structure w.r.t. our driving function handling.
Instead of current
d, selection, secondary_source = sfs.mono.drivingfunction.wfs_25d_point(omega, array.x, array.n, xs)
it changes to
d, selection, secondary_source = sfs.mono.wfs.point_25d(omega, array.x, array.n, xs)
and such like.
The introduced change splits the drivingfunction module into the specific SFS approaches, at the moment
wfs
,sdm
,esaedge
,nfchoa
.Meaningful for further progress could be the new modules
beamforming
andpanning
covering all aspects of farfield beams and pure gain / pure delay based SFS.I'm still figuring what the best handling for
def secondary_source_point(omega, c):
would be. At the moment they appear in every SFS-module. This should be solved consistently with the time domain as well.