ENH: make pytensor-cache list pipeable (one record per line)

Aperta
#2,533 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
64/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python
Ambito
cli

Direzione di ricerca

Find the pytensor-cache list command and read the related change in #2532, along with the convention in #2531. Update the output so each compiled module has one tab-separated line with its path first, directory size, and age; check whether aggregate output belongs on stderr or behind --summary. Done means the listed records can be consumed uniformly by tools such as grep, awk, and fzf.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Description

The current list output is a multi-section aligned report. Facts from a real cache (323 modules, 68 MB):

  • The compile-time column is nans for every module: it is computed from mod.c and .so mtimes, which cache-hit entries do not both have.
  • Sizes shown are key.pkl sizes only; the .so files, which hold the actual bulk, have no size column.
  • Module age is not shown.
  • The multiple-ops case goes to a separate table, so lines cannot be uniformly consumed by grep/awk/fzf.
Proposal

One line per compiled module, tab-separated, path first:

<key_dir_path>\t<ops>\t<dir_size>\t<age>
  • Path first so column 1 feeds fzf, xargs rm -rf, awk '{print $1}'.
  • Dir size (not just key size) and age answer "what is this, how big, how old".
  • Compile time is dropped unless it can be computed reliably.
  • Aggregate views (op-class counts, big-key report, 0-op summary) move to stderr, per the convention of #2531, or behind --summary.

Use cases: pytensor-cache list | fzf --preview 'ls -la {1}', ... | grep Elemwise, bloat hunting with sort. Builds on #2532; a --json flag could be a follow-up.

Lingua principale
Python
Stelle
654
Fork
258
Merge medio
2g 7h
PR unite (30g)
39

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di pymc-devs/pytensor

Tutte le issue di pymc-devs/pytensor

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.