Skip to content

dtr_read idx vs sample mismatch #283

@jkuhl-uni

Description

@jkuhl-uni

Describe the issue:

Hey,
I'm currently having issues with the extract_t0 function.
The error I encounter is related to the dtr_read parameter. If I set this to 3 in the current implementation, I get an error ValueError: Incompatible samples and idx for A|5: 372 vs. 1116, where I actually want to only extract 372 data points.
I read the code again, and I think there is an issue with the dtr_read parameter of the function. If I want to skip configurations, also the idx counter should skip the data. I believe the issue arises due to line 361 in input/openQCD.py. The issue is also not circumvented by ll. 379, 380 in the same file (at least in general).
This behaviour is not caught by the tests, because while we do test dtr_read=3, diffmeas "fixes" things in the sense, that is matches dtr_read in the tested case (so in principle, dtr_read can also be set to 1 in the test).
I'll write up a solution in a PR, I just wanted to make you aware before doing so, just in case I am seeing ghosts.

Code example:

import pyerrors as pe

o = pe.input.openQCD.extract_t0('.../b4.00/T48L48/k0.1382720/dat', 'qcd2sf', T=48,dtr_read=3, xmin=16, spatial_extent=48, names=[f'A|{id}'for id in [5,6,7]], postfix='.ms', files =["qcd2sf_T48L48_b4.0_k0.138272_id5.ms.dat", "qcd2sf_T48L48_b4.0_k0.138272_id6.ms.dat", "qcd2sf_T48L48_b4.0_k0.138272_id7.ms.dat"])

Error message:

Extract flowed Yang-Mills action density from qcd2sf , 3 replica
Step size: 0.02 , Maximal t value: 10.24
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/justus/myProjects/corrlib/.venv/lib/python3.12/site-packages/pyerrors/input/openQCD.py", line 490, in extract_t0
    E_dict = _extract_flowed_energy_density(path, prefix, dtr_read, xmin, spatial_extent, postfix, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/justus/myProjects/corrlib/.venv/lib/python3.12/site-packages/pyerrors/input/openQCD.py", line 419, in _extract_flowed_energy_density
    new_obs = Obs(samples, rep_names, idl=idl)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/justus/myProjects/corrlib/.venv/lib/python3.12/site-packages/pyerrors/obs.py", line 133, in __init__
    raise ValueError('Incompatible samples and idx for %s: %d vs. %d' % (name, len(sample), self.shape[name]))
ValueError: Incompatible samples and idx for A|5: 372 vs. 1116

Runtime information:

system Linux
python 3.12.7
pyerrors 2.16.0
numpy 2.3.5
scipy 1.16.3
matplotlib 3.10.7
pandas 2.3.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions