Mesh.get_obstruction_mask_slice cuts the time axis for 3D slices
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 1/5
- Tiempo estimado
- Menos de una hora
- Aptitud para principiantes
- 90/100
Línea de trabajo
Lee fdsreader/fds_classes/mesh.py en get_obstruction_mask_slice() (alrededor de la línea 80), donde se construye mask_indices[orientation], y compáralo con Slice.to_global(masked=True), donde la máscara se transmita contra los datos del slice. Implementa la devolución anticipada para orientation == 0 usando self.get_obstruction_mask(subslice.times, cell_centered=cell_centered). Significa que un slice 3D devuelve una máscara con forma (n_t, nx, ny, nz) que coincide con los datos: reproduce con el caso sintético del issue #124 (máscara (1,5,5,5) vs. datos (2,5,5,5)) y confirma que los slices 2D no cambian.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Mesh.get_obstruction_mask_slice() (fdsreader/fds_classes/mesh.py, around line 80) selects the slice plane with
mask_indices = [slice(None)] * 4
mask_indices[orientation] = slice(slc_index, slc_index + 1, 1)
The mask is indexed (t, x, y, z), so for a 2D slice orientation (1, 2 or 3) hits the right spatial axis. For a 3D slice orientation == 0, so the same line cuts the time axis down to a single frame instead of leaving the mask untouched. Which frame survives is accidental: with orientation == 0, subslice.extent[0] and dimension=(0,) both wrap to z, so slc_index is the z index of the slice's lower z bound (0 when the slice starts at the mesh bottom). If that index is >= n_t, the selection is empty.
The returned mask then has shape (1, nx, ny, nz) while the data has (n_t, nx, ny, nz). In Slice.to_global(masked=True), np.where(mask, slc_data, fill) broadcasts that one frame over all time steps, so every time step is masked with the obstructions visible at that one frame (the first time step in the common case). For example, an obstruction removed after t = 0 still masks the corresponding cells, and one that appears later does not mask anything. A synthetic check during review of #124 showed mask (1, 5, 5, 5) against data (2, 5, 5, 5), with an obstructed cell at the second time step left unmasked.
Expected: for orientation == 0, return the full time-dependent mask from get_obstruction_mask(subslice.times, cell_centered=...).
Suggested fix: return early for 3D slices, e.g.
if orientation == 0:
return self.get_obstruction_mask(subslice.times, cell_centered=cell_centered)
2D slices are not affected. Found while reviewing the fix for #123.
- Lenguaje dominante
- Python
- Estrellas
- 75
- Forks
- 28
- Merge medio
- 2 min
- PR fusionados (30 d)
- 2
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin 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 FireDynamics/fdsreader
-
Slice.to_global puts the second-to-last node row on the domain's upper facesPosiblemente ocupada @chraibi la tomó hace 2 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
FireDynamics/fdsreader#123 ·
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
FireDynamics/fdsreader#122 · 2 comentarios ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 70/100
FireDynamics/fdsreader#121 ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 76/100
FireDynamics/fdsreader#120 · 2 comentarios ·
-
[Bug]:the sum data of hrrpuv data in smoke_3d is five times smaller than the hrr data in CSVAbiertobug
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
FireDynamics/fdsreader#115 · 1 comentario ·
Todos los issues de FireDynamics/fdsreader
Issues similares
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Deepak3699/Ai_Mentor#244 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
btclib-org/btclib-node#1880 ·
Los mantenedores suelen responder en 1 día
-
CONTRIBUTING.md: say how ticketless bug fixes and feature PRs are handledPosiblemente ocupada @khuisman la tomó hoy. Abiertov0.9.2
Dificultad 1/5 Menos de una hora Aptitud para principiantes 84/100
khuisman/mcp-gee-sweet#941 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
pyjanitor-devs/pyjanitor#1758 ·
Los mantenedores suelen responder en 1 día
-
bug ready for review
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
odysseus-dev/odysseus#6641 ·
Los mantenedores suelen responder en 1 día