Accepting request 1045230 from devel:languages:python:numeric
OBS-URL: https://build.opensuse.org/request/show/1045230 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-plotly?expand=0&rev=35
This commit is contained in:
commit
396aedd6db
@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:4d36d9859b7a153b273562deeed8c292587a472eb1fd57cd4158ec89d9defadb
|
|
||||||
size 7600627
|
|
3
plotly-5.11.0.tar.gz
Normal file
3
plotly-5.11.0.tar.gz
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:4efef479c2ec1d86dcdac8405b6ca70ca65649a77408e39a7e84a1ea2db6c787
|
||||||
|
size 7645514
|
81
plotly-fix-sources-np1.24.patch
Normal file
81
plotly-fix-sources-np1.24.patch
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
Index: plotly.py-5.11.0/packages/python/plotly/plotly/figure_factory/_streamline.py
|
||||||
|
===================================================================
|
||||||
|
--- plotly.py-5.11.0.orig/packages/python/plotly/plotly/figure_factory/_streamline.py
|
||||||
|
+++ plotly.py-5.11.0/packages/python/plotly/plotly/figure_factory/_streamline.py
|
||||||
|
@@ -180,11 +180,11 @@ class _Streamline(object):
|
||||||
|
Set up for RK4 function, based on Bokeh's streamline code
|
||||||
|
"""
|
||||||
|
if isinstance(xi, np.ndarray):
|
||||||
|
- self.x = xi.astype(np.int)
|
||||||
|
- self.y = yi.astype(np.int)
|
||||||
|
+ self.x = xi.astype(int)
|
||||||
|
+ self.y = yi.astype(int)
|
||||||
|
else:
|
||||||
|
- self.val_x = np.int(xi)
|
||||||
|
- self.val_y = np.int(yi)
|
||||||
|
+ self.val_x = int(xi)
|
||||||
|
+ self.val_y = int(yi)
|
||||||
|
a00 = a[self.val_y, self.val_x]
|
||||||
|
a01 = a[self.val_y, self.val_x + 1]
|
||||||
|
a10 = a[self.val_y + 1, self.val_x]
|
||||||
|
Index: plotly.py-5.11.0/packages/python/plotly/plotly/express/imshow_utils.py
|
||||||
|
===================================================================
|
||||||
|
--- plotly.py-5.11.0.orig/packages/python/plotly/plotly/express/imshow_utils.py
|
||||||
|
+++ plotly.py-5.11.0/packages/python/plotly/plotly/express/imshow_utils.py
|
||||||
|
@@ -21,7 +21,6 @@ _integer_types = (
|
||||||
|
_integer_ranges = {t: (np.iinfo(t).min, np.iinfo(t).max) for t in _integer_types}
|
||||||
|
dtype_range = {
|
||||||
|
np.bool_: (False, True),
|
||||||
|
- np.bool8: (False, True),
|
||||||
|
np.float16: (-1, 1),
|
||||||
|
np.float32: (-1, 1),
|
||||||
|
np.float64: (-1, 1),
|
||||||
|
Index: plotly.py-5.11.0/packages/python/plotly/plotly/figure_factory/_violin.py
|
||||||
|
===================================================================
|
||||||
|
--- plotly.py-5.11.0.orig/packages/python/plotly/plotly/figure_factory/_violin.py
|
||||||
|
+++ plotly.py-5.11.0/packages/python/plotly/plotly/figure_factory/_violin.py
|
||||||
|
@@ -16,7 +16,7 @@ def calc_stats(data):
|
||||||
|
"""
|
||||||
|
Calculate statistics for use in violin plot.
|
||||||
|
"""
|
||||||
|
- x = np.asarray(data, np.float)
|
||||||
|
+ x = np.asarray(data, float)
|
||||||
|
vals_min = np.min(x)
|
||||||
|
vals_max = np.max(x)
|
||||||
|
q2 = np.percentile(x, 50, interpolation="linear")
|
||||||
|
@@ -160,7 +160,7 @@ def violinplot(vals, fillcolor="#1f77b4"
|
||||||
|
"""
|
||||||
|
Refer to FigureFactory.create_violin() for docstring.
|
||||||
|
"""
|
||||||
|
- vals = np.asarray(vals, np.float)
|
||||||
|
+ vals = np.asarray(vals, float)
|
||||||
|
# summary statistics
|
||||||
|
vals_min = calc_stats(vals)["min"]
|
||||||
|
vals_max = calc_stats(vals)["max"]
|
||||||
|
@@ -231,7 +231,7 @@ def violin_no_colorscale(
|
||||||
|
)
|
||||||
|
color_index = 0
|
||||||
|
for k, gr in enumerate(group_name):
|
||||||
|
- vals = np.asarray(gb.get_group(gr)[data_header], np.float)
|
||||||
|
+ vals = np.asarray(gb.get_group(gr)[data_header], float)
|
||||||
|
if color_index >= len(colors):
|
||||||
|
color_index = 0
|
||||||
|
plot_data, plot_xrange = violinplot(
|
||||||
|
@@ -319,7 +319,7 @@ def violin_colorscale(
|
||||||
|
min_value = min(group_stats_values)
|
||||||
|
|
||||||
|
for k, gr in enumerate(group_name):
|
||||||
|
- vals = np.asarray(gb.get_group(gr)[data_header], np.float)
|
||||||
|
+ vals = np.asarray(gb.get_group(gr)[data_header], float)
|
||||||
|
|
||||||
|
# find intermediate color from colorscale
|
||||||
|
intermed = (group_stats[gr] - min_value) / (max_value - min_value)
|
||||||
|
@@ -411,7 +411,7 @@ def violin_dict(
|
||||||
|
)
|
||||||
|
|
||||||
|
for k, gr in enumerate(group_name):
|
||||||
|
- vals = np.asarray(gb.get_group(gr)[data_header], np.float)
|
||||||
|
+ vals = np.asarray(gb.get_group(gr)[data_header], float)
|
||||||
|
plot_data, plot_xrange = violinplot(vals, fillcolor=colors[gr], rugplot=rugplot)
|
||||||
|
layout = graph_objs.Layout()
|
||||||
|
|
50
plotly-fix-tests-np1.24.patch
Normal file
50
plotly-fix-tests-np1.24.patch
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
Index: plotly.py-5.11.0/packages/python/plotly/plotly/tests/test_optional/test_px/test_imshow.py
|
||||||
|
===================================================================
|
||||||
|
--- plotly.py-5.11.0.orig/packages/python/plotly/plotly/tests/test_optional/test_px/test_imshow.py
|
||||||
|
+++ plotly.py-5.11.0/packages/python/plotly/plotly/tests/test_optional/test_px/test_imshow.py
|
||||||
|
@@ -9,7 +9,7 @@ import datetime
|
||||||
|
from plotly.express.imshow_utils import rescale_intensity
|
||||||
|
|
||||||
|
img_rgb = np.array([[[255, 0, 0], [0, 255, 0], [0, 0, 255]]], dtype=np.uint8)
|
||||||
|
-img_gray = np.arange(100, dtype=np.float).reshape((10, 10))
|
||||||
|
+img_gray = np.arange(100, dtype=float).reshape((10, 10))
|
||||||
|
|
||||||
|
|
||||||
|
def decode_image_string(image_string):
|
||||||
|
@@ -47,7 +47,7 @@ def test_automatic_zmax_from_dtype():
|
||||||
|
dtypes_dict = {
|
||||||
|
np.uint8: 2**8 - 1,
|
||||||
|
np.uint16: 2**16 - 1,
|
||||||
|
- np.float: 1,
|
||||||
|
+ float: 1,
|
||||||
|
bool: 255,
|
||||||
|
}
|
||||||
|
for key, val in dtypes_dict.items():
|
||||||
|
Index: plotly.py-5.11.0/packages/python/plotly/_plotly_utils/tests/validators/test_integer_validator.py
|
||||||
|
===================================================================
|
||||||
|
--- plotly.py-5.11.0.orig/packages/python/plotly/_plotly_utils/tests/validators/test_integer_validator.py
|
||||||
|
+++ plotly.py-5.11.0/packages/python/plotly/_plotly_utils/tests/validators/test_integer_validator.py
|
||||||
|
@@ -58,7 +58,7 @@ def test_acceptance_min_max(val, validat
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.parametrize(
|
||||||
|
- "val", [-1.01, -10, 2.1, 3, np.iinfo(np.int).max, np.iinfo(np.int).min]
|
||||||
|
+ "val", [-1.01, -10, 2.1, 3, np.iinfo(int).max, np.iinfo(int).min]
|
||||||
|
)
|
||||||
|
def test_rejection_min_max(val, validator_min_max):
|
||||||
|
with pytest.raises(ValueError) as validation_failure:
|
||||||
|
Index: plotly.py-5.11.0/packages/python/plotly/plotly/tests/test_optional/test_utils/test_utils.py
|
||||||
|
===================================================================
|
||||||
|
--- plotly.py-5.11.0.orig/packages/python/plotly/plotly/tests/test_optional/test_utils/test_utils.py
|
||||||
|
+++ plotly.py-5.11.0/packages/python/plotly/plotly/tests/test_optional/test_utils/test_utils.py
|
||||||
|
@@ -414,8 +414,8 @@ class TestNumpyIntegerBaseType(TestCase)
|
||||||
|
import plotly.graph_objects as go
|
||||||
|
from plotly.subplots import make_subplots
|
||||||
|
|
||||||
|
- indices_rows = np.array([1], dtype=np.int)
|
||||||
|
- indices_cols = np.array([1], dtype=np.int)
|
||||||
|
+ indices_rows = np.array([1], dtype=int)
|
||||||
|
+ indices_cols = np.array([1], dtype=int)
|
||||||
|
fig = make_subplots(rows=1, cols=1)
|
||||||
|
fig.add_trace(go.Scatter(y=[1]), row=indices_rows[0], col=indices_cols[0])
|
||||||
|
|
@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:30034c742edff0c268d2d09d748bf1daef3a23957fa6dceb6bd847fd80416448
|
|
||||||
size 30527330
|
|
3
plotly.py-5.11.0-gh.tar.gz
Normal file
3
plotly.py-5.11.0-gh.tar.gz
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:fb85d1c6013cb91324bd610e02f820880e14aa7daa9bbc6c3572b7250764ee33
|
||||||
|
size 30575379
|
@ -1,3 +1,20 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Sat Dec 24 12:18:06 UTC 2022 - Ben Greiner <code@bnavigator.de>
|
||||||
|
|
||||||
|
- Update to version 5.11.0
|
||||||
|
* Add clustering options to scattermapbox [#5827], with thanks to
|
||||||
|
@elben10 for the contribution!
|
||||||
|
* Add bounds to mapbox suplots [6339]
|
||||||
|
* Add angle, angleref and standoff to marker and add backoff to
|
||||||
|
line; also introduce new arrow symbols to facilitate drawing
|
||||||
|
networks [#6297]
|
||||||
|
* Add minreducedwidth and minreducedheight to layout for
|
||||||
|
increasing control over automargin [#6307]
|
||||||
|
* Add entrywidth and entrywidthmode to legend [#6202, #6324]
|
||||||
|
- Add patches for compatibility with numpy 1.24
|
||||||
|
* plotly-fix-sources-np1.24.patch
|
||||||
|
* plotly-fix-tests-np1.24.patch
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Sun Aug 14 14:43:43 UTC 2022 - Arun Persaud <arun@gmx.de>
|
Sun Aug 14 14:43:43 UTC 2022 - Arun Persaud <arun@gmx.de>
|
||||||
|
|
||||||
|
@ -16,10 +16,9 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
%{?!python_module:%define python_module() python3-%{**}}
|
|
||||||
%define skip_python2 1
|
%define skip_python2 1
|
||||||
Name: python-plotly
|
Name: python-plotly
|
||||||
Version: 5.10.0
|
Version: 5.11.0
|
||||||
Release: 0
|
Release: 0
|
||||||
Summary: Library for collaborative, interactive, publication-quality graphs
|
Summary: Library for collaborative, interactive, publication-quality graphs
|
||||||
License: MIT
|
License: MIT
|
||||||
@ -29,13 +28,19 @@ Source: https://files.pythonhosted.org/packages/source/p/plotly/plotly-%
|
|||||||
# Additionally use the GitHub archive for the test suite
|
# Additionally use the GitHub archive for the test suite
|
||||||
Source1: https://github.com/plotly/plotly.py/archive/refs/tags/v%{version}.tar.gz#/plotly.py-%{version}-gh.tar.gz
|
Source1: https://github.com/plotly/plotly.py/archive/refs/tags/v%{version}.tar.gz#/plotly.py-%{version}-gh.tar.gz
|
||||||
Source100: python-plotly-rpmlintrc
|
Source100: python-plotly-rpmlintrc
|
||||||
|
# PATCH-FIX-UPSTREAM plotly-fix-tests-np1.24.patch and plotly-fix-sources-np1.24.patch gh#plotly/plotly.py#3997
|
||||||
|
Patch1: plotly-fix-sources-np1.24.patch
|
||||||
|
Patch2: plotly-fix-tests-np1.24.patch
|
||||||
|
BuildRequires: %{python_module base >= 3.6}
|
||||||
|
BuildRequires: %{python_module jupyterlab >= 3}
|
||||||
|
BuildRequires: %{python_module notebook >= 5.3}
|
||||||
|
BuildRequires: %{python_module pip}
|
||||||
BuildRequires: %{python_module setuptools}
|
BuildRequires: %{python_module setuptools}
|
||||||
BuildRequires: %{python_module six >= 1.15.0}
|
|
||||||
BuildRequires: %{python_module tenacity >= 6.2.0}
|
BuildRequires: %{python_module tenacity >= 6.2.0}
|
||||||
|
BuildRequires: %{python_module wheel}
|
||||||
BuildRequires: fdupes
|
BuildRequires: fdupes
|
||||||
BuildRequires: jupyter-rpm-macros
|
BuildRequires: jupyter-rpm-macros
|
||||||
BuildRequires: python-rpm-macros
|
BuildRequires: python-rpm-macros
|
||||||
Requires: python-six >= 1.15.0
|
|
||||||
Requires: python-tenacity >= 6.2.0
|
Requires: python-tenacity >= 6.2.0
|
||||||
Recommends: python-ipython
|
Recommends: python-ipython
|
||||||
Recommends: python-matplotlib >= 2.2.2
|
Recommends: python-matplotlib >= 2.2.2
|
||||||
@ -45,8 +50,6 @@ Recommends: python-scipy
|
|||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
# SECTION test requirements
|
# SECTION test requirements
|
||||||
BuildRequires: %{python_module Pillow}
|
BuildRequires: %{python_module Pillow}
|
||||||
# Currently not building in TW
|
|
||||||
#BuildRequires: %%{python_module Shapely}
|
|
||||||
BuildRequires: %{python_module ipykernel}
|
BuildRequires: %{python_module ipykernel}
|
||||||
BuildRequires: %{python_module ipython}
|
BuildRequires: %{python_module ipython}
|
||||||
BuildRequires: %{python_module ipywidgets}
|
BuildRequires: %{python_module ipywidgets}
|
||||||
@ -80,7 +83,7 @@ Summary: Jupyter notebook integration for %{name}
|
|||||||
Requires: %{name} = %{version}
|
Requires: %{name} = %{version}
|
||||||
Requires: jupyter-plotly = %{version}
|
Requires: jupyter-plotly = %{version}
|
||||||
Requires: python-ipywidgets >= 7.6
|
Requires: python-ipywidgets >= 7.6
|
||||||
Requires: (python-jupyterlab or python-notebook)
|
Requires: (python-jupyterlab >= 3 or python-notebook >= 5.3)
|
||||||
Provides: python-jupyterlab-plotly = %{version}-%{release}
|
Provides: python-jupyterlab-plotly = %{version}-%{release}
|
||||||
|
|
||||||
%description jupyter
|
%description jupyter
|
||||||
@ -113,38 +116,45 @@ Jupyterlab and Notebook integration and widgets.
|
|||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n plotly-%{version} -b 1
|
%setup -q -n plotly-%{version} -b 1
|
||||||
|
%patch1 -p4
|
||||||
# remove script interpreter line in non-executable script
|
# remove script interpreter line in non-executable script
|
||||||
sed -i '1{/env python/ d}' _plotly_utils/png.py
|
sed -i '1{/env python/ d}' _plotly_utils/png.py
|
||||||
# homogenize mtime of all __init__.py files for deduplicated compile cache consistency
|
# homogenize mtime of all __init__.py files for deduplicated compile cache consistency
|
||||||
find . -name __init__.py -exec touch -m -r plotly/__init__.py '{}' ';'
|
find . -name __init__.py -exec touch -m -r plotly/__init__.py '{}' ';'
|
||||||
|
# patch the sources and tests in the github archive too
|
||||||
|
pushd ../plotly.py-%{version}
|
||||||
|
%patch1 -p1
|
||||||
|
%patch2 -p1
|
||||||
|
popd
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%python_build
|
%pyproject_wheel
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%python_install
|
%pyproject_install
|
||||||
%jupyter_move_config
|
|
||||||
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
||||||
%fdupes %{buildroot}%{_jupyter_prefix}
|
%fdupes %{buildroot}%{_jupyter_prefix}
|
||||||
|
|
||||||
%check
|
%check
|
||||||
# No test suite in the PyPI package, which is required for the bundled JS files, go to the GitHub repo tree now.
|
# No test suite in the PyPI package, which is required for the bundled JS files, we are using the GitHub repo tree now.
|
||||||
cd ../plotly.py-%{version}/packages/python/plotly
|
# Important: make sure you patched the sources the same as the github repo
|
||||||
%{pytest plotly/tests/test_core}
|
pushd ../plotly.py-%{version}/packages/python/plotly
|
||||||
# most of the optional packages are not available on python36: skip entire test suite
|
%pytest plotly/tests/test_core
|
||||||
python36_skip="-V"
|
|
||||||
# not available
|
# not available
|
||||||
donttest="test_kaleido"
|
donttest="test_kaleido"
|
||||||
# API parameter mismatches and precision errors
|
# API parameter mismatches and precision errors
|
||||||
donttest+=" or test_matplotlylib"
|
donttest+=" or test_matplotlylib"
|
||||||
%pytest ${$python_skip} plotly/tests/test_optional -k "not ($donttest)"
|
# flaky timing error
|
||||||
|
donttest+=" or test_fast_track_finite_arrays"
|
||||||
|
%pytest plotly/tests/test_optional -k "not ($donttest)"
|
||||||
|
popd
|
||||||
|
|
||||||
%files %{python_files}
|
%files %{python_files}
|
||||||
%license LICENSE.txt
|
%license LICENSE.txt
|
||||||
%{python_sitelib}/_plotly_future_/
|
%{python_sitelib}/_plotly_future_/
|
||||||
%{python_sitelib}/_plotly_utils/
|
%{python_sitelib}/_plotly_utils/
|
||||||
%{python_sitelib}/plotly/
|
%{python_sitelib}/plotly/
|
||||||
%{python_sitelib}/plotly-%{version}-py*.egg-info
|
%{python_sitelib}/plotly-%{version}.dist-info
|
||||||
|
|
||||||
%files %{python_files jupyter}
|
%files %{python_files jupyter}
|
||||||
%license LICENSE.txt
|
%license LICENSE.txt
|
||||||
@ -152,6 +162,8 @@ donttest+=" or test_matplotlylib"
|
|||||||
|
|
||||||
%files -n jupyter-plotly
|
%files -n jupyter-plotly
|
||||||
%license LICENSE.txt
|
%license LICENSE.txt
|
||||||
|
%{_jupyter_nbextension_dir}/jupyterlab-plotly/
|
||||||
|
%{_jupyter_labextensions_dir3}/jupyterlab-plotly/
|
||||||
%{_jupyter_config} %{_jupyter_nb_notebook_confdir}/jupyterlab-plotly.json
|
%{_jupyter_config} %{_jupyter_nb_notebook_confdir}/jupyterlab-plotly.json
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
Loading…
Reference in New Issue
Block a user