Skip to content

Commit 10c5104

Browse files
authored
Merge branch 'master' into maplibre-tests
2 parents 1ffb776 + e8397d2 commit 10c5104

File tree

7 files changed

+91
-14
lines changed

7 files changed

+91
-14
lines changed

.circleci/config.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,21 @@ jobs:
234234
- test_optional:
235235
py: "39_pandas_2"
236236

237+
# No numpy
238+
python_312_no_numpy:
239+
docker:
240+
- image: cimg/python:3.12-browsers
241+
steps:
242+
- run:
243+
name: Check that numpy is not installed
244+
command: |
245+
if pip list | grep numpy > /dev/null 2>&1
246+
then exit 1
247+
else exit 0
248+
fi
249+
- test_optional:
250+
py: "312_no_numpy"
251+
237252
# Orca
238253
python_38_orca:
239254
docker:
@@ -448,7 +463,7 @@ jobs:
448463
docker:
449464
# specify the version you desire here
450465
# use `-browsers` prefix for selenium tests, for example, `3.9-browsers`
451-
- image: cimg/python:3.10-browsers
466+
- image: cimg/python:3.9-browsers
452467

453468
steps:
454469
- add_ssh_keys:
@@ -598,5 +613,6 @@ workflows:
598613
- python_39_pandas_2_optional
599614
- python_38_orca
600615
- python_39_percy
616+
- python_312_no_numpy
601617
- build-doc
602618

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
All notable changes to this project will be documented in this file.
33
This project adheres to [Semantic Versioning](http://semver.org/).
44

5+
## UNRELEASED
6+
7+
### Updated
8+
- Fixed a bug in integer validation of arrays that threw an error when an array contained a mix of strings and integers.
9+
510
## [5.23.0] - 2024-07-23
611

712
### Updated

doc/python/axes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ You can adjust tick label positions by moving them a number of pixels away from
456456

457457
In this example, `ticklabelshift=25` shifts the labels 25 pixels to the right along the x-axis. By providing a negative value, we could move the labels 25 pixels to the left, (`ticklabelshift=-25`).
458458

459-
Here, `ticklabelstandoff=15` moves the labels further 15 pixels away from the x-axis. A negative value here would move them close to the axis.
459+
Here, `ticklabelstandoff=15` moves the labels 15 pixels further away from the x-axis. A negative value here would move them closer to the axis.
460460

461461
```python
462462
import plotly.express as px
@@ -483,7 +483,7 @@ fig.show()
483483

484484
On date or linear axes, use `ticklabelindex` to draw a label for a minor tick instead of a major tick.
485485

486-
To draw the label for the minor tick before each major tick, set `ticklabelindex` -1, like in the following example.
486+
To draw the label for the minor tick before each major tick, set `ticklabelindex=-1`, like in the following example.
487487

488488
```python
489489
import plotly.express as px

doc/requirements.txt

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,21 @@ ipywidgets==7.7.2
44
jupyter-client<7
55
jupyter
66
notebook
7-
pandas==2.2.2
7+
pandas==1.4.0
88
statsmodels==0.14.2
9-
scipy==1.13.0
9+
scipy==1.9.1
1010
patsy==0.5.6
11-
numpy==1.26.4
11+
numpy==1.22.4
1212
plotly-geo
1313
igraph
14-
geopandas==0.14.3
15-
pyshp==2.3.1
16-
shapely==2.0.4
14+
geopandas==0.8.1
15+
pyshp==2.1.2
16+
shapely==2.0.5
1717
psutil
1818
requests
19-
networkx==3.3
19+
networkx==2.8.0
2020
squarify
21-
scikit-image==0.23.2
21+
scikit-image==0.20.0
2222
scikit-learn
2323
sphinx==3.5.4
2424
sphinxcontrib-applehelp==1.0.2
@@ -31,7 +31,7 @@ sphinx_bootstrap_theme
3131
recommonmark
3232
pathlib
3333
python-frontmatter
34-
datashader==0.16.1
34+
datashader==0.14.4
3535
pyarrow
3636
cufflinks==0.17.3
3737
kaleido
@@ -42,6 +42,7 @@ nbconvert==5.6.1
4242
orjson
4343
dash-bio
4444
jinja2<3.1
45-
dask==2024.4.2
45+
dask==2022.2.0
4646
polars
47+
geoparse<=2.0.3
4748
xarray==2022.9.0

packages/python/plotly/_plotly_utils/basevalidators.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -950,7 +950,8 @@ def validate_coerce(self, v):
950950
invalid_els = [
951951
e
952952
for e in v
953-
if not (self.min_val <= e <= self.max_val) and e not in self.extras
953+
if not (isinstance(e, int) and self.min_val <= e <= self.max_val)
954+
and e not in self.extras
954955
]
955956

956957
if invalid_els:

packages/python/plotly/_plotly_utils/tests/validators/test_integer_validator.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,18 @@ def validator_aok(request):
3333
return IntegerValidator("prop", "parent", min=-2, max=10, array_ok=True)
3434

3535

36+
@pytest.fixture
37+
def validator_extras():
38+
return IntegerValidator("prop", "parent", min=-2, max=10, extras=["normal", "bold"])
39+
40+
41+
@pytest.fixture
42+
def validator_extras_aok():
43+
return IntegerValidator(
44+
"prop", "parent", min=-2, max=10, array_ok=True, extras=["normal", "bold"]
45+
)
46+
47+
3648
# ### Acceptance ###
3749
@pytest.mark.parametrize("val", [1, -19, 0, -1234])
3850
def test_acceptance(val, validator):
@@ -57,6 +69,27 @@ def test_acceptance_min_max(val, validator_min_max):
5769
assert validator_min_max.validate_coerce(val) == approx(val)
5870

5971

72+
# With extras
73+
@pytest.mark.parametrize("val", ["normal", "bold", 10, -2])
74+
def test_acceptance_extras(val, validator_extras):
75+
assert validator_extras.validate_coerce(val) == val
76+
77+
78+
# Test extras for array_ok
79+
@pytest.mark.parametrize("val", [[10, "normal", "bold"], ["normal"], [10, -2], [5]])
80+
def test_acceptance_extras_array(val, validator_extras_aok):
81+
assert validator_extras_aok.validate_coerce(val) == val
82+
83+
84+
# Test rejection by extras
85+
@pytest.mark.parametrize("val", ["invalid value", "different invalid value", -3, 11])
86+
def test_rejection_extras(val, validator_extras):
87+
with pytest.raises(ValueError) as validation_failure:
88+
validator_extras.validate_coerce(val)
89+
90+
assert "Invalid value" in str(validation_failure.value)
91+
92+
6093
@pytest.mark.parametrize(
6194
"val", [-1.01, -10, 2.1, 3, np.iinfo(int).max, np.iinfo(int).min]
6295
)
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
requests==2.31.0
2+
tenacity==8.2.3
3+
pandas
4+
xarray==2023.12.0
5+
statsmodels
6+
Pillow==10.2.0
7+
pytest==7.4.4
8+
pytz==2023.3.post1
9+
ipython[all]==7.22.0
10+
ipywidgets<8
11+
ipykernel==5.5.3
12+
jupyter==1.0.0
13+
scipy==1.11.4
14+
Shapely==2.0.2
15+
geopandas==0.14.2
16+
pyshp==2.3.1
17+
matplotlib==3.8.2
18+
scikit-image==0.22.0
19+
psutil==5.9.7
20+
kaleido
21+
orjson==3.9.10

0 commit comments

Comments
 (0)