[Bug]: loadMeasurements without names returns nothing for worm results (Time interval has no mean)

Open Beginner friendly
#421 0 comments 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 2 days

@skilledwolf is already working on this.

Since Dec 1, 2026.

  • #515 by @skilledwolf — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
76/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
data

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

area:python bug P2

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

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ALPSim/ALPS

All issues in ALPSim/ALPS

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.