[Bug]: loadMeasurements without names returns nothing for worm results (Time interval has no mean)
Maintainers usually reply within 2 days
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
Research direction
Start with pyalps/load.py, especially Hdf5Loader.ReadMeasurementFromFile and the per-file exception handling described in the issue. Check how the loader handles observables without a mean group, then run the reproduction with worm results and verify that loadMeasurements(files) returns readable observables such as Density and Stiffness while skipping or warning about Time interval.
Written by the indexing model from the issue text.
Description
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
- Dominant language
- C++
- Stars
- 32
- Forks
- 10
- Avg merge
- 3d 23h
- Merged PRs (30d)
- 109
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ALPSim/ALPS
-
dmrg: resuming with a smaller SWEEPS silently skips to the final sweepPossibly taken @skilledwolf claimed this 2 days ago. Openarea:dmrg bug P2
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
ALPSim/ALPS#495 · 1 assignee ·
Maintainers usually reply within 2 days
-
dca: a bare -- on the command line makes the solver read --MU as a parameter filePossibly taken @skilledwolf claimed this 1 day ago. OpenP2
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
ALPSim/ALPS#479 · 1 assignee ·
Maintainers usually reply within 2 days
-
fulldiag_evaluate: a result file not named *.out.xml fails with "basic_string::erase"Possibly taken @marcusr2ML claimed this 5 days ago. Openarea:ed bug P3
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
ALPSim/ALPS#433 · 1 assignee ·
Maintainers usually reply within 2 days
-
expression: Block, SimpleFactor and check_character read past the end of inputPossibly taken @skilledwolf claimed this 2 days ago. OpenP2
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
ALPSim/ALPS#407 · 1 assignee ·
Maintainers usually reply within 2 days
-
area:build-sdk enhancement needs-decision P3
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Maintainers usually reply within 2 days
Similar issues
-
enhancement help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
area:text difficulty:easy prio:low type:bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
NatronGitHub/openfx-arena#337 ·
Maintainers usually reply within 1 day
-
difficulty:easy prio:normal type:bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
NatronGitHub/openfx-supportext#326 ·
Maintainers usually reply within 1 day
-
difficulty:easy func:viewer prio:normal type:bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
NatronGitHub/Natron#2300 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
zucch1/android-auto-jetson#293 ·
Maintainers usually reply within 1 day