AGENT SKILL

visualization-and-ui

Route plotting, display, UI controls, and scene-backed scalar visualization through the current phi.vis public APIs.

License 许可
MIT
最近更新
2026-09-03
Stars
★ 351
Forks
27

01 前言 Front Matter

name
visualization-and-ui
license
MIT
metadata
{ "disco-role": "operating" }
description
Route plotting, display, UI controls, and scene-backed scalar visualization through the current phi.vis public APIs.
disable-model-invocation
true

02 资源文件 3

03 SKILL.md 正文

Visualization and UI

Use this sub-skill when a task involves rendering fields, tensors, geometries, histograms, animations, scalar training logs, or interactive display/control surfaces through phi.vis.

First decisions

  1. Use the current public surface. Prefer import phi.vis as vis. from phi.flow import * gives show, plot, and control, but not vis.close, load_scalars, plot_scalars, show_hist, overlay, or write_image; import phi.vis explicitly whenever you need the figure closer or scalar-log helpers.
  2. Do not call view(). Current phi.flow and phi.vis do not export a public view symbol. Older visualization, Dash, and console docs still contain view(...) examples; translate those to vis.show(...) or vis.plot(...) and keep any control(...) calls as script-level assignment declarations.
  3. Choose a renderer deliberately. Use Matplotlib for stable static/headless 1D and 2D plots, Plotly for browser/notebook-friendly and 3D plots, and treat console/ascii plotting as unavailable for verification-critical workflows in this version.
  4. Close figures in scripts and tests. Store the result of vis.plot(...), save or inspect it, then call vis.close(fig). For vis.show(...), expect a display side effect; avoid it in headless automation unless MPLBACKEND=Agg is set.
  5. Use scene scalars through load_scalars(). Prefer curve = vis.load_scalars(scene, "loss") followed by vis.plot(curve, ...). plot_scalars() remains available but is deprecated and Matplotlib-only.

Verified public entry points

  • vis.show(*fields, lib=None, row_dims=None, col_dims=batch, animate=None, overlay="overlay", title=None, size=None, same_scale=True, log_dims="", show_color_bar=True, color=None, alpha=1.0, err=0.0, frame_time=100, repeat=True, plt_params=None, max_subfigures=20)
  • vis.plot(...) has the same live signature family as show(...) and returns a native figure object or animation instead of immediately displaying it.
  • vis.close(figure=None) closes a figure created by vis.plot(); without an argument, it closes the most recent phi.vis figure.
  • vis.show_hist(data, bins=math.instance(bins=20), weights=1, same_bins=None) builds a histogram and displays it through show().
  • vis.control(value, range=None, description="", **kwargs) only accepts primitive int, float, bool, or str values and must be used in a variable assignment statement.
  • vis.load_scalars(scene, name, prefix="log_", suffix=".txt", x="steps", entries_dim=(iterationˢ), batch_dim=(batchᵇ)) reads log_<name>.txt curves from a single scene path or Scene.
  • vis.plot_scalars(*args, **kwargs) delegates to the Matplotlib scalar plot helper and emits a deprecation warning; use load_scalars() plus plot() for new code.

Route by task

  • Static field/tensor/geometry figure: read workflows.md, then use vis.plot(..., lib="matplotlib") or lib="plotly".
  • Quick human display: use vis.show(field_or_tensor, lib="matplotlib" | "plotly"); for an existing figure, call vis.show(lib=...) only after a previous vis.plot().
  • Animations: pass animate="time" or another dimension to vis.plot() / vis.show() and set frame_time; prefer Plotly or notebook display for interactive review, Matplotlib for script-side objects.
  • Subplots / batches: use row_dims, col_dims, overlay, title, same_scale, max_subfigures, and size; for many batches, slice or raise max_subfigures deliberately.
  • Scalar logs from scenes: read workflows.md; keep log files named log_<name>.txt.
  • Controls: keep learning_rate = vis.control(...) near the top-level script scope; do not rely on control() alone to launch a GUI.
  • Problems or stale examples: read troubleshooting.md.

Smoke check

Run the bundled smoke helper in an environment where phiflow is installed:

python sub-skills/visualization-and-ui/scripts/plot_smoke.py

The helper verifies the show/plot signature family, absence of public view(), Matplotlib and Plotly figure creation, control() assignment semantics, histogram display path, scene scalar loading, deprecated plot_scalars(), and figure cleanup.

04 同仓库更多 Skills

VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-triton-opt

Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-solve

END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-skill

PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-pattern-fusion

Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-orchestrate

Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-feedback

Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).

★ 351