[Bug]: loadMeasurements without names returns nothing for worm results (Time interval has no mean)
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
まず pyalps/load.py、特に Hdf5Loader.ReadMeasurementFromFile と issue に記載されたファイルごとの例外処理を確認します。mean グループのない observables を loader がどのように処理するかを確認し、次に worm の結果で再現を実行して、loadMeasurements(files) が Density や Stiffness などの読み取り可能な observables を返し、Time interval をスキップするか警告を表示することを確認します。
索引モデルが issue の本文から書いたものです。
説明
Summary
For worm results, pyalps.loadMeasurements(files) without observable names returns an empty list for each file. It logs a PathNotFound traceback but doesn't raise:
The group '/simulation/results/Time interval/mean' does not exist.
Traceback (most recent call last):
File ".../pyalps/load.py", line 416, in ReadMeasurementFromFile
elif "error" in self.h5f.list_children(respath+'/'+m+'/mean'):
pyalps.hdf5.PathNotFound: The group '/simulation/results/Time interval/mean' does not exist.
worm writes an internal observable, Time interval, that has only count and timeseries children and no mean group. Hdf5Loader.ReadMeasurementFromFile assumes every observable has mean. The resulting exception is caught by the try around the whole file, so every other observable in that file is dropped as well. Master's load.py has the same structure (the "error" in ...list_children(respath+'/'+m+'/mean') check and the per-file except), so this probably isn't fixed there either.
To Reproduce
import pyalps
parms = [{
'LATTICE' : "square lattice",
'MODEL' : "boson Hubbard",
'L' : 4,
'T' : 0.1,
'U' : 1.0,
'mu' : 0.5,
'Nmax' : 2,
't' : 0.05,
'THERMALIZATION' : 10000,
'SWEEPS' : 100000,
}]
f = pyalps.writeInputFiles('wm', parms)
pyalps.runApplication('worm', f, Tmin=2)
files = pyalps.getResultFiles(prefix='wm')
print(pyalps.loadMeasurements(files)) # [[]]
print([s.props['observable'] for s in pyalps.flatten(
pyalps.loadMeasurements(files, ['Density', 'Stiffness']))]) # ['Density', 'Stiffness']
The file contains Energy, Density, Stiffness, Green's Function, Density Correlations and so on, along with Time interval, Ratio time intervals and Statistics time intervals.
Expected behavior
loadMeasurements(files) returns every observable it can read and skips, or warns about, one it can't, instead of dropping the whole file. Probably the simplest fix is to check that mean exists before reading it, and to catch errors per observable rather than per file.
Environment
- ALPS / pyalps 3.0.0 (PyPI wheel)
- macOS 26 (Darwin 25.6), arm64
- Python 3.14.7
Additional context
Found while writing the measurement examples page for the website (ALPSim/alpsim.github.io#177). Workaround: pass the observable names explicitly.
🤖 Generated with Claude Code
- 主要言語
- C++
- スター
- 32
- フォーク
- 10
- 平均マージ
- 3日 19時間
- マージ済み PR(30日)
- 100
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
ALPSim/ALPS のほかの issue
-
area:dmrg bug P2
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 2 日以内に返信
-
P2
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 2 日以内に返信
-
area:ed bug P3
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
メンテナーはふだん 2 日以内に返信
-
P2
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
メンテナーはふだん 2 日以内に返信
-
cast.hpp: integer bounds raise ~3,600 Clang warnings and reject the long long minimum when long double is 64-bit対応中かも @skilledwolf が 2 日前に担当しました。 オープンP2
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 2 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
Niko1221/Strata#7211 · コメント 3 件 ·
メンテナーはふだん 5 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
enhancement P5 XS
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
open-astro/AlpacaBridge#2683 ·
メンテナーはふだん 1 日以内に返信
-
Linux Copr构建失败オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 69/100
metasequoiaime/msime#11908 ·
メンテナーはふだん 1 日以内に返信