Emit flat/to_polars directly from the CSR store
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 68/100
Línea de trabajo
Start with LinearExpression.flat and to_polars in linopy/expressions.py, then read csr_to_term_arrays in linopy/csr.py and CSRConstraint.to_polars in linopy/constraints.py as the stated precedent. Trace Grid.indexer, strides, and indexes to assemble the coordinate columns. Done means CSR-backed expressions emit the compact canonical rows directly and flat shares that path without dense expansion.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
[!NOTE]
The following content was generated by AI.
Describe the feature you'd like to see
Emit flat and to_polars directly from the CSR store, without building the dense rectangle first. Child of #756.
LinearExpression.flat (linopy/expressions.py:2612) and to_polars (2693) both read self.data, expand to the padded coord_dims x _term rectangle, convert to a long frame and then mask the padding straight back out. For a CSR-backed expression that is a round trip through exactly the representation the long format is trying to reach.
This matters twice: it is the export boundary, and it is the natural way to inspect a sparse expression, so it currently doubles as a densification trap.
Implementation ideas
csr_to_term_arrays (linopy/csr.py:506-532) already produces the flat term arrays. The work is to assemble the coordinate columns from Grid (indexer, strides, indexes) and emit the polars frame directly, then have flat share that path.
CSRConstraint.to_polars (linopy/constraints.py:1271) is the existing precedent on the constraint side and should be the model for the expression side.
Note that a CSR-backed result is compact canonical form, so the emitted row count legitimately differs from the dense path where explicit zeros were pruned. See #925.
- Lenguaje dominante
- Python
- Estrellas
- 259
- Forks
- 89
- Merge medio
- 1 d 18 h
- PR fusionados (30 d)
- 26
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de PyPSA/linopy
-
bug solver interface
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día
-
refactor sparse
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
Los mantenedores suelen responder en 1 día
-
Meta: separate dense and sparse stores from the expression and constraint frontendPosiblemente ocupada @Rishabhkanhaiya la tomó hace 4 días. Abiertodiscussion refactor sparse
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
PyPSA/linopy#1019 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
refactor sparse
Dificultad 4/5 3-5 días Aptitud para principiantes 38/100
Los mantenedores suelen responder en 1 día
-
Xpress missing _license_probe: licensed_solvers includes xpress with an out-of-date licence, breaking local testsPosiblemente ocupada @FabianHofmann la tomó hace 13 días. Abiertobug solver interface
Dificultad 4/5 3-5 días Aptitud para principiantes 58/100
Los mantenedores suelen responder en 1 día
Todos los issues de PyPSA/linopy
Issues similares
-
Broken links found in docsAbiertodocs pydanty:is-working
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
pydantic/pydantic-ai#10113 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
GreedyBear-Project/GreedyBear#1727 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
ARM-software/CMSIS-DSP#354 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
kiat/codeAssist#391 ·
-
needs triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
darnitdevorg/darnit#587 ·
Los mantenedores suelen responder en 1 día