-
Notifications
You must be signed in to change notification settings - Fork 20
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
add ESA driving functions docstring examples for monopoles #115
base: master
Are you sure you want to change the base?
Conversation
23368d8
to
1b26997
Compare
I didn't check all cases, but sfs-python/sfs/mono/drivingfunction.py Line 1199 in 552c306
|
The reason for the first problem is that There are numerous issues about that, e.g.:
I see two options: import math
Nc = math.ceil(2 * k * max(r) * alpha/np.pi) or Nc = np.ceil(2 * k * np.max(r) * alpha/np.pi).astype(int) |
Regarding NaN values, I don't think we should convert them to zero, right? Since now the ESA driving functions are in their own module, it's no problem to choose a different |
Yeah, that would be inappropriate. We rather should check what precisely happens. I have it on my list.
Yeah, that's nice about the new handling. I will cover this as well ASAP. |
I'd vote for the second one, then we give a more clearer hint, that something is happening and we explicitly take care of it. The first solution is blurry, because it might only raise wondering why the coders did not use np.ceil...which is good, but we don't tell then. |
I also like the second variant! |
in all ESA driving functions we need to check the handling at
if Nc is None: what type to return such that no error occurs
The returned Nc = double is not working with the subsequent
np.ones(Nc)
Furthermore for ease of documentation, i.e. same grid as all other examples, this nan-handling
plot(np.nan_to_num(d), selection, secondary_source)
helps to plot. NaN presumably occurs since grid and secondary source position coincide. Is there a more elegant way to avoid this. Anyway, I'd vote to change the grid for these examples.