diff options
| author | Liguros - Gitlab CI/CD [develop] <gitlab@liguros.net> | 2024-07-24 18:35:08 +0000 |
|---|---|---|
| committer | Liguros - Gitlab CI/CD [develop] <gitlab@liguros.net> | 2024-07-24 18:35:08 +0000 |
| commit | baf8c6e80dc6cba501563da7a4b310134a76a65e (patch) | |
| tree | 84f4ed9b92ddad768436305a6732d235e5b40ee0 /dev-python/plotly/files | |
| parent | 167d7fd4abfaf9ec8eab3063904e4b30c161dccd (diff) | |
| download | baldeagleos-repo-baf8c6e80dc6cba501563da7a4b310134a76a65e.tar.gz baldeagleos-repo-baf8c6e80dc6cba501563da7a4b310134a76a65e.tar.xz baldeagleos-repo-baf8c6e80dc6cba501563da7a4b310134a76a65e.zip | |
Adding metadata
Diffstat (limited to 'dev-python/plotly/files')
| -rw-r--r-- | dev-python/plotly/files/plotly-5.23.0-numpy-2.patch | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/dev-python/plotly/files/plotly-5.23.0-numpy-2.patch b/dev-python/plotly/files/plotly-5.23.0-numpy-2.patch new file mode 100644 index 000000000000..6941369978e8 --- /dev/null +++ b/dev-python/plotly/files/plotly-5.23.0-numpy-2.patch @@ -0,0 +1,87 @@ +From 99df182e9171e9b9e81811447f37ace05acc9272 Mon Sep 17 00:00:00 2001 +From: Ben Greiner <code@bnavigator.de> +Date: Sun, 2 Jun 2024 16:43:06 +0200 +Subject: [PATCH 1/3] Remove np.nan and np.inf aliases no longer present in + numpy2 + +--- + .../tests/test_optional/test_utils/test_utils.py | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/plotly/tests/test_optional/test_utils/test_utils.py b/plotly/tests/test_optional/test_utils/test_utils.py +index cf32e1bdff..d7d982e635 100644 +--- a/plotly/tests/test_optional/test_utils/test_utils.py ++++ b/plotly/tests/test_optional/test_utils/test_utils.py +@@ -34,7 +34,7 @@ + + ## JSON encoding + numeric_list = [1, 2, 3] +-np_list = np.array([1, 2, 3, np.NaN, np.NAN, np.Inf, dt(2014, 1, 5)]) ++np_list = np.array([1, 2, 3, np.nan, np.inf, dt(2014, 1, 5)]) + mixed_list = [ + 1, + "A", +@@ -45,7 +45,7 @@ + dt_list = [dt(2014, 1, 5), dt(2014, 1, 5, 1, 1, 1), dt(2014, 1, 5, 1, 1, 1, 1)] + + df = pd.DataFrame( +- columns=["col 1"], data=[1, 2, 3, dt(2014, 1, 5), pd.NaT, np.NaN, np.Inf] ++ columns=["col 1"], data=[1, 2, 3, dt(2014, 1, 5), pd.NaT, np.nan, np.inf] + ) + + rng = pd.date_range("1/1/2011", periods=2, freq="H") +@@ -184,7 +184,7 @@ def test_figure_json_encoding(self): + + assert ( + js1 == '{"type": "scatter3d", "x": [1, 2, 3], ' +- '"y": [1, 2, 3, null, null, null, "2014-01-05T00:00:00"], ' ++ '"y": [1, 2, 3, null, null, "2014-01-05T00:00:00"], ' + '"z": [1, "A", "2014-01-05T00:00:00", ' + '"2014-01-05T01:01:01", "2014-01-05T01:01:01.000001"]}' + ) +@@ -195,9 +195,9 @@ def test_figure_json_encoding(self): + _json.dumps(figure, cls=utils.PlotlyJSONEncoder, sort_keys=True) + + # Test data wasn't mutated +- np_array = np.array([1, 2, 3, np.NaN, np.NAN, np.Inf, dt(2014, 1, 5)]) ++ np_array = np.array([1, 2, 3, np.nan, np.inf, dt(2014, 1, 5)]) + for k in range(len(np_array)): +- if k in [3, 4]: ++ if k == 3: + # check NaN + assert np.isnan(np_list[k]) and np.isnan(np_array[k]) + else: +@@ -237,7 +237,7 @@ def test_pandas_json_encoding(self): + # Test that data wasn't mutated + assert_series_equal( + df["col 1"], +- pd.Series([1, 2, 3, dt(2014, 1, 5), pd.NaT, np.NaN, np.Inf], name="col 1"), ++ pd.Series([1, 2, 3, dt(2014, 1, 5), pd.NaT, np.nan, np.inf], name="col 1"), + ) + + j2 = _json.dumps(df.index, cls=utils.PlotlyJSONEncoder) + +From 23b50d9df805349674e11949459976fb338b3d76 Mon Sep 17 00:00:00 2001 +From: Ben Greiner <code@bnavigator.de> +Date: Sun, 2 Jun 2024 16:48:34 +0200 +Subject: [PATCH 2/3] Avoid putting 255 into int8 due to new numpy 2 type + promotion rules + +--- + .../plotly/plotly/tests/test_optional/test_px/test_imshow.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/plotly/tests/test_optional/test_px/test_imshow.py b/plotly/tests/test_optional/test_px/test_imshow.py +index c2e863c846..d8f9ad98c7 100644 +--- a/plotly/tests/test_optional/test_px/test_imshow.py ++++ b/plotly/tests/test_optional/test_px/test_imshow.py +@@ -341,7 +341,7 @@ def test_imshow_source_dtype_zmax(dtype, contrast_rescaling): + assert ( + np.abs( + np.max(decode_image_string(fig.data[0].source)) +- - 255 * img.max() / np.iinfo(dtype).max ++ - np.int64(255) * img.max() / np.iinfo(dtype).max + ) + < 1 + ) + |
