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

Abierto
#2,533 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
64/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
python
Área
cli

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Python
Estrellas
654
Forks
258
Merge medio
2 d 7 h
PR fusionados (30 d)
39

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de pymc-devs/pytensor

Todos los issues de pymc-devs/pytensor

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.