Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

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

已关闭
#89 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@goelakash 已经在做这个了。

开始于 2026年9月10日。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
72/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
python
领域
data

调研方向

从 fdsreader/slcf/slice.py 中的 Slice.to_global() 方法开始,使用 masked=True 和附带的 TEST_CASE.txt 重现失败,然后与 masked=False 进行比较。跟踪报告行附近的掩码和 reshape 维度。示例在没有 ValueError 的情况下完成,并返回有效的全局数据和坐标,即表示完成。

由索引模型根据 Issue 内容生成。

描述

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

主要语言
Python
星标
76
派生
28
平均合并
23 小时 29 分钟
30 天内合并 PR
20

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

FireDynamics/fdsreader 的其他 Issue

查看 FireDynamics/fdsreader 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。