WagnerGroup/pyqmc

Attribute error in PeriodicConfigs object

cychow2 opened this issue · 2 comments

When I try to run a dmc with pyqmc.dmc.rundmc(wf, configs, tstep=0.02, accumulators=acc, verbose=True, nblocks=200, hdf_file=out_dmc_chkfile, client=client, npartitions=npartitions), I got the error below.

Calling _dist instead of dist seems to cause the error, and it seems to be something overlooked in the recent refactoring.

@willwheelera

Traceback (most recent call last):
  File "/projects/wagner/cychow2/research/cco/paper_geometry/pbe0/qmc/geminal/sjg_j_dmc.py", line 71, in <module>
    pyqmc.dmc.rundmc(wf, configs, tstep=0.02, accumulators=acc, verbose=True, nblocks=200, hdf_file=out_dmc_chkfile, client=client, npartitions=npartitions)
  File "/projects/wagner/cychow2/.conda/envs/cco-new/lib/python3.11/site-packages/pyqmc/dmc.py", line 467, in rundmc
    df, configs = mc.vmc(
                  ^^^^^^^
  File "/projects/wagner/cychow2/.conda/envs/cco-new/lib/python3.11/site-packages/pyqmc/mc.py", line 253, in vmc
    block_avg, configs = vmc_parallel(
                         ^^^^^^^^^^^^^
  File "/projects/wagner/cychow2/.conda/envs/cco-new/lib/python3.11/site-packages/pyqmc/mc.py", line 155, in vmc_parallel
    config = configs.split(npartitions)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/projects/wagner/cychow2/.conda/envs/cco-new/lib/python3.11/site-packages/pyqmc/coord.py", line 200, in split
    return [PeriodicConfigs(c, self.lvecs, w, dist=self._dist) for c, w in zip(clist, wlist)]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/projects/wagner/cychow2/.conda/envs/cco-new/lib/python3.11/site-packages/pyqmc/coord.py", line 200, in <listcomp>
    return [PeriodicConfigs(c, self.lvecs, w, dist=self._dist) for c, w in zip(clist, wlist)]
                                                   ^^^^^^^^^^
AttributeError: 'PeriodicConfigs' object has no attribute '_dist'. Did you mean: 'dist'?

The error goes away by removing the underscore, so I think it works fine. I opened a pull request #426 for this.