You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
10
10
### Added
11
11
12
12
-**Hide nodes in the viewer:** Option to exclude selected nodes from the interactive visualization so dense or branching tensor networks stay readable without changing the underlying graph data.
13
+
-**Public diagnostics contract:** Added package-specific exceptions (`TensorNetworkVizError`, `VisualizationInputError`, `AxisConfigurationError`, `UnsupportedEngineError`, `TensorDataError`, `MissingOptionalDependencyError`) and a documented `tensor_network_viz` logger with a default `NullHandler`.
14
+
15
+
### Changed
16
+
17
+
-**Typing and controller structure:** Fixed the interactive tensor-inspector typing issue reported by `pyright`, extracted the linked tensor-inspector controller, and split tensor-element rendering/color-scaling helpers into a dedicated module to keep responsibilities narrower.
18
+
-**Verification workflow docs:** README, guide, and contribution docs now document the `.venv`-first verification flow (`quality`, `tests`, `smoke`, `package`) used before release and CI troubleshooting.
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+29Lines changed: 29 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,6 +49,24 @@ With the project venv (Windows):
49
49
50
50
Add tests for new features or bug fixes. All tests must pass before opening a PR.
51
51
52
+
Preferred full verification flow from the project `.venv`:
53
+
54
+
```powershell
55
+
.\.venv\Scripts\python scripts\verify.py quality
56
+
.\.venv\Scripts\python scripts\verify.py tests
57
+
.\.venv\Scripts\python scripts\verify.py smoke
58
+
.\.venv\Scripts\python scripts\verify.py package
59
+
```
60
+
61
+
On Linux/macOS with the venv activated:
62
+
63
+
```bash
64
+
python scripts/verify.py quality
65
+
python scripts/verify.py tests
66
+
python scripts/verify.py smoke
67
+
python scripts/verify.py package
68
+
```
69
+
52
70
### Optional: focused smoke and performance runs
53
71
54
72
Pytest markers are available for the render-specific regression checks:
@@ -149,9 +167,18 @@ python scripts/verify.py
149
167
-**Target:** Python 3.11+
150
168
-**Ruff rules:** E, F, I, B, UP, C4, SIM
151
169
-**Typing:** Use type hints on public functions and modules; the codebase is `py.typed`
170
+
-**Exceptions:** prefer `tensor_network_viz.exceptions` classes at public boundaries instead of raw `ValueError` / `ImportError` when you are surfacing user-facing library errors
171
+
-**Logging:** use the `tensor_network_viz` logger; never call `logging.basicConfig()` from library code
152
172
153
173
Run `python scripts/verify.py` before committing. If you prefer, you can still run `ruff`, `pyright`, and `pytest` individually.
154
174
175
+
When you finish a Python task locally, run:
176
+
177
+
```powershell
178
+
.\.venv\Scripts\python -m ruff check . --fix
179
+
.\.venv\Scripts\python -m ruff format .
180
+
```
181
+
155
182
## Opening Useful Issues
156
183
157
184
Use the [issue tracker](https://github.com/DOKOS-TAYOS/Tensor-Network-Visualization/issues).
@@ -210,6 +237,8 @@ Before opening a pull request, confirm:
210
237
-`ruff check .` and `ruff format .` pass
211
238
-`pyright` passes
212
239
-`pytest` passes
240
+
-`scripts/verify.py smoke` passes
241
+
-`scripts/verify.py package` passes
213
242
- New code has type hints and tests where appropriate
214
243
- Documentation and examples are updated if behavior changed
215
244
- PR description explains the change and links related issues
| Hover tooltips do nothing | Use an interactive Matplotlib backend; hover is not useful for PNG-only runs. |
394
417
| Big graphs are slow | Set `tensor_label_refinement="never"`, reduce `layout_iterations`, or pass `positions`. |
395
418
|`Unsupported tensor network engine`| Install the matching extra or pass the correct backend object. |
419
+
|`AxisConfigurationError` when passing `ax`| Use a 2D axis for `view="2d"`, a 3D axis for `view="3d"`, and only pass `ax` to `show_tensor_elements(...)` for a single tensor. |
396
420
|`show_tensor_elements(...)` fails on TensorKrowch nodes | Materialize the node tensors first; shape-only nodes do not expose element values. |
397
421
|`show_tensor_elements(...)` fails on manual `pair_tensor(...)` lists | Use an `EinsumTrace` with live tensors instead; manual trace steps only describe contractions. |
398
422
| Blank / duplicate Jupyter figure | Assign `fig, ax = show_tensor_network(...)` instead of leaving the tuple as the last line. |
0 commit comments