|
| 1 | +1. Replace (almost) all imports of `plotly.graph_objs` with `plotly.graph_objects` in `tests/**/*.py`. |
| 2 | + - Done. |
| 3 | +2. Move plotly/graph_objects to ./tmp; rename plotly/graph_objs and plotly/graph_objects; move ./tmp to plotly/graph_objs. |
| 4 | +3. Replace all instances of `graph_objs` with `graph_objects` in `bin/codegen/*.py`. |
| 5 | + - `sed -I .bak -e 's/graph_objs/graph_objects/g' bin/codegen/*.py` |
| 6 | + - `rm bin/codegen/*.bak` |
| 7 | +4. Delete `plotly.graph_objects` and run `make generate` to regenerate. |
| 8 | +5. Try `python -m pytest tests/test_import.py`. |
| 9 | + |
| 10 | +---------------------------------------- |
| 11 | + |
1 | 12 | - Can we get rid of `plotly/api` entirely? |
2 | 13 | - Can we eliminate `plotly/conftest.py` and fix breaking tests? |
3 | 14 | - Why the distinction between `graph_objects` and `graph_objs`? |
4 | 15 | - Historical reasons, but `graph_objs` is widely used. |
5 | 16 | - Generate code into `graph_objects` and have `graph_objs` point at it |
6 | 17 | instead of vice versa. |
7 | | -- Switch focus for now to the main documentation in `./doc`. |
8 | | - |
9 | | -- Ran this to create a `.ipynb` file: |
10 | | - |
11 | | -``` |
12 | | -jupytext --to ipynb --execute --output pages/strip-charts.ipynb doc/python/strip-charts.md |
13 | | -``` |
14 | | - |
15 | | -- Loading the notebook like this, the charts don't show up: |
16 | | - |
17 | | -``` |
18 | | -jupyter notebook pages/strip-charts.ipynb |
19 | | -``` |
20 | | - |
21 | | -- Had to add this in a cell at the top: |
22 | | - |
23 | | -``` |
24 | | -import plotly.io as pio |
25 | | -pio.renderers.default = "notebook" |
26 | | -``` |
27 | | - |
28 | | -- `mkdocs build` produces many (many) lines like this that did *not* appear |
29 | | - before `mkdocs-jupyter` was added to `mkdocs.yml`: |
30 | | - |
31 | | -``` |
32 | | -[WARNING] Div at /var/folders/w2/l51fjbjd25n9zbwkz9fw9jp00000gn/T/tmpgvlxh1sq line 3 column 1 unclosed at /var/folders/w2/l51fjbjd25n9zbwkz9fw9jp00000gn/T/tmpgvlxh1sq line 6 column 1, closing implicitly. |
33 | | -``` |
34 | | - |
35 | | -- But with the `plotly.io` line, the `.ipynb` file is converted to usable HTML. |
36 | | - - Still clearly originated as a notebook, but the chart shows up. |
0 commit comments