[Bug]: Error in .to_global() Method for Slice Files with masked=True
维护者通常 1 天内回复
@goelakash 已经在做这个了。
开始于 2026年9月10日。
评估
调研方向
从 fdsreader/slcf/slice.py 中的 Slice.to_global() 方法开始,使用 masked=True 和附带的 TEST_CASE.txt 重现失败,然后与 masked=False 进行比较。跟踪报告行附近的掩码和 reshape 维度。示例在没有 ValueError 的情况下完成,并返回有效的全局数据和坐标,即表示完成。
由索引模型根据 Issue 内容生成。
描述
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.
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
- 主要语言
- Python
- 星标
- 76
- 派生
- 28
- 平均合并
- 23 小时 29 分钟
- 30 天内合并 PR
- 20
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
FireDynamics/fdsreader 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 70/100
FireDynamics/fdsreader#133 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 25/100
FireDynamics/fdsreader#81 ·
维护者通常 1 天内回复
-
Get RGBA-Value of obstruction from Surf_Id可能重新可做 @goelakash 于 35 天前认领,目前没有进行中的 PR。 未关闭enhancement help wanted
难度 4/5 3-5 天 新手友好度 35/100
FireDynamics/fdsreader#77 · 3 条评论 ·
维护者通常 1 天内回复
-
help wanted
难度 4/5 3-5 天 新手友好度 35/100
FireDynamics/fdsreader#73 · 3 条评论 ·
维护者通常 1 天内回复
-
to_global has Problem with different cell-sizes可能重新可做 @lu-kas 于 832 天前认领,目前没有进行中的 PR。 未关闭
FireDynamics/fdsreader#49 · 8 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
查看 FireDynamics/fdsreader 的全部 Issue
相似的 Issue
-
documentation good first issue
难度 2/5 半天 新手友好度 72/100
sujithputta02/Esapay#13 ·
-
bug
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复
-
needs-triage
难度 2/5 1-3 小时 新手友好度 72/100
gke-labs/kube-agents#3277 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 68/100
jbacalso24/mimry#291 ·
维护者通常 1 天内回复
-
good first issue
难度 2/5 1 小时以内 新手友好度 82/100
eli-alvarado/us-watchlist-alerts#14 ·
维护者通常 1 天内回复