Skip to content

Update bispectra feature #365

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

Merged
merged 2 commits into from
Oct 4, 2024
Merged

Conversation

tsbinns
Copy link
Member

@tsbinns tsbinns commented Oct 2, 2024

Reduces some jankiness with the bispectra feature now that PyBispectra v1.2 is available (was already pinned in #355).

# PyBispectra's compute_fft uses PQDM to parallelize the calculation per channel
# Is this necessary? Maybe the overhead of parallelization is not worth it
# considering that we incur in it once per batch of data
fft_coeffs, freqs = compute_fft(
Copy link
Member Author

Choose a reason for hiding this comment

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

I switched away from pqdm, so this comment is no longer true.

@@ -127,12 +124,11 @@ def calc_feature(self, data: np.ndarray) -> dict:
f1s=tuple(self.settings.f1s), # type: ignore
f2s=tuple(self.settings.f2s), # type: ignore
)
waveshape = waveshape.results.get_results(copy=False) # can overwrite obj with array
Copy link
Member Author

Choose a reason for hiding this comment

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

This is a less hacky way of extracting the bispectral info while avoiding a copy, without relying on private attrs.

@timonmerk timonmerk merged commit 6fc5f95 into neuromodulation:main Oct 4, 2024
6 checks passed
@timonmerk
Copy link
Contributor

Many thanks for the contribution @tsbinns!

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

Successfully merging this pull request may close these issues.

2 participants