Commit b403745
[Backport] Move visualize overloads to package extension; bump to v0.21.2 (#369)
## Summary
Backport of #367 onto the new `release-0.21` branch.
Replaces the in-source `visualize(::AbstractITensorNetwork, ...)` method
(in `src/abstractitensornetwork.jl`) and the two type-piracy methods on
`AbstractNamedGraph` / `AbstractDataGraph` (in `src/visualize.jl`) with
a single `ITensorNetworksITensorVisualizationBaseExt` package extension
that overloads `visualize(::AbstractITensorNetwork, ...)` only. The
type-piracy methods migrate upstream:
- `NamedGraphs.jl` v0.11.1
([#166](ITensor/NamedGraphs.jl#166)) adds the
`AbstractNamedGraph` overload via its own
`NamedGraphsITensorVisualizationBaseExt`.
- `DataGraphs.jl` v0.4.1
([#119](ITensor/DataGraphs.jl#119)) adds the
`AbstractDataGraph` overload via
`DataGraphsITensorVisualizationBaseExt`.
## Motivation for backporting
Once NamedGraphs v0.11.1 and DataGraphs v0.4.1 register, any user on
legacy ITensorNetworks v0.21.x alongside the new NamedGraphs/DataGraphs
would hit method-overwrite warnings on the two type-pirated `visualize`
methods. v0.22 may take a while to ship (its prerelease accumulator is
still receiving changes), so we publish a v0.21.2 patch carrying the
equivalent fix.
## Changes
- Adds `ext/ITensorNetworksITensorVisualizationBaseExt/`.
- Removes `src/visualize.jl` (and its `include` from
`src/ITensorNetworks.jl`).
- Removes the `visualize(::AbstractITensorNetwork, ...)` block from
`src/abstractitensornetwork.jl`.
- Adds `ITensorVisualizationBase` to `[weakdeps]` / `[extensions]` /
`[compat]`.
- Bumps `[compat]` floors: `NamedGraphs = "0.11.1"`, `DataGraphs =
"0.4.1"`.
- Bumps package version `0.21.1` → `0.21.2`.
## Release-branch workflow
This is the first PR against the new `release-0.21` branch, modeled on
Julia's `release-X.Y` convention (simplified — no
`backports-release-X.Y` staging tier, since we expect only 1–2 backports
before v0.22 ships).
After merge, registration needs to be triggered manually via a
`/register <merge-sha>` commit comment on the merge commit (the
`Registrator.yml` workflow's `push` trigger only fires on
`main`/`master` by default; the `issue_comment` path uses `force=true`
and works regardless of branch).
## Status
CI will be red until NamedGraphs v0.11.1 and DataGraphs v0.4.1 actually
land in the registry. Opening the PR now mostly for tracking.
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 9a4c4a7 commit b403745
7 files changed
Lines changed: 44 additions & 52 deletions
File tree
- ext/ITensorNetworksITensorVisualizationBaseExt
- src
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| 46 | + | |
45 | 47 | | |
46 | 48 | | |
47 | 49 | | |
| |||
52 | 54 | | |
53 | 55 | | |
54 | 56 | | |
55 | | - | |
| 57 | + | |
56 | 58 | | |
57 | 59 | | |
58 | 60 | | |
59 | 61 | | |
| 62 | + | |
60 | 63 | | |
61 | 64 | | |
62 | 65 | | |
63 | 66 | | |
64 | 67 | | |
65 | 68 | | |
66 | | - | |
| 69 | + | |
67 | 70 | | |
68 | 71 | | |
69 | 72 | | |
| |||
Lines changed: 22 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | 5 | | |
7 | 6 | | |
8 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
791 | 791 | | |
792 | 792 | | |
793 | 793 | | |
794 | | - | |
795 | | - | |
796 | | - | |
797 | | - | |
798 | | - | |
799 | | - | |
800 | | - | |
801 | | - | |
802 | | - | |
803 | | - | |
804 | | - | |
805 | | - | |
806 | | - | |
807 | | - | |
808 | | - | |
809 | | - | |
810 | | - | |
811 | | - | |
812 | 794 | | |
813 | 795 | | |
814 | 796 | | |
| |||
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
41 | | - | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| |||
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
| 51 | + | |
50 | 52 | | |
51 | 53 | | |
52 | 54 | | |
53 | 55 | | |
54 | 56 | | |
55 | | - | |
| 57 | + | |
56 | 58 | | |
57 | 59 | | |
58 | 60 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
0 commit comments