From 9cdf1a61f3547bf0cec68f668145dbc94e4600da Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Wed, 17 May 2023 04:55:11 +0000 Subject: automatic import of python-qbstyles --- .gitignore | 1 + python-qbstyles.spec | 421 +++++++++++++++++++++++++++++++++++++++++++++++++++ sources | 1 + 3 files changed, 423 insertions(+) create mode 100644 python-qbstyles.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore index e69de29..cd9ebaf 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/qbstyles-0.1.4.tar.gz diff --git a/python-qbstyles.spec b/python-qbstyles.spec new file mode 100644 index 0000000..b453fc8 --- /dev/null +++ b/python-qbstyles.spec @@ -0,0 +1,421 @@ +%global _empty_manifest_terminate_build 0 +Name: python-qbstyles +Version: 0.1.4 +Release: 1 +Summary: QB styles for common plotting libraries +License: Apache 2.0 +URL: https://github.com/quantumblacklabs/qbstyles +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/56/65/b0a2f4b8ba3a110276c7d74b1e901f7ae4046b11ea2d493471a2e1858c73/qbstyles-0.1.4.tar.gz +BuildArch: noarch + +Requires: python3-matplotlib + +%description +# QB Styles + +[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) +[![Python Version](https://img.shields.io/pypi/pyversions/qbstyles.svg)](https://pypi.org/project/qbstyles/) +[![PyPI version](https://badge.fury.io/py/qbstyles.svg)](https://pypi.org/project/qbstyles/) +[![Code Style: Black](https://img.shields.io/badge/code%20style-black-black.svg)](https://github.com/ambv/black) + +QB Styles is a python package with a light and a dark [`matplotlib`](https://github.com/matplotlib/matplotlib) style. + +Dark style | Light style +|-----------|----------- | +| ![Line plot](https://github.com/quantumblacklabs/qbstyles/raw/master/examples/line.png?raw=true "Line plot") | ![Distribution plot](https://github.com/quantumblacklabs/qbstyles/raw/master/examples/distribution_light.png?raw=true "Distribution plot") | + +## How do I install QB Styles? + +`qbstyles` is a Python package. To install it, simply run: + + +```bash +pip install qbstyles +``` + +## How do I use QB Styles? + +You can use the dark Matplotlib style theme in the following way: + +```python +from qbstyles import mpl_style + +mpl_style(dark=True) +``` + +And to use the light Matplotlib style theme, you can do the following: + +```python +from qbstyles import mpl_style + +mpl_style(dark=False) +``` + +### How do I use QB Styles in Jupyter Notebooks? + +> ⚠️ Please make sure you run `from qbstyles import mpl_style` and `mpl_style()` in **different cells** as shown below. See [this issue](https://github.com/jupyter/notebook/issues/3691) for more details. + +```python +# first cell +from qbstyles import mpl_style +``` +```python +# second cell +mpl_style() +``` + +## What chart types can use QB Styles? + +- Line plots +- Scatter plots +- Bubble plots +- Bar charts +- Pie charts +- Histograms and distribution plots +- 3D surface plots +- Stream plots +- Polar plots + +## Can you show me a few examples? + +To run the examples in [`example.ipynb`](https://github.com/quantumblacklabs/qbstyles/blob/master/example.ipynb), install the required packages using ``pip install -r requirements_notebook.txt`` in a Python virtual environment of your choice. + +```python +import matplotlib.pyplot as plt +from qbstyles import mpl_style + +def plot(dark): + mpl_style(dark) + fig, axes = plt.subplots(2, 2, figsize=(15, 10)) + + # the following functions are defined in example.ipynb + line_plot(axes[0, 0]) + scatter_plot(axes[0, 1]) + distribution_plot(axes[1, 0]) + ax = plt.subplot(2, 2, 4, projection='polar') + polar_plot(ax) + +plot(dark=True) +``` + +![png](https://github.com/quantumblacklabs/qbstyles/raw/master/examples/output_6_0.png?raw=true) + +```python +plot(dark=False) +``` + +![png](https://github.com/quantumblacklabs/qbstyles/raw/master/examples/output_7_0.png?raw=true) + +## How do I create my own styles? + +Have a look at the files [qb-common.mplstyle](https://github.com/quantumblacklabs/qbstyles/blob/master/qbstyles/styles/qb-common.mplstyle), [qb-dark.mplstyle](https://github.com/quantumblacklabs/qbstyles/blob/master/qbstyles/styles/qb-dark.mplstyle) and [qb-light.mplstyle](https://github.com/quantumblacklabs/qbstyles/blob/master/qbstyles/styles/qb-light.mplstyle). They contain many elements that you may want to customise. + +To do so, create a file similar to the above files at the root of your project, and apply it after the `qbstyle` as follows: + +```python +import matplotlib.pyplot as plt +from qbstyles import mpl_style + +mpl_style() +plt.style.use('./your-style.mplstyle') +``` + +All of `matplotlibrc`'s options can be found [here](https://matplotlib.org/tutorials/introductory/customizing.html#a-sample-matplotlibrc-file). + +## What licence do you use? + +QB Styles is licensed under the [Apache 2.0 License](https://www.apache.org/licenses/LICENSE-2.0). + + + + +%package -n python3-qbstyles +Summary: QB styles for common plotting libraries +Provides: python-qbstyles +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-qbstyles +# QB Styles + +[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) +[![Python Version](https://img.shields.io/pypi/pyversions/qbstyles.svg)](https://pypi.org/project/qbstyles/) +[![PyPI version](https://badge.fury.io/py/qbstyles.svg)](https://pypi.org/project/qbstyles/) +[![Code Style: Black](https://img.shields.io/badge/code%20style-black-black.svg)](https://github.com/ambv/black) + +QB Styles is a python package with a light and a dark [`matplotlib`](https://github.com/matplotlib/matplotlib) style. + +Dark style | Light style +|-----------|----------- | +| ![Line plot](https://github.com/quantumblacklabs/qbstyles/raw/master/examples/line.png?raw=true "Line plot") | ![Distribution plot](https://github.com/quantumblacklabs/qbstyles/raw/master/examples/distribution_light.png?raw=true "Distribution plot") | + +## How do I install QB Styles? + +`qbstyles` is a Python package. To install it, simply run: + + +```bash +pip install qbstyles +``` + +## How do I use QB Styles? + +You can use the dark Matplotlib style theme in the following way: + +```python +from qbstyles import mpl_style + +mpl_style(dark=True) +``` + +And to use the light Matplotlib style theme, you can do the following: + +```python +from qbstyles import mpl_style + +mpl_style(dark=False) +``` + +### How do I use QB Styles in Jupyter Notebooks? + +> ⚠️ Please make sure you run `from qbstyles import mpl_style` and `mpl_style()` in **different cells** as shown below. See [this issue](https://github.com/jupyter/notebook/issues/3691) for more details. + +```python +# first cell +from qbstyles import mpl_style +``` +```python +# second cell +mpl_style() +``` + +## What chart types can use QB Styles? + +- Line plots +- Scatter plots +- Bubble plots +- Bar charts +- Pie charts +- Histograms and distribution plots +- 3D surface plots +- Stream plots +- Polar plots + +## Can you show me a few examples? + +To run the examples in [`example.ipynb`](https://github.com/quantumblacklabs/qbstyles/blob/master/example.ipynb), install the required packages using ``pip install -r requirements_notebook.txt`` in a Python virtual environment of your choice. + +```python +import matplotlib.pyplot as plt +from qbstyles import mpl_style + +def plot(dark): + mpl_style(dark) + fig, axes = plt.subplots(2, 2, figsize=(15, 10)) + + # the following functions are defined in example.ipynb + line_plot(axes[0, 0]) + scatter_plot(axes[0, 1]) + distribution_plot(axes[1, 0]) + ax = plt.subplot(2, 2, 4, projection='polar') + polar_plot(ax) + +plot(dark=True) +``` + +![png](https://github.com/quantumblacklabs/qbstyles/raw/master/examples/output_6_0.png?raw=true) + +```python +plot(dark=False) +``` + +![png](https://github.com/quantumblacklabs/qbstyles/raw/master/examples/output_7_0.png?raw=true) + +## How do I create my own styles? + +Have a look at the files [qb-common.mplstyle](https://github.com/quantumblacklabs/qbstyles/blob/master/qbstyles/styles/qb-common.mplstyle), [qb-dark.mplstyle](https://github.com/quantumblacklabs/qbstyles/blob/master/qbstyles/styles/qb-dark.mplstyle) and [qb-light.mplstyle](https://github.com/quantumblacklabs/qbstyles/blob/master/qbstyles/styles/qb-light.mplstyle). They contain many elements that you may want to customise. + +To do so, create a file similar to the above files at the root of your project, and apply it after the `qbstyle` as follows: + +```python +import matplotlib.pyplot as plt +from qbstyles import mpl_style + +mpl_style() +plt.style.use('./your-style.mplstyle') +``` + +All of `matplotlibrc`'s options can be found [here](https://matplotlib.org/tutorials/introductory/customizing.html#a-sample-matplotlibrc-file). + +## What licence do you use? + +QB Styles is licensed under the [Apache 2.0 License](https://www.apache.org/licenses/LICENSE-2.0). + + + + +%package help +Summary: Development documents and examples for qbstyles +Provides: python3-qbstyles-doc +%description help +# QB Styles + +[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) +[![Python Version](https://img.shields.io/pypi/pyversions/qbstyles.svg)](https://pypi.org/project/qbstyles/) +[![PyPI version](https://badge.fury.io/py/qbstyles.svg)](https://pypi.org/project/qbstyles/) +[![Code Style: Black](https://img.shields.io/badge/code%20style-black-black.svg)](https://github.com/ambv/black) + +QB Styles is a python package with a light and a dark [`matplotlib`](https://github.com/matplotlib/matplotlib) style. + +Dark style | Light style +|-----------|----------- | +| ![Line plot](https://github.com/quantumblacklabs/qbstyles/raw/master/examples/line.png?raw=true "Line plot") | ![Distribution plot](https://github.com/quantumblacklabs/qbstyles/raw/master/examples/distribution_light.png?raw=true "Distribution plot") | + +## How do I install QB Styles? + +`qbstyles` is a Python package. To install it, simply run: + + +```bash +pip install qbstyles +``` + +## How do I use QB Styles? + +You can use the dark Matplotlib style theme in the following way: + +```python +from qbstyles import mpl_style + +mpl_style(dark=True) +``` + +And to use the light Matplotlib style theme, you can do the following: + +```python +from qbstyles import mpl_style + +mpl_style(dark=False) +``` + +### How do I use QB Styles in Jupyter Notebooks? + +> ⚠️ Please make sure you run `from qbstyles import mpl_style` and `mpl_style()` in **different cells** as shown below. See [this issue](https://github.com/jupyter/notebook/issues/3691) for more details. + +```python +# first cell +from qbstyles import mpl_style +``` +```python +# second cell +mpl_style() +``` + +## What chart types can use QB Styles? + +- Line plots +- Scatter plots +- Bubble plots +- Bar charts +- Pie charts +- Histograms and distribution plots +- 3D surface plots +- Stream plots +- Polar plots + +## Can you show me a few examples? + +To run the examples in [`example.ipynb`](https://github.com/quantumblacklabs/qbstyles/blob/master/example.ipynb), install the required packages using ``pip install -r requirements_notebook.txt`` in a Python virtual environment of your choice. + +```python +import matplotlib.pyplot as plt +from qbstyles import mpl_style + +def plot(dark): + mpl_style(dark) + fig, axes = plt.subplots(2, 2, figsize=(15, 10)) + + # the following functions are defined in example.ipynb + line_plot(axes[0, 0]) + scatter_plot(axes[0, 1]) + distribution_plot(axes[1, 0]) + ax = plt.subplot(2, 2, 4, projection='polar') + polar_plot(ax) + +plot(dark=True) +``` + +![png](https://github.com/quantumblacklabs/qbstyles/raw/master/examples/output_6_0.png?raw=true) + +```python +plot(dark=False) +``` + +![png](https://github.com/quantumblacklabs/qbstyles/raw/master/examples/output_7_0.png?raw=true) + +## How do I create my own styles? + +Have a look at the files [qb-common.mplstyle](https://github.com/quantumblacklabs/qbstyles/blob/master/qbstyles/styles/qb-common.mplstyle), [qb-dark.mplstyle](https://github.com/quantumblacklabs/qbstyles/blob/master/qbstyles/styles/qb-dark.mplstyle) and [qb-light.mplstyle](https://github.com/quantumblacklabs/qbstyles/blob/master/qbstyles/styles/qb-light.mplstyle). They contain many elements that you may want to customise. + +To do so, create a file similar to the above files at the root of your project, and apply it after the `qbstyle` as follows: + +```python +import matplotlib.pyplot as plt +from qbstyles import mpl_style + +mpl_style() +plt.style.use('./your-style.mplstyle') +``` + +All of `matplotlibrc`'s options can be found [here](https://matplotlib.org/tutorials/introductory/customizing.html#a-sample-matplotlibrc-file). + +## What licence do you use? + +QB Styles is licensed under the [Apache 2.0 License](https://www.apache.org/licenses/LICENSE-2.0). + + + + +%prep +%autosetup -n qbstyles-0.1.4 + +%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-qbstyles -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Wed May 17 2023 Python_Bot - 0.1.4-1 +- Package Spec generated diff --git a/sources b/sources new file mode 100644 index 0000000..ae06bac --- /dev/null +++ b/sources @@ -0,0 +1 @@ +f7e6c764112b3abb39a9053352f9e285 qbstyles-0.1.4.tar.gz -- cgit v1.2.3