-
Notifications
You must be signed in to change notification settings - Fork 76
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
KeyError: "Unknown key: 'ar_order'." #7
Comments
Thanks for submitting the issue! I already fixed this malfunction and it will be available int he next pyHRV available which I am planning to release over the next couple of days. |
Hello Pedro, thank you for your work! When do you plan to release this new fix? |
Hi Thiago, thanks for the positive feedback, I am glad to hear that pyHRV has left a good impression! Unfortunately, I am a bit behind my planned scheduled update for pyHRV but I am trying to get the new update with a lot of new features and bug fixes (incl. this one) over the next week. |
Hi Pedro! first of all thank you for your great work. Unfortunately I have been getting the same error as in this issue. Can you please tell me when you will be able to fix this? Thanks again |
For those who interested in a quick and dirty fix: replace the line 906 of frequency_domain.py with something like: |
- See changelog for all changes: https://github.com/PGomes92/pyhrv/blob/master/changelog.md - Fixes #6 #7 #9
Closed with update v.0.4.0 |
Thanks for your great work. I got the following error, running
results = pyhrv.hrv(nni=nni_base) on Python3.7
Would you please help me.
KeyError Traceback (most recent call last)
in
----> 1 results = pyhrv.hrv(nni=nni_base)
~/venv/lib/python3.7/site-packages/pyhrv/hrv.py in hrv(nni, rpeaks, signal, sampling_rate, interval, plot_ecg, plot_tachogram, show, fbands, kwargs_ecg_plot, kwargs_tachogram, kwargs_time, kwargs_nonlinear, kwargs_welch, kwargs_lomb, kwargs_ar)
284 # COMPUTE FREQUENCY DOMAIN RESULTS (kwargs are verified by the frequency_domain() function)
285 f_results = fd.frequency_domain(nni=nn, fbands=fbands, kwargs_welch=kwargs_welch, kwargs_lomb=kwargs_lomb,
--> 286 kwargs_ar=kwargs_ar, show=False)
287
288 # COMPUTE NONLINEAR PARAMETERS
~/venv/lib/python3.7/site-packages/pyhrv/frequency_domain.py in frequency_domain(nni, rpeaks, signal, sampling_rate, fbands, show, show_param, legend, kwargs_welch, kwargs_lomb, kwargs_ar)
1125 else:
1126 # Compute Autoregressive PSD with default values
-> 1127 ar_results = ar_psd(nn, show=False, fbands=fbands, legend=legend, show_param=show_param)
1128
1129 # If plots should be shown (show all plots at once)
~/venv/lib/python3.7/site-packages/pyhrv/frequency_domain.py in ar_psd(nni, rpeaks, fbands, nfft, order, show, show_param, legend, mode)
497
498 # Plot PSD
--> 499 figure = _plot_psd('ar', frequencies, powers, freq_i, params, show, show_param, legend)
500 figure = utils.ReturnTuple((figure, ), ('ar_plot', ))
501
~/venv/lib/python3.7/site-packages/pyhrv/frequency_domain.py in _plot_psd(method, freq, power, freq_indices, parameters, show, show_param, legend)
904 ax.set_title("PSD - Welch's Method")
905 elif method == 'ar':
--> 906 ax.set_title("PSD - Autoregressive (Order %i)" % parameters['ar_order'])
907 elif method == 'lomb':
908 ax.set_title("PSD - Lomb-Scargle Periodogram")
~/venv/lib/python3.7/site-packages/biosppy/utils.py in getitem(self, key)
405 if isinstance(key, six.string_types):
406 if key not in self._names:
--> 407 raise KeyError("Unknown key: %r." % key)
408
409 key = self._names.index(key)
KeyError: "Unknown key: 'ar_order'."
The text was updated successfully, but these errors were encountered: