Skip to content

Commit fd58f50

Browse files
Technologicatclaude
andcommitted
Release 2.2.1 — Hotfix
- Add recommended CLI options section to README (D34) - Re-render example graph with --no-defines --concentrate - Add graph0 regeneration instructions as HTML comment - Finalize changelog and bump version to 2.2.1 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent e8fc6db commit fd58f50

6 files changed

Lines changed: 218 additions & 182 deletions

File tree

CHANGELOG.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
# Changelog
22

3-
## 2.2.1 (in progress)
3+
## 2.2.1 (22 March 2026) — *Hotfix*
4+
5+
### Documentation
6+
7+
- **Recommended options in README** — added a section with recommended CLI
8+
options for common use cases: clean uses-only graphs, `fdp` layout for
9+
larger projects, and `--depth 1` for high-level overviews. Re-rendered
10+
the example graph with `--no-defines --concentrate`.
11+
- **`--concentrate` precision caveat** — noted that GraphViz's edge
12+
concentration can produce small gaps at split/merge points.
413

514
### Bug fixes
615

README.md

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ This revival was carried out by [Technologicat](https://github.com/Technologicat
4747
- [Overview](#overview)
4848
- [Usage](#usage)
4949
- [CLI usage](#cli-usage)
50+
- [Recommended options](#recommended-options)
5051
- [Graph depth control](#graph-depth-control)
5152
- [Filtering](#filtering)
5253
- [Call path listing](#call-path-listing)
@@ -73,17 +74,25 @@ This revival was carried out by [Technologicat](https://github.com/Technologicat
7374

7475
# Overview
7576

77+
<!-- To regenerate graph0:
78+
pyan3 tests/orbital/*.py --dot --colored --no-defines --concentrate --file graph0.dot
79+
dot -Tsvg graph0.dot -o graph0.svg
80+
dot -Tpng graph0.dot -o graph0.png
81+
rm graph0.dot
82+
-->
7683
[![Example output](graph0.png "Example: GraphViz rendering of Pyan output (click for .svg)")](graph0.svg)
7784

78-
**Defines** relations are drawn with _dotted gray arrows_.
85+
This example was rendered with the [recommended options](#recommended-options): `--colored --no-defines --concentrate`.
7986

80-
**Uses** relations are drawn with _black solid arrows_. Recursion is indicated by an arrow from a node to itself. [Mutual recursion](https://en.wikipedia.org/wiki/Mutual_recursion#Basic_examples) between nodes X and Y is indicated by a pair of arrows, one pointing from X to Y, and the other from Y to X.
87+
**Uses** relations are drawn with _black solid arrows_. Recursion is indicated by an arrow from a node to itself. [Mutual recursion](https://en.wikipedia.org/wiki/Mutual_recursion#Basic_examples) between nodes X and Y is indicated by a pair of arrows, one pointing from X to Y, and the other from Y to X. With `--concentrate`, bidirectional edges are merged into double-headed arrows.
88+
89+
**Defines** relations (drawn with _dotted gray arrows_) can be enabled with `--defines`.
8190

8291
**Nodes** are always filled, and made translucent to clearly show any arrows passing underneath them. This is especially useful for large graphs with GraphViz's `fdp` filter. If colored output is not enabled, the fill is white.
8392

8493
In **node coloring**, the [HSL](https://en.wikipedia.org/wiki/HSL_and_HSV) color model is used. The **hue** is determined by the _filename_ the node comes from. The **lightness** is determined by _depth of namespace nesting_, with darker meaning more deeply nested. Saturation is constant. The spacing between different hues depends on the number of files analyzed; better results are obtained for fewer files.
8594

86-
**Groups** are filled with translucent gray to avoid clashes with any node color.
95+
**Groups** can be enabled with `--grouped` (and `--nested-groups` for nested subgraph clusters). Groups are filled with translucent gray to avoid clashes with any node color.
8796

8897
The nodes can be **annotated** by _filename and source line number_ information.
8998

@@ -115,6 +124,29 @@ pyan3 *.py --uses --no-defines --colored --grouped --annotated --html >myuses.ht
115124
pyan3 src/ --uses --no-defines --text
116125
```
117126

127+
### Recommended options
128+
129+
For a clean uses-only call graph:
130+
131+
```bash
132+
pyan3 src/*.py --dot --colored --no-defines --concentrate --file output.dot
133+
dot -Tsvg output.dot -o output.svg
134+
```
135+
136+
This omits defines edges (which tend to clutter the graph) and merges bidirectional uses edges into double-headed arrows. The `dot` layout works well for hierarchical call graphs; for larger graphs, `fdp` (force-directed) can produce more readable results:
137+
138+
```bash
139+
pyan3 src/*.py --dot --colored --no-defines --concentrate --graphviz-layout fdp --file output.dot
140+
fdp -Tsvg output.dot -o output.svg
141+
```
142+
143+
For a high-level overview, add `--depth 1` to collapse everything down to modules, classes, and top-level functions:
144+
145+
```bash
146+
pyan3 src/*.py --dot --colored --no-defines --concentrate --depth 1 --file overview.dot
147+
```
148+
149+
118150
### Graph depth control
119151

120152
Collapse the graph to a desired level of detail:

TODO_DEFERRED.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,6 @@ Items with GitHub ticket numbers are tracked externally. The rest are internal n
2828
- **D31: Test suite organization**: Tests are spread across few modules (`test_features.py`, `test_regressions.py`, `test_modvis.py`, `test_writers.py`, `test_analyzer.py`, `test_sphinx.py`, `test_coverage.py`). Consider reorganizing by concern — e.g. separate CLI tests from unit tests, group by module under test.
2929
- **D32: Analyzer module split**: `analyzer.py` is ~2200 lines. Consider splitting into submodules (e.g. visitors, postprocessing, scope handling) without changing the public API.
3030
- **D33: Type annotations for pyan's own code**: Add type annotations to pyan's modules. The analyzer is the largest target (~2200 lines). Would improve IDE support and catch bugs.
31-
- **D34: Document recommended options in README**: The README should include a recommended set of options for common use cases, e.g.:
32-
- `pyan3 src/*.py --dot --colored --no-defines --concentrate --file output.dot` for a clean uses-only call graph
33-
- Laying out with `fdp` (works well with Pyan call graphs): `fdp -Txdot output.dot -o output.xdot`
34-
- `--depth 1` for module+class/function overview, default depth for full detail
35-
36-
Discovered during raven-xdot-viewer dark mode contrast fix.
3731

3832
## Done
3933

@@ -51,4 +45,5 @@ Discovered during raven-xdot-viewer dark mode contrast fix.
5145
- **D12**: Tuple unpacking with `Starred`
5246
- **D16**: Review flake8/ruff warnings (`1af4e31`..`9c9c45c`)
5347
- **D17**: README example graph
48+
- **D34**: Document recommended options in README
5449
- **D27**: Directional graph filtering (`1e096ec`)

graph0.png

-33.9 KB
Loading

0 commit comments

Comments
 (0)