Skip to content

[Backport] Move visualize overloads to package extension; bump to v0.21.2#369

Merged
mtfishman merged 1 commit into
release-0.21from
mf/0.21-visualize-ext-backport
May 13, 2026
Merged

[Backport] Move visualize overloads to package extension; bump to v0.21.2#369
mtfishman merged 1 commit into
release-0.21from
mf/0.21-visualize-ext-backport

Conversation

@mtfishman
Copy link
Copy Markdown
Member

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) adds the AbstractNamedGraph overload via its own NamedGraphsITensorVisualizationBaseExt.
  • DataGraphs.jl v0.4.1 (#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.10.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.

…21.2

Backport of #367 onto the release-0.21 branch.

Replace 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 (PR ITensor/NamedGraphs.jl#166) adds the
  `AbstractNamedGraph` overload via its own
  `NamedGraphsITensorVisualizationBaseExt`.
- `DataGraphs.jl` v0.4.1 (PR 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.

Bumps `[compat]` floors to `NamedGraphs = "0.11.1"` and
`DataGraphs = "0.4.1"`, and bumps package version from 0.21.1 to 0.21.2.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@mtfishman mtfishman closed this May 13, 2026
@mtfishman mtfishman deleted the mf/0.21-visualize-ext-backport branch May 13, 2026 00:42
@mtfishman mtfishman restored the mf/0.21-visualize-ext-backport branch May 13, 2026 00:46
@mtfishman mtfishman reopened this May 13, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.89%. Comparing base (9a4c4a7) to head (269a7f2).

Additional details and impacted files
@@               Coverage Diff                @@
##           release-0.21     #369      +/-   ##
================================================
+ Coverage         74.65%   74.89%   +0.24%     
================================================
  Files                63       63              
  Lines              3101     3095       -6     
================================================
+ Hits               2315     2318       +3     
+ Misses              786      777       -9     
Flag Coverage Δ
docs 48.30% <0.00%> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mtfishman mtfishman merged commit b403745 into release-0.21 May 13, 2026
20 of 29 checks passed
@mtfishman mtfishman deleted the mf/0.21-visualize-ext-backport branch May 13, 2026 01:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant