Skip to content

Commit bd42d16

Browse files
committed
break/REFACT(plot) thme.include_steps --> show_steps
1 parent 4c970a9 commit bd42d16

File tree

5 files changed

+14
-15
lines changed

5 files changed

+14
-15
lines changed

CHANGES.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ PLOT: Badges, StyleStacks, refact Themes, fix style mis-classifications, don't p
383383

384384
+ UPD: dot no plot Steps by default; use this :ref:`plot-customizations` to re-enable them::
385385

386-
plottable.plot(plotter=Plotter(include_steps=True))
386+
plottable.plot(plotter=Plotter(show_steps=True))
387387

388388
+ FEAT: now `operations` are also :term:`plottable`.
389389

docs/source/pipelines.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ into the plot:
9090

9191
.. graphtik::
9292

93-
>>> dot = out.plot(theme={"include_steps": True})
93+
>>> dot = out.plot(theme={"show_steps": True})
9494

9595
.. tip:
9696
Read :ref:`plot-customizations` to understand the trick with the :term:`plotter`.

docs/source/plotting.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ each one capable to producing diagrams with increasing complexity.
4242

4343
For instance, when a pipeline has just been composed, plotting it will
4444
come out bare bone, with just the 2 types of nodes (data & operations), their
45-
dependencies, and (optionally, if :term:`plot theme` ``include_steps`` is true)
45+
dependencies, and (optionally, if :term:`plot theme` ``show_steps`` is true)
4646
the sequence of the execution-steps of the :term:`plan`.
4747

4848
.. image:: images/barebone_3ops.svg
@@ -133,13 +133,13 @@ ordered by breadth of the effects (most broadly effecting method at the top):
133133
3. Pass `theme` or `plotter` arguments when calling :meth:`.Plottable.plot()`::
134134

135135
pipeline.plot(plotter=Plotter(kw_legend=None))
136-
pipeline.plot(theme=Theme(include_steps=True)
136+
pipeline.plot(theme=Theme(show_steps=True)
137137

138138
You may clone and customize an existing plotter, to preserve any pre-existing
139139
customizations::
140140

141141
active_plotter = get_active_plotter()
142-
pipeline.plot(theme={"include_steps": True})
142+
pipeline.plot(theme={"show_steps": True})
143143

144144
... OR::
145145

graphtik/plot.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,6 @@ class Theme:
577577
"bgcolor": "#cc5500",
578578
"color": "white",
579579
"URL": "https://graphtik.readthedocs.io/en/latest/arch.html#term-returns-dictionary",
580-
581580
},
582581
}
583582
}
@@ -698,7 +697,7 @@ class Theme:
698697
## Other
699698
##
700699

701-
include_steps = False
700+
show_steps = False
702701
kw_step = {
703702
"style": "dotted", # Note: Step styles are not *remerged*.`
704703
"color": Ref("steps_color"),
@@ -1119,7 +1118,7 @@ def build_pydot(self, plot_args: PlotArgs) -> pydot.Dot:
11191118

11201119
## Draw steps sequence, if it's worth it.
11211120
#
1122-
if steps and theme.include_steps and len(steps) > 1:
1121+
if steps and theme.show_steps and len(steps) > 1:
11231122
it1 = iter(steps)
11241123
it2 = iter(steps)
11251124
next(it2)

test/test_plot.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ def _check_common_end(s1, s2, clip_index):
254254
assert s1 == s2
255255

256256

257-
@active_plotter_plugged(Plotter(include_steps=True))
257+
@active_plotter_plugged(Plotter(show_steps=True))
258258
def test_plotters_hierarchy(pipeline: Pipeline, inputs, outputs):
259259
# Plotting original network, no plan.
260260
base_dot = str(pipeline.plot(inputs=inputs, outputs=outputs))
@@ -390,9 +390,9 @@ def test_Theme_withset():
390390
p2 = p.withset()
391391
assert p is not p2
392392

393-
p3 = p.withset(include_steps=True)
394-
assert p3.include_steps
395-
assert not p.include_steps
393+
p3 = p.withset(show_steps=True)
394+
assert p3.show_steps
395+
assert not p.show_steps
396396

397397

398398
def test_Plotter_with_styles():
@@ -401,9 +401,9 @@ def test_Plotter_with_styles():
401401
assert p is not p2
402402
assert p.default_theme is not p2.default_theme
403403

404-
p3 = p.with_styles(include_steps=True)
405-
assert p3.default_theme.include_steps
406-
assert not p.default_theme.include_steps
404+
p3 = p.with_styles(show_steps=True)
405+
assert p3.default_theme.show_steps
406+
assert not p.default_theme.show_steps
407407

408408

409409
def test_StylesStack_expansion_ok():

0 commit comments

Comments
 (0)