-
Notifications
You must be signed in to change notification settings - Fork 92
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
[Enh] add example and handle one-dimensional arrays in CSD.generate lfp #594
[Enh] add example and handle one-dimensional arrays in CSD.generate lfp #594
Conversation
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.
build wheels
Co-authored-by: Alexander Kleinjohann <[email protected]>
Co-authored-by: Alexander Kleinjohann <[email protected]>
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.
Looks good to me, just added two comments on minor details.
@@ -253,10 +253,31 @@ def generate_lfp(csd_profile, x_positions, y_positions=None, z_positions=None, | |||
|
|||
Returns | |||
------- | |||
LFP : neo.AnalogSignal | |||
LFP : :class:`neo.core.AnalogSignal` |
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.
This change should also apply in line 74, right?
lfp : neo.AnalogSignal |
(Can't directly suggest the change here, because it's too far from any lines changed in this PR.
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.
Indeed, thanks for catching this, changed accordingly.
elephant/current_source_density.py
Outdated
@@ -227,7 +227,7 @@ def generate_lfp(csd_profile, x_positions, y_positions=None, z_positions=None, | |||
1D : gauss_1d_dipole | |||
2D : large_source_2D and small_source_2D | |||
3D : gauss_3d_dipole | |||
x_positions : np.ndarray | |||
x_positions : np.ndarray # TODO: add dimensionality for x-y-z_positions |
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.
I assume this TODO should be addressed in another future PR and not here?
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.
Thank you for the reminder, I should have made this TODO more explicit.
One might consider to further discuss the expected input shape in a future PR or Issue (?)
I've now (fe7f9ec) updated the docstring to explicitly specify the expected shape of the inputs as a 2D column vector with dimensions 'N x 1 array.' In the example mentioned in the issue, an error occurred because a flat array (1D) was passed as input.
For now, documenting the expected input is a reasonable solution ?
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.
Yup, sounds good!
913a998
into
NeuralEnsemble:master
This PR closes #546 .
Changes
x_positions