Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[Bug]: Error in .to_global() Method for Slice Files with masked=True

Aperta
#89 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

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

Direzione di ricerca

Inizia dal metodo Slice.to_global() in fdsreader/slcf/slice.py e riproduci il fallimento con il TEST_CASE.txt allegato usando masked=True, quindi confrontalo con masked=False. Traccia le dimensioni della maschera e di reshape intorno alla riga segnalata. Il lavoro è completato quando l’esempio termina senza ValueError e restituisce dati globali e coordinate validi.

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

Descrizione

bug
What happened?

Hi, I encountered an issue when using the .to_global() method for Slice files in fdsreader. When setting masked=True, an error occurs, whereas setting masked=False works as expected. This suggests that the issue is related to handling the masked option.

Since displaying obstructions for better orientation is very useful, I would appreciate it if you could investigate this issue :) I have attached a demo FDS file for reproduction.

TEST_CASE.txt

error:

ValueError Traceback (most recent call last)
Cell In[6], line 9
7 slc=sim.slices
8 slc_soot = slc.get_by_id("SOOT_Z_Decke")
----> 9 data_slc, grid_coords = slc_soot.to_global(masked=True, fill=np.nan, return_coordinates=True)

File ~\AppData\Local\anaconda3\Lib\site-packages\fdsreader\slcf\slice.py:648, in Slice.to_global(self, masked, fill, return_coordinates)
644 if masked:
645 slc_data = np.where(mask, slc_data, fill)
647 grid[:, start_idx['x']: end_idx['x'], start_idx['y']: end_idx['y'],
--> 648 start_idx['z']: end_idx['z']] = slc_data.reshape(
649 (self.n_t, end_idx['x'] - start_idx['x'], end_idx['y'] - start_idx['y'],
650 end_idx['z'] - start_idx['z']))
652 if return_coordinates:
653 coordinates = dict()

ValueError: cannot reshape array of size 0 into shape (76,67,69,1)

Steps to reproduce

import fdsreader as fds
import numpy as np

path=r"-----"

sim=fds.Simulation(path)
slc=sim.slices
slc_soot = slc.get_by_id("SOOT_Z_Decke")
data_slc, grid_coords = slc_soot.to_global(masked=True, fill=np.nan, return_coordinates=True)

FDS version used

FDS-6.9.1-0-g889da6a-release

fdsreader version used

1.11.6

Lingua principale
Python
Stelle
75
Fork
28
Merge medio
2m
PR unite (30g)
2

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 FireDynamics/fdsreader

Tutte le issue di FireDynamics/fdsreader

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.