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

Improve docstring of get_neuropixels_sample_shifts #3620

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

h-mayorquin
Copy link
Collaborator

I am working on improving the NWB annotation of this property and I took the time to improve the docstring of this function. I also added type hints.

@h-mayorquin h-mayorquin added the documentation Improvements or additions to documentation label Jan 14, 2025
@h-mayorquin h-mayorquin self-assigned this Jan 14, 2025
Copy link
Collaborator

@zm711 zm711 left a comment

Choose a reason for hiding this comment

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

One question and adding the ticks.

Neuropixels 2.0 probes have 16 cycles.
If None, the num_channels_per_adc is used.
If None, defaults to the value of num_channels_per_adc.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
If None, defaults to the value of num_channels_per_adc.
If None, defaults to the value of `num_channels_per_adc`.

:)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks, will change in the next commit.

@@ -42,10 +50,11 @@ def get_neuropixels_sample_shifts(num_channels=384, num_channels_per_adc=12, num
np.arange(num_channels), 2
)

sample_shifts = np.zeros_like(adc_indices)
sample_shifts = np.zeros_like(adc_indices, dtype=float)
Copy link
Collaborator

Choose a reason for hiding this comment

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

remind me the benefit of using python float in the case of numpy functions? This just auto scales the dtype between float32 and float64? Could this create float16 that could overflow? I honestly and super rusty on this stuff :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It is an alias that will auto scale depending on the OS if I remember well. But now that I think about it, I don't want to introduce a change on behavior on this PR so I am removing this. Thanks for the catch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants