-
Notifications
You must be signed in to change notification settings - Fork 125
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
Avoid deprecated sample_rate in our own code #231
base: master
Are you sure you want to change the base?
Avoid deprecated sample_rate in our own code #231
Conversation
* Keep the documentation inconsistent with the actual code on purpose: While the default value of `sample_frequency` is documented to be 256, it is `None`. That's because we need to make a difference between 256 as a default value and 256 as an explicit value. If `sample_frequency` is explicitly set to 256, we keep that value, as a matter of course. On the other hand, if it is `None`, which is the actual default value, we switch to the value of the deprecated `sample_rate`, the default value of which is 256. * Output a warning in case of conflicting values only.
* When setting channel headers, change occurrences of `sample_rate` to `sample_frequency`. * Output a warning in case of conflicting values only.
* Set default values for `sample_frequency`, not `sample_rate`! * Remove documentation of inexistent parameter.
I still get the same error when running the test. I hope I installed the branch correctly:
|
Not sure how to install a specific branch with @skjerns How do you think compatibility should be handled?
|
I think there is a confusion - in all cases, neither
I think we should only give this warning if the user explicitly sets That means:
I'll try something in a different branch |
Indeed, an EDF file contains:
Not sure I understand how it works out for several non-contiguous recordings. Any way, I will let you figure out an elegant solution, unless you want help/input on the subject. |
Fixes #198.
At least I think it should. Let's wait for feedback.
The idea is that we should be able to read files with
sample_rate
for backwards compatibility, but not write files withsample_rate
. Of course, this means that older versions of pyedflib won't be able to read files produced with newer versions of pyedeflib. Hence, I guess, the CI failure:An alternative would be to output warnings when reading files, only when the values of
sample_rate
andsample_frequency
are different.Thoughts?