diff options
author | CoprDistGit <infra@openeuler.org> | 2023-05-30 17:09:45 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2023-05-30 17:09:45 +0000 |
commit | 6f9cca46f86c22481549f34f6ef56fe89834a15e (patch) | |
tree | 06f3dd9bfef22c0cd8ad8d4e72ec0c18df78c681 | |
parent | e9ee1e1a1dc40bded6b4139b760a50a8a1b40e74 (diff) |
automatic import of python-mne-qt-browser
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | python-mne-qt-browser.spec | 455 | ||||
-rw-r--r-- | sources | 1 |
3 files changed, 457 insertions, 0 deletions
@@ -0,0 +1 @@ +/mne-qt-browser-0.5.0.tar.gz diff --git a/python-mne-qt-browser.spec b/python-mne-qt-browser.spec new file mode 100644 index 0000000..11bf351 --- /dev/null +++ b/python-mne-qt-browser.spec @@ -0,0 +1,455 @@ +%global _empty_manifest_terminate_build 0 +Name: python-mne-qt-browser +Version: 0.5.0 +Release: 1 +Summary: A new backend based on pyqtgraph for the 2D-Data-Browser in MNE-Python +License: BSD 3-Clause License Copyright (c) 2021-2022, authors of mne-qt-browser All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +URL: https://pypi.org/project/mne-qt-browser/ +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/e1/3d/42ce16033389ca6843e476ac954039c3ad8a6ae8e6ba56062e69208f63dd/mne-qt-browser-0.5.0.tar.gz +BuildArch: noarch + +Requires: python3-packaging +Requires: python3-setuptools +Requires: python3-numpy +Requires: python3-scipy +Requires: python3-matplotlib +Requires: python3-qtpy +Requires: python3-scooby +Requires: python3-mne +Requires: python3-pyqtgraph +Requires: python3-colorspacious +Requires: python3-darkdetect +Requires: python3-qdarkstyle +Requires: python3-pyopengl +Requires: python3-importlib-metadata +Requires: python3-pyopengl +Requires: python3-pytest +Requires: python3-pytest-qt +Requires: python3-pytest-cov +Requires: python3-pytest-timeout +Requires: python3-scikit-learn +Requires: python3-pytest-harvest +Requires: python3-pytest-error-for-skips +Requires: python3-sphinx-gallery + +%description +# mne-qt-browser + +## A new backend based on pyqtgraph for the 2D-Data-Browser in MNE-Python. + + + +This repository hosts the code for an alternative backend for plotting 2D-Data with +[MNE-Python](https://github.com/mne-tools/mne-python). + +The backend is based on [pyqtgraph](https://github.com/pyqtgraph/pyqtgraph) +which uses Qt's [Graphics View Framework](https://doc.qt.io/qt-5/graphicsview.html) +for the plotting. +Development started as a [2021's Google Summer of Code Project](https://github.com/marsipu/gsoc2021). + +## Installation +Install **full MNE-Python version 1.0 or greater** with the instructions provided [here](https://mne.tools/stable/install/mne_python.html#d-plotting-and-source-analysis) or install **minimal MNE-Python** with +### pip +``` +pip install "mne>=1.0" matplotlib mne-qt-browser +``` +or +### conda +``` +conda install -c conda-forge mne-base matplotlib mne-qt-browser +``` + +## Usage + +The backend supports plotting for the following MNE-Python methods: + +- [`mne.io.Raw.plot()`](https://mne.tools/dev/generated/mne.io.Raw.html?highlight=raw%20plot#mne.io.Raw.plot) +- [`mne.Epochs.plot()`](https://mne.tools/dev/generated/mne.Epochs.html?highlight=epochs%20plot#mne.Epochs.plot) +- [`mne.preprocessing.ICA.plot_sources(raw)`](https://mne.tools/dev/generated/mne.preprocessing.ICA.html?highlight=ica%20plot_sources#mne.preprocessing.ICA.plot_sources) +- [`mne.preprocessing.ICA.plot_sources(epochs)`](https://mne.tools/dev/generated/mne.preprocessing.ICA.html?highlight=ica%20plot_sources#mne.preprocessing.ICA.plot_sources) + +In the following example, we'll read M/EEG raw data from the MNE `sample` dataset +and plot it using the `qt`-backend. +(For mne-version >= 1.0 the `qt`-backend will be the default) + +```python +from pathlib import Path +import mne + +sample_dir = mne.datasets.sample.data_path() +raw_path = Path(sample_dir) / 'MEG' / 'sample' / 'sample_audvis_raw.fif' +raw = mne.io.read_raw(raw_path) + +mne.viz.set_browser_backend('qt') # Enable mne-qt-browser backend if mne < 1.0 +raw.plot(block=True) +``` + +If the plot is not showing, search for solutions in the +[troubleshooting](#troubleshooting) section below. + +This will use the `mne-qt-browser` for the current Python session. If you +want to make this change permanent, so you don't have to use the +`set_browser_backend()` each time after restarting Python, run the following +line to modify your MNE configuration file: + +```python +import mne +mne.set_config('MNE_BROWSER_BACKEND', 'qt') +``` + +## Troubleshooting + +### Running from a script + +If you are running a script containing `raw.plot()` like + +```console +python example_script.py +``` + +the plot will not stay open when the script is done. + +To solve this either change `raw.plot()` to `raw.plot(block=True)` or run the script with the interactive flag + +```console +python -i example_script.py +``` + +### IPython + +If the integration of the Qt event loop is not activated for IPython, a plot with `raw.plot()` will freeze. +Do avoid that either change `raw.plot()` to `raw.plot(block=True)` or activate the integration of the event loop with + +```console +%gui qt5 +``` + +### Report Bugs & Feature Requests + +Please report bugs and feature requests in the [issues](https://github.com/mne-tools/mne-qt-browser/issues) of this repository. + +### Development and testing + +You can run a benchmark locally with: + +```console +pytest -m benchmark mne_qt_browser +``` + +To run the PyQtGraph tests you have to run: +``` +pytest mne_qt_browser/tests/test_pg_specific.py +``` + +Additionally, clone mne-python, and then run: + +```console +pytest -m pgtest ../mne-python/mne/viz/tests +``` + +If you do not have OpenGL installed, this will currently raise errors, and +you'll need to add this line to `mne/conftest.py` after the `error::` line: + +```raw + ignore:.*PyOpenGL was not found.*:RuntimeWarning +``` + + +%package -n python3-mne-qt-browser +Summary: A new backend based on pyqtgraph for the 2D-Data-Browser in MNE-Python +Provides: python-mne-qt-browser +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-mne-qt-browser +# mne-qt-browser + +## A new backend based on pyqtgraph for the 2D-Data-Browser in MNE-Python. + + + +This repository hosts the code for an alternative backend for plotting 2D-Data with +[MNE-Python](https://github.com/mne-tools/mne-python). + +The backend is based on [pyqtgraph](https://github.com/pyqtgraph/pyqtgraph) +which uses Qt's [Graphics View Framework](https://doc.qt.io/qt-5/graphicsview.html) +for the plotting. +Development started as a [2021's Google Summer of Code Project](https://github.com/marsipu/gsoc2021). + +## Installation +Install **full MNE-Python version 1.0 or greater** with the instructions provided [here](https://mne.tools/stable/install/mne_python.html#d-plotting-and-source-analysis) or install **minimal MNE-Python** with +### pip +``` +pip install "mne>=1.0" matplotlib mne-qt-browser +``` +or +### conda +``` +conda install -c conda-forge mne-base matplotlib mne-qt-browser +``` + +## Usage + +The backend supports plotting for the following MNE-Python methods: + +- [`mne.io.Raw.plot()`](https://mne.tools/dev/generated/mne.io.Raw.html?highlight=raw%20plot#mne.io.Raw.plot) +- [`mne.Epochs.plot()`](https://mne.tools/dev/generated/mne.Epochs.html?highlight=epochs%20plot#mne.Epochs.plot) +- [`mne.preprocessing.ICA.plot_sources(raw)`](https://mne.tools/dev/generated/mne.preprocessing.ICA.html?highlight=ica%20plot_sources#mne.preprocessing.ICA.plot_sources) +- [`mne.preprocessing.ICA.plot_sources(epochs)`](https://mne.tools/dev/generated/mne.preprocessing.ICA.html?highlight=ica%20plot_sources#mne.preprocessing.ICA.plot_sources) + +In the following example, we'll read M/EEG raw data from the MNE `sample` dataset +and plot it using the `qt`-backend. +(For mne-version >= 1.0 the `qt`-backend will be the default) + +```python +from pathlib import Path +import mne + +sample_dir = mne.datasets.sample.data_path() +raw_path = Path(sample_dir) / 'MEG' / 'sample' / 'sample_audvis_raw.fif' +raw = mne.io.read_raw(raw_path) + +mne.viz.set_browser_backend('qt') # Enable mne-qt-browser backend if mne < 1.0 +raw.plot(block=True) +``` + +If the plot is not showing, search for solutions in the +[troubleshooting](#troubleshooting) section below. + +This will use the `mne-qt-browser` for the current Python session. If you +want to make this change permanent, so you don't have to use the +`set_browser_backend()` each time after restarting Python, run the following +line to modify your MNE configuration file: + +```python +import mne +mne.set_config('MNE_BROWSER_BACKEND', 'qt') +``` + +## Troubleshooting + +### Running from a script + +If you are running a script containing `raw.plot()` like + +```console +python example_script.py +``` + +the plot will not stay open when the script is done. + +To solve this either change `raw.plot()` to `raw.plot(block=True)` or run the script with the interactive flag + +```console +python -i example_script.py +``` + +### IPython + +If the integration of the Qt event loop is not activated for IPython, a plot with `raw.plot()` will freeze. +Do avoid that either change `raw.plot()` to `raw.plot(block=True)` or activate the integration of the event loop with + +```console +%gui qt5 +``` + +### Report Bugs & Feature Requests + +Please report bugs and feature requests in the [issues](https://github.com/mne-tools/mne-qt-browser/issues) of this repository. + +### Development and testing + +You can run a benchmark locally with: + +```console +pytest -m benchmark mne_qt_browser +``` + +To run the PyQtGraph tests you have to run: +``` +pytest mne_qt_browser/tests/test_pg_specific.py +``` + +Additionally, clone mne-python, and then run: + +```console +pytest -m pgtest ../mne-python/mne/viz/tests +``` + +If you do not have OpenGL installed, this will currently raise errors, and +you'll need to add this line to `mne/conftest.py` after the `error::` line: + +```raw + ignore:.*PyOpenGL was not found.*:RuntimeWarning +``` + + +%package help +Summary: Development documents and examples for mne-qt-browser +Provides: python3-mne-qt-browser-doc +%description help +# mne-qt-browser + +## A new backend based on pyqtgraph for the 2D-Data-Browser in MNE-Python. + + + +This repository hosts the code for an alternative backend for plotting 2D-Data with +[MNE-Python](https://github.com/mne-tools/mne-python). + +The backend is based on [pyqtgraph](https://github.com/pyqtgraph/pyqtgraph) +which uses Qt's [Graphics View Framework](https://doc.qt.io/qt-5/graphicsview.html) +for the plotting. +Development started as a [2021's Google Summer of Code Project](https://github.com/marsipu/gsoc2021). + +## Installation +Install **full MNE-Python version 1.0 or greater** with the instructions provided [here](https://mne.tools/stable/install/mne_python.html#d-plotting-and-source-analysis) or install **minimal MNE-Python** with +### pip +``` +pip install "mne>=1.0" matplotlib mne-qt-browser +``` +or +### conda +``` +conda install -c conda-forge mne-base matplotlib mne-qt-browser +``` + +## Usage + +The backend supports plotting for the following MNE-Python methods: + +- [`mne.io.Raw.plot()`](https://mne.tools/dev/generated/mne.io.Raw.html?highlight=raw%20plot#mne.io.Raw.plot) +- [`mne.Epochs.plot()`](https://mne.tools/dev/generated/mne.Epochs.html?highlight=epochs%20plot#mne.Epochs.plot) +- [`mne.preprocessing.ICA.plot_sources(raw)`](https://mne.tools/dev/generated/mne.preprocessing.ICA.html?highlight=ica%20plot_sources#mne.preprocessing.ICA.plot_sources) +- [`mne.preprocessing.ICA.plot_sources(epochs)`](https://mne.tools/dev/generated/mne.preprocessing.ICA.html?highlight=ica%20plot_sources#mne.preprocessing.ICA.plot_sources) + +In the following example, we'll read M/EEG raw data from the MNE `sample` dataset +and plot it using the `qt`-backend. +(For mne-version >= 1.0 the `qt`-backend will be the default) + +```python +from pathlib import Path +import mne + +sample_dir = mne.datasets.sample.data_path() +raw_path = Path(sample_dir) / 'MEG' / 'sample' / 'sample_audvis_raw.fif' +raw = mne.io.read_raw(raw_path) + +mne.viz.set_browser_backend('qt') # Enable mne-qt-browser backend if mne < 1.0 +raw.plot(block=True) +``` + +If the plot is not showing, search for solutions in the +[troubleshooting](#troubleshooting) section below. + +This will use the `mne-qt-browser` for the current Python session. If you +want to make this change permanent, so you don't have to use the +`set_browser_backend()` each time after restarting Python, run the following +line to modify your MNE configuration file: + +```python +import mne +mne.set_config('MNE_BROWSER_BACKEND', 'qt') +``` + +## Troubleshooting + +### Running from a script + +If you are running a script containing `raw.plot()` like + +```console +python example_script.py +``` + +the plot will not stay open when the script is done. + +To solve this either change `raw.plot()` to `raw.plot(block=True)` or run the script with the interactive flag + +```console +python -i example_script.py +``` + +### IPython + +If the integration of the Qt event loop is not activated for IPython, a plot with `raw.plot()` will freeze. +Do avoid that either change `raw.plot()` to `raw.plot(block=True)` or activate the integration of the event loop with + +```console +%gui qt5 +``` + +### Report Bugs & Feature Requests + +Please report bugs and feature requests in the [issues](https://github.com/mne-tools/mne-qt-browser/issues) of this repository. + +### Development and testing + +You can run a benchmark locally with: + +```console +pytest -m benchmark mne_qt_browser +``` + +To run the PyQtGraph tests you have to run: +``` +pytest mne_qt_browser/tests/test_pg_specific.py +``` + +Additionally, clone mne-python, and then run: + +```console +pytest -m pgtest ../mne-python/mne/viz/tests +``` + +If you do not have OpenGL installed, this will currently raise errors, and +you'll need to add this line to `mne/conftest.py` after the `error::` line: + +```raw + ignore:.*PyOpenGL was not found.*:RuntimeWarning +``` + + +%prep +%autosetup -n mne-qt-browser-0.5.0 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-mne-qt-browser -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Tue May 30 2023 Python_Bot <Python_Bot@openeuler.org> - 0.5.0-1 +- Package Spec generated @@ -0,0 +1 @@ +e129ac5451372b33dda058a666d96e32 mne-qt-browser-0.5.0.tar.gz |