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

[Feature]Verbose option #49

Closed
jpalma-espinosa opened this issue Jul 8, 2020 · 5 comments · Fixed by #51
Closed

[Feature]Verbose option #49

jpalma-espinosa opened this issue Jul 8, 2020 · 5 comments · Fixed by #51
Assignees
Milestone

Comments

@jpalma-espinosa
Copy link

Dear all,
Thank you for your incredible work.

I am giving a try with your software, analyzing some neural recordings that I have.
Because of computational power, I am running my code through Google's Colaboratory. However, since this tool has a fixed time for running, it should really help a verbose option when running

tsfel.time_series_features_extractor(cfg,data)

as it may help to calculate the amount of time that certain feature calculation should take

@dmfolgado dmfolgado self-assigned this Jul 8, 2020
@dmfolgado
Copy link
Member

Hi! Thanks a lot for your feedback!
May I ask you what version of TSFEL are you using? The latest version of TSFEL released last week (v0.1.3) has a progress bar to show the status of the feature extraction process. The progress bar should work when running TSFEL on Colab also.

@jpalma-espinosa
Copy link
Author

Dear @dmfolgado ,
Sorry for the delay in my answer.

When I first posted, about 12 hours ago, I was using the last released version, which is on the master's branch.

Right now, I am following a suggestion made by @mbarandas , so I am using a dev version. In particular

%pip install https://github.com/fraunhoferportugal/tsfel/archive/v0.1.4-dev.zip#egg=tsfel
Collecting tsfel
  Downloading https://github.com/fraunhoferportugal/tsfel/archive/v0.1.4-dev.zip
     / 2.0MB 577kB/s
Requirement already satisfied: Sphinx>=1.8.5 in /usr/local/lib/python3.6/dist-packages (from tsfel) (1.8.5)
Collecting gspread>=3.1.0
  Downloading https://files.pythonhosted.org/packages/9c/ba/bc8de4f5077bd34bc873bdd67a89cb29c4f181abba8a836d2c6a0a142365/gspread-3.6.0-py3-none-any.whl
Collecting ipython>=7.4.0
  Downloading https://files.pythonhosted.org/packages/23/6a/210816c943c9aeeb29e4e18a298f14bf0e118fe222a23e13bfcc2d41b0a4/ipython-7.16.1-py3-none-any.whl (785kB)
     |████████████████████████████████| 788kB 4.0MB/s 
Requirement already satisfied: numpy>=1.18.5 in /usr/local/lib/python3.6/dist-packages (from tsfel) (1.18.5)
Requirement already satisfied: oauth2client>=4.1.3 in /usr/local/lib/python3.6/dist-packages (from tsfel) (4.1.3)
Requirement already satisfied: pandas>=0.25.3 in /usr/local/lib/python3.6/dist-packages (from tsfel) (1.0.5)
Requirement already satisfied: scipy>=1.4.1 in /usr/local/lib/python3.6/dist-packages (from tsfel) (1.4.1)
Requirement already satisfied: setuptools>=47.1.1 in /usr/local/lib/python3.6/dist-packages (from tsfel) (47.3.1)
Requirement already satisfied: babel!=2.0,>=1.3 in /usr/local/lib/python3.6/dist-packages (from Sphinx>=1.8.5->tsfel) (2.8.0)
Requirement already satisfied: Jinja2>=2.3 in /usr/local/lib/python3.6/dist-packages (from Sphinx>=1.8.5->tsfel) (2.11.2)
Requirement already satisfied: packaging in /usr/local/lib/python3.6/dist-packages (from Sphinx>=1.8.5->tsfel) (20.4)
Requirement already satisfied: alabaster<0.8,>=0.7 in /usr/local/lib/python3.6/dist-packages (from Sphinx>=1.8.5->tsfel) (0.7.12)
Requirement already satisfied: sphinxcontrib-websupport in /usr/local/lib/python3.6/dist-packages (from Sphinx>=1.8.5->tsfel) (1.2.2)
Requirement already satisfied: imagesize in /usr/local/lib/python3.6/dist-packages (from Sphinx>=1.8.5->tsfel) (1.2.0)
Requirement already satisfied: requests>=2.0.0 in /usr/local/lib/python3.6/dist-packages (from Sphinx>=1.8.5->tsfel) (2.23.0)
Requirement already satisfied: snowballstemmer>=1.1 in /usr/local/lib/python3.6/dist-packages (from Sphinx>=1.8.5->tsfel) (2.0.0)
Requirement already satisfied: Pygments>=2.0 in /usr/local/lib/python3.6/dist-packages (from Sphinx>=1.8.5->tsfel) (2.1.3)
Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.6/dist-packages (from Sphinx>=1.8.5->tsfel) (1.12.0)
Requirement already satisfied: docutils>=0.11 in /usr/local/lib/python3.6/dist-packages (from Sphinx>=1.8.5->tsfel) (0.15.2)
Requirement already satisfied: google-auth>=1.12.0 in /usr/local/lib/python3.6/dist-packages (from gspread>=3.1.0->tsfel) (1.17.2)
Requirement already satisfied: google-auth-oauthlib>=0.4.1 in /usr/local/lib/python3.6/dist-packages (from gspread>=3.1.0->tsfel) (0.4.1)
Requirement already satisfied: traitlets>=4.2 in /usr/local/lib/python3.6/dist-packages (from ipython>=7.4.0->tsfel) (4.3.3)
Requirement already satisfied: decorator in /usr/local/lib/python3.6/dist-packages (from ipython>=7.4.0->tsfel) (4.4.2)
Requirement already satisfied: jedi>=0.10 in /usr/local/lib/python3.6/dist-packages (from ipython>=7.4.0->tsfel) (0.17.1)
Requirement already satisfied: pickleshare in /usr/local/lib/python3.6/dist-packages (from ipython>=7.4.0->tsfel) (0.7.5)
Requirement already satisfied: pexpect; sys_platform != "win32" in /usr/local/lib/python3.6/dist-packages (from ipython>=7.4.0->tsfel) (4.8.0)
Requirement already satisfied: backcall in /usr/local/lib/python3.6/dist-packages (from ipython>=7.4.0->tsfel) (0.2.0)
Collecting prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0
  Downloading https://files.pythonhosted.org/packages/e4/a7/81b39aa50e9284fe2cb21cc7fb7de7817b224172d42793fd57451d38842b/prompt_toolkit-3.0.5-py3-none-any.whl (351kB)
     |████████████████████████████████| 358kB 15.5MB/s 
Requirement already satisfied: rsa>=3.1.4 in /usr/local/lib/python3.6/dist-packages (from oauth2client>=4.1.3->tsfel) (4.6)
Requirement already satisfied: httplib2>=0.9.1 in /usr/local/lib/python3.6/dist-packages (from oauth2client>=4.1.3->tsfel) (0.17.4)
Requirement already satisfied: pyasn1>=0.1.7 in /usr/local/lib/python3.6/dist-packages (from oauth2client>=4.1.3->tsfel) (0.4.8)
Requirement already satisfied: pyasn1-modules>=0.0.5 in /usr/local/lib/python3.6/dist-packages (from oauth2client>=4.1.3->tsfel) (0.2.8)
Requirement already satisfied: pytz>=2017.2 in /usr/local/lib/python3.6/dist-packages (from pandas>=0.25.3->tsfel) (2018.9)
Requirement already satisfied: python-dateutil>=2.6.1 in /usr/local/lib/python3.6/dist-packages (from pandas>=0.25.3->tsfel) (2.8.1)
Requirement already satisfied: MarkupSafe>=0.23 in /usr/local/lib/python3.6/dist-packages (from Jinja2>=2.3->Sphinx>=1.8.5->tsfel) (1.1.1)
Requirement already satisfied: pyparsing>=2.0.2 in /usr/local/lib/python3.6/dist-packages (from packaging->Sphinx>=1.8.5->tsfel) (2.4.7)
Requirement already satisfied: chardet<4,>=3.0.2 in /usr/local/lib/python3.6/dist-packages (from requests>=2.0.0->Sphinx>=1.8.5->tsfel) (3.0.4)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.6/dist-packages (from requests>=2.0.0->Sphinx>=1.8.5->tsfel) (2020.6.20)
Requirement already satisfied: idna<3,>=2.5 in /usr/local/lib/python3.6/dist-packages (from requests>=2.0.0->Sphinx>=1.8.5->tsfel) (2.9)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /usr/local/lib/python3.6/dist-packages (from requests>=2.0.0->Sphinx>=1.8.5->tsfel) (1.24.3)
Requirement already satisfied: cachetools<5.0,>=2.0.0 in /usr/local/lib/python3.6/dist-packages (from google-auth>=1.12.0->gspread>=3.1.0->tsfel) (4.1.0)
Requirement already satisfied: requests-oauthlib>=0.7.0 in /usr/local/lib/python3.6/dist-packages (from google-auth-oauthlib>=0.4.1->gspread>=3.1.0->tsfel) (1.3.0)
Requirement already satisfied: ipython-genutils in /usr/local/lib/python3.6/dist-packages (from traitlets>=4.2->ipython>=7.4.0->tsfel) (0.2.0)
Requirement already satisfied: parso<0.8.0,>=0.7.0 in /usr/local/lib/python3.6/dist-packages (from jedi>=0.10->ipython>=7.4.0->tsfel) (0.7.0)
Requirement already satisfied: ptyprocess>=0.5 in /usr/local/lib/python3.6/dist-packages (from pexpect; sys_platform != "win32"->ipython>=7.4.0->tsfel) (0.6.0)
Requirement already satisfied: wcwidth in /usr/local/lib/python3.6/dist-packages (from prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0->ipython>=7.4.0->tsfel) (0.2.5)
Requirement already satisfied: oauthlib>=3.0.0 in /usr/local/lib/python3.6/dist-packages (from requests-oauthlib>=0.7.0->google-auth-oauthlib>=0.4.1->gspread>=3.1.0->tsfel) (3.1.0)
Building wheels for collected packages: tsfel
  Building wheel for tsfel (setup.py) ... done
  Created wheel for tsfel: filename=tsfel-0.1.4-cp36-none-any.whl size=45431 sha256=05c2d6beb972bf73bcb23328bd0a371f9c068345220f6a6916a3d1f7e340695c
  Stored in directory: /root/.cache/pip/wheels/93/9c/47/8df02b8e0df9fdf00d2fc7079f201fa7468d2daab831a2d657
Successfully built tsfel
ERROR: jupyter-console 5.2.0 has requirement prompt-toolkit<2.0.0,>=1.0.0, but you'll have prompt-toolkit 3.0.5 which is incompatible.
ERROR: google-colab 1.0.0 has requirement ipython~=5.5.0, but you'll have ipython 7.16.1 which is incompatible.
Installing collected packages: gspread, prompt-toolkit, ipython, tsfel
  Found existing installation: gspread 3.0.1
    Uninstalling gspread-3.0.1:
      Successfully uninstalled gspread-3.0.1
  Found existing installation: prompt-toolkit 1.0.18
    Uninstalling prompt-toolkit-1.0.18:
      Successfully uninstalled prompt-toolkit-1.0.18
  Found existing installation: ipython 5.5.0
    Uninstalling ipython-5.5.0:
      Successfully uninstalled ipython-5.5.0
Successfully installed gspread-3.6.0 ipython-7.16.1 prompt-toolkit-3.0.5 tsfel-0.1.4
WARNING: Upgrading ipython, ipykernel, tornado, prompt-toolkit or pyzmq can
cause your runtime to repeatedly crash or behave in unexpected ways and is not
recommended. If your runtime won't connect or execute code, you can reset it
with "Factory reset runtime" from the "Runtime" menu.
WARNING: The following packages were previously imported in this runtime:
  [IPython,prompt_toolkit]
You must restart the runtime in order to use newly installed versions.

I did restarted the runtime and did

#TSFEL 
cfg = tsfel.get_features_by_domain(domain='spectral') #26 features with spectral
X = tsfel.time_series_features_extractor(cfg, data['amplifier_data'][0],fs=Fs)

But no progress bar is observed.
Captura de Pantalla 2020-07-08 a la(s) 16 39 10

@dmfolgado
Copy link
Member

Hi! It seems that the progress bar is not being displayed when the user does not need the signal to be divided into windows before feature extraction. According to the code you provided I do believe it is your case. We'll correct that an upcoming release.
In the meantime you can try a "workaround" by using this (note the input variable is between the brackets):

X = tsfel.time_series_features_extractor(cfg, [data['amplifier_data'][0]],fs=Fs)

Let me know if it did help. During the next week, we'll try to sort out the issue completely.

@jpalma-espinosa
Copy link
Author

Sorry for the delay in my responnse.
I followed your suggestion and now I can see the progress bar.
Thank you =)

@dmfolgado
Copy link
Member

I'm glad it sorted out. This issue will be fixed on the upcoming release.

@dmfolgado dmfolgado added this to the v0.1.4 milestone Jul 23, 2020
@dmfolgado dmfolgado linked a pull request Oct 5, 2020 that will close this issue
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 a pull request may close this issue.

2 participants