Source: mdtraj
Version: 1.11.1.post1-1
Severity: normal
Tags: ftbfs
Control: forwarded -1 https://github.com/mdtraj/mdtraj/issues/2142

mdtraj is FTBFS due to failure of test_iterload[nc] in test_trajectory.py

=================================== FAILURES ===================================
______________________________ test_iterload[nc] _______________________________

write_traj = TrajObj(fobj=<class 'mdtraj.formats.netcdf.NetCDFTrajectoryFile'>, 
fext='nc', fn='/tmp/pytest-of-sbuild/pytest-1/test_iterload_nc_0/traj.nc')
get_fn = <function get_fn.<locals>._get_fn at 0x7fb7a81a4860>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fb7a8126a50>

    def test_iterload(write_traj, get_fn, monkeypatch):
        if write_traj.fext == "dtr":
            pytest.xfail("This is broken with dtr")
    
        def test_base(write_traj, get_fn):
            t_ref = md.load(get_fn("frame0.h5"))[:20]
    
            if write_traj.fext in ("ncrst", "rst7"):
                pytest.skip("Only 1 frame per file format")
    
            t_ref.save(write_traj.fn)
    
            for stride in [1, 2, 3]:
                loaded = md.load(write_traj.fn, top=t_ref, stride=stride)
                iterloaded = functools.reduce(
                    lambda a, b: a.join(b),
                    md.iterload(write_traj.fn, top=t_ref, stride=stride, 
chunk=6),
                )
                eq(loaded.xyz, iterloaded.xyz)
                eq(loaded.time, iterloaded.time)
                eq(loaded.unitcell_angles, iterloaded.unitcell_angles)
                eq(loaded.unitcell_lengths, iterloaded.unitcell_lengths)
    
        if write_traj.fext in ("nc"):
            # Running with scipy
            with monkeypatch.context() as m:
                m.setitem(sys.modules, "netCDF4", None)
                test_base(write_traj, get_fn)
    
>       test_base(write_traj, get_fn)

tests/test_trajectory.py:662: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_trajectory.py:647: in test_base
    iterloaded = functools.reduce(
mdtraj/core/trajectory.py:625: in iterload
    traj = f.read_as_traj(
mdtraj/formats/netcdf.py:237: in read_as_traj
    xyz, time, cell_lengths, cell_angles = self.read(
mdtraj/formats/netcdf.py:341: in read
    coordinates = self._handle.variables["coordinates"][
src/netCDF4/_netCDF4.pyx:5107: in netCDF4._netCDF4.Variable.__getitem__
    ???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   ???
E   IndexError: index exceeds dimension bounds

src/netCDF4/_netCDF4.pyx:6079: IndexError

= 1 failed, 986 passed, 103 skipped, 24 deselected, 61 xfailed, 1 warning in 
114.21s (0:01:54) =


Reported upstream
https://github.com/mdtraj/mdtraj/issues/2142

Reply via email to