Skip to content

Commit c4132c6

Browse files
hmgaudeckertimmens
andauthored
Add support for plotly >= 6 (#608)
--------- Co-authored-by: Tim Mensinger <mensingertim@gmail.com>
1 parent ca72d02 commit c4132c6

12 files changed

Lines changed: 179 additions & 19 deletions

File tree

.github/workflows/main.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,25 @@ jobs:
127127
run: |
128128
micromamba activate optimagic
129129
pytest -m "not slow and not jax"
130+
run-tests-with-old-plotly:
131+
name: Run tests for ubuntu-latest on 3.10 with plotly < 6 and kaleido < 0.3
132+
runs-on: ubuntu-latest
133+
strategy:
134+
fail-fast: false
135+
steps:
136+
- uses: actions/checkout@v4
137+
- name: create build environment
138+
uses: mamba-org/setup-micromamba@v1
139+
with:
140+
environment-file: ./.tools/envs/testenv-plotly.yml
141+
cache-environment: true
142+
create-args: |
143+
python=3.10
144+
- name: run pytest
145+
shell: bash -l {0}
146+
run: |
147+
micromamba activate optimagic
148+
pytest -m "not slow and not jax"
130149
code-in-docs:
131150
name: Run code snippets in documentation
132151
runs-on: ubuntu-latest

.tools/envs/testenv-linux.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ dependencies:
1818
- joblib # run, tests
1919
- numpy >= 2 # run, tests
2020
- pandas # run, tests
21-
- plotly<6.0.0 # run, tests
21+
- plotly>=6.2 # run, tests
2222
- pybaum>=0.1.2 # run, tests
2323
- scipy>=1.2.1 # run, tests
2424
- sqlalchemy # run, tests
@@ -33,7 +33,7 @@ dependencies:
3333
- DFO-LS>=1.5.3 # dev, tests
3434
- Py-BOBYQA # dev, tests
3535
- fides==0.7.4 # dev, tests
36-
- kaleido # dev, tests
36+
- kaleido>=1.0 # dev, tests
3737
- pandas-stubs # dev, tests
3838
- types-cffi # dev, tests
3939
- types-openpyxl # dev, tests

.tools/envs/testenv-numpy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ dependencies:
1616
- statsmodels # dev, tests
1717
- cloudpickle # run, tests
1818
- joblib # run, tests
19-
- plotly<6.0.0 # run, tests
19+
- plotly>=6.2 # run, tests
2020
- pybaum>=0.1.2 # run, tests
2121
- scipy>=1.2.1 # run, tests
2222
- sqlalchemy # run, tests
@@ -31,7 +31,7 @@ dependencies:
3131
- DFO-LS>=1.5.3 # dev, tests
3232
- Py-BOBYQA # dev, tests
3333
- fides==0.7.4 # dev, tests
34-
- kaleido # dev, tests
34+
- kaleido>=1.0 # dev, tests
3535
- types-cffi # dev, tests
3636
- types-openpyxl # dev, tests
3737
- types-jinja2 # dev, tests

.tools/envs/testenv-others.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ dependencies:
1616
- joblib # run, tests
1717
- numpy >= 2 # run, tests
1818
- pandas # run, tests
19-
- plotly<6.0.0 # run, tests
19+
- plotly>=6.2 # run, tests
2020
- pybaum>=0.1.2 # run, tests
2121
- scipy>=1.2.1 # run, tests
2222
- sqlalchemy # run, tests
@@ -31,7 +31,7 @@ dependencies:
3131
- DFO-LS>=1.5.3 # dev, tests
3232
- Py-BOBYQA # dev, tests
3333
- fides==0.7.4 # dev, tests
34-
- kaleido # dev, tests
34+
- kaleido>=1.0 # dev, tests
3535
- pandas-stubs # dev, tests
3636
- types-cffi # dev, tests
3737
- types-openpyxl # dev, tests

.tools/envs/testenv-pandas.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ dependencies:
1616
- statsmodels # dev, tests
1717
- cloudpickle # run, tests
1818
- joblib # run, tests
19-
- plotly<6.0.0 # run, tests
19+
- plotly>=6.2 # run, tests
2020
- pybaum>=0.1.2 # run, tests
2121
- scipy>=1.2.1 # run, tests
2222
- sqlalchemy # run, tests
@@ -31,7 +31,7 @@ dependencies:
3131
- DFO-LS>=1.5.3 # dev, tests
3232
- Py-BOBYQA # dev, tests
3333
- fides==0.7.4 # dev, tests
34-
- kaleido # dev, tests
34+
- kaleido>=1.0 # dev, tests
3535
- types-cffi # dev, tests
3636
- types-openpyxl # dev, tests
3737
- types-jinja2 # dev, tests

.tools/envs/testenv-plotly.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
name: optimagic
3+
channels:
4+
- conda-forge
5+
- nodefaults
6+
dependencies:
7+
- plotly<6
8+
- cyipopt>=1.4.0 # dev, tests
9+
- pygmo>=2.19.0 # dev, tests, docs
10+
- nlopt # dev, tests, docs
11+
- pip # dev, tests, docs
12+
- pytest # dev, tests
13+
- pytest-cov # tests
14+
- pytest-xdist # dev, tests
15+
- statsmodels # dev, tests
16+
- cloudpickle # run, tests
17+
- joblib # run, tests
18+
- numpy >= 2 # run, tests
19+
- pandas # run, tests
20+
- pybaum>=0.1.2 # run, tests
21+
- scipy>=1.2.1 # run, tests
22+
- sqlalchemy # run, tests
23+
- seaborn # dev, tests
24+
- mypy=1.14.1 # dev, tests
25+
- pyyaml # dev, tests
26+
- jinja2 # dev, tests
27+
- annotated-types # dev, tests
28+
- iminuit # dev, tests
29+
- pip: # dev, tests, docs
30+
- nevergrad # dev, tests
31+
- DFO-LS>=1.5.3 # dev, tests
32+
- Py-BOBYQA # dev, tests
33+
- fides==0.7.4 # dev, tests
34+
- pandas-stubs # dev, tests
35+
- types-cffi # dev, tests
36+
- types-openpyxl # dev, tests
37+
- types-jinja2 # dev, tests
38+
- sqlalchemy-stubs # dev, tests
39+
- sphinxcontrib-mermaid # dev, tests, docs
40+
- -e ../../
41+
- kaleido<0.3

.tools/update_envs.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ def main() -> None:
2424

2525
# find index to insert additional dependencies
2626
_insert_idx = [i for i, line in enumerate(lines) if "dependencies:" in line][0] + 1
27+
_insert_idx_pip = [i for i, line in enumerate(lines) if " - pip:" in line][0] + 1
2728

2829
## linux
2930
test_env_linux = deepcopy(test_env)
@@ -46,14 +47,27 @@ def main() -> None:
4647
test_env_numpy.insert(_insert_idx, " - numpy<2")
4748
test_env_numpy.insert(_insert_idx, " - pandas>=2")
4849

50+
## test environment for plotly < 6, kaleido < 1.0
51+
test_env_plotly = deepcopy(test_env)
52+
for pkg in ["plotly", "kaleido"]:
53+
test_env_plotly = [line for line in test_env_plotly if pkg not in line]
54+
test_env_plotly.insert(_insert_idx, " - plotly<6")
55+
test_env_plotly.insert(_insert_idx_pip, " - kaleido<0.3")
56+
4957
# test environment for documentation
5058
docs_env = [line for line in lines if _keep_line(line, "docs")]
5159
docs_env.append(" - -e ../../") # add local installation
5260

5361
# write environments
5462
for name, env in zip(
55-
["linux", "others", "pandas", "numpy"],
56-
[test_env_linux, test_env_others, test_env_pandas, test_env_numpy],
63+
["linux", "others", "pandas", "numpy", "plotly"],
64+
[
65+
test_env_linux,
66+
test_env_others,
67+
test_env_pandas,
68+
test_env_numpy,
69+
test_env_plotly,
70+
],
5771
strict=False,
5872
):
5973
# Specify newline to avoid wrong line endings on Windows.

docs/rtd_environment.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ dependencies:
2626
- scipy
2727
- patsy
2828
- joblib
29-
- plotly
29+
- plotly>=6.2
3030
- nlopt
3131
- annotated-types
3232
- pygmo>=2.19.0
3333
- pip:
3434
- ../
35-
- kaleido
35+
- kaleido>=1.0
3636
- Py-BOBYQA
3737
- DFO-LS
3838
- pandas-stubs # dev, tests

environment.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ dependencies:
2020
- joblib # run, tests
2121
- numpy >= 2 # run, tests
2222
- pandas # run, tests
23-
- plotly<6.0.0 # run, tests
23+
- plotly>=6.2 # run, tests
2424
- pybaum>=0.1.2 # run, tests
2525
- scipy>=1.2.1 # run, tests
2626
- sqlalchemy # run, tests
@@ -43,7 +43,7 @@ dependencies:
4343
- DFO-LS>=1.5.3 # dev, tests
4444
- Py-BOBYQA # dev, tests
4545
- fides==0.7.4 # dev, tests
46-
- kaleido # dev, tests
46+
- kaleido>=1.0 # dev, tests
4747
- pre-commit>=4 # dev
4848
- -e . # dev
4949
# type stubs

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ dependencies = [
1010
"joblib",
1111
"numpy",
1212
"pandas",
13-
"plotly<6.0.0",
13+
"plotly",
1414
"pybaum>=0.1.2",
1515
"scipy>=1.2.1",
1616
"sqlalchemy>=1.3",

0 commit comments

Comments
 (0)