question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use a `float` default value for `fmin`-param in `mne.time_frequency.psd_array_multitaper`

See original GitHub issue

Hello,

Static type checkers infers the expected type of the fmin-param for the mne.time_frequency.psd_array_multitaper-function to be of type int since the default value used is an int.

The docstring clearly states that psd_array_multitaper supports fmin-values of type float.

Can we change the default-value of fmin to 0.0 to avoid errors in static type checkers?

image

https://github.com/mne-tools/mne-python/blob/091da8f01aeeecd7d583ba596cf5a85cd649f192/mne/time_frequency/multitaper.py#L365

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:18 (17 by maintainers)

github_iconTop GitHub Comments

1reaction
cbrnrcommented, Mar 31, 2022

I didn’t think they were hostile, no problem @hoechenberger! Yes, I think it’s best to discuss this IRL!

0reactions
sondrfoscommented, Mar 31, 2022

I also tend to write 0. or 0.0 to make my code explicit that float is expected.

+0.5 on fixing this one with a small PR.

@sondrfos would you have time to do this,

regarding type annotations everywhere in MNE let’s discuss this over a drink to cool down the conversation 😉

I can definitely try 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

mne.time_frequency.psd_array_multitaper
Compute power spectral density (PSD) using a multi-taper method. The power spectral density is computed with DPSS tapers[1]. Parameters: x ...
Read more >
mne.time_frequency.psd_multitaper
The default value is a window half-bandwidth of 4. adaptive : bool. Use adaptive weights to combine the tapered spectra into PSD (slow,...
Read more >
Default parameters - JavaScript - MDN Web Docs
Default function parameters allow named parameters to be initialized with default values if no value or undefined is passed.
Read more >
C++ Using default values for parameters - Stack Overflow
1 Answer 1 · This is the prototype void AddBenchNode(osg::ref_ptr<osg::Group>,osg::ref_ptr<osg::Node>, bool, float, float, float, int, int, int );.
Read more >
Adding modifiable inputs to plugin functions which have ...
I'm trying to add some user-modifiable parameters to my function. For example, we have a default threshold for filtering OTUs (e.g. an OTU ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found