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

[Enh] add example and handle one-dimensional arrays in CSD.generate lfp #594

Merged
merged 13 commits into from
Oct 24, 2023

Conversation

Moritz-Alexander-Kern
Copy link
Member

This PR closes #546 .

Changes

  • add example to doc-string
  • handle one-dimensional arrays as input for x_positions
  • add regression unit-tests

@coveralls
Copy link
Collaborator

coveralls commented Aug 30, 2023

Coverage Status

coverage: 86.644% (-0.3%) from 86.977% when pulling ee4501d on INM-6:enh/generate_lfp into 2bd871a on NeuralEnsemble:master.

@Moritz-Alexander-Kern Moritz-Alexander-Kern added documentation Indicates a need for improvements or additions to documentation bugfix Fix for an indentified bug. labels Aug 31, 2023
@Moritz-Alexander-Kern Moritz-Alexander-Kern added this to the v0.14.0 milestone Sep 18, 2023
Copy link
Member Author

@Moritz-Alexander-Kern Moritz-Alexander-Kern left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

build wheels

Copy link
Contributor

@Kleinjohann Kleinjohann left a 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`
Copy link
Contributor

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.

Copy link
Member Author

@Moritz-Alexander-Kern Moritz-Alexander-Kern Oct 20, 2023

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.

@@ -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
Copy link
Contributor

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?

Copy link
Member Author

@Moritz-Alexander-Kern Moritz-Alexander-Kern Oct 20, 2023

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 ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, sounds good!

@Moritz-Alexander-Kern Moritz-Alexander-Kern merged commit 913a998 into NeuralEnsemble:master Oct 24, 2023
12 of 13 checks passed
@Moritz-Alexander-Kern Moritz-Alexander-Kern deleted the enh/generate_lfp branch November 6, 2023 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Fix for an indentified bug. documentation Indicates a need for improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] Error in current_source_density.generate_lfp
4 participants