MDAnalysis / pmda

Parallel algorithms for MDAnalysis
https://www.mdanalysis.org/pmda/
Other
31 stars 22 forks source link

LeafletFinder tests started failing with "MarkDecorator" #83

Closed orbeckst closed 5 years ago

orbeckst commented 5 years ago

Expected behaviour

Tests pass as before.

Actual behaviour

Tests started failing in LEafletFinder with https://github.com/MDAnalysis/pmda/commit/f82e4c691801613b40f7785a7b87703d634ef15e which had nothing to do with this part of the code.

E       TypeError: unsupported operand type(s) for /: 'int' and 'MarkDecorator'

Full log snippet

See https://travis-ci.org/MDAnalysis/pmda/jobs/529478197

================================== FAILURES ===================================
______________________ TestLeafLet.test_leaflet[n_jobs0] _______________________
self = <test_leaflet.TestLeafLet object at 0x7f0522a67080>
universe = <Universe with 43480 atoms>
correct_values = [array([36507, 36761, 37523, 37650, 38031, 38285]), array([36634]), array([36507, 36761, 38285, 39174]), array([36634]), array([36507, 36761, 37650, 38285, 39174, 39936]), array([36634]), ...]
n_jobs = MarkDecorator(mark=Mark(name='xfail', args=(-1,), kwargs={}))
    @pytest.mark.parametrize('n_jobs', (pytest.mark.xfail(-1),
                                        1,
                                        pytest.mark.xfail(2)))
    def test_leaflet(self, universe, correct_values, n_jobs):
        lipid_heads = universe.select_atoms("name P and resname POPG")
        universe.trajectory.rewind()
        leaflets = leaflet.LeafletFinder(universe, lipid_heads)
>       leaflets.run(n_jobs=n_jobs)
/home/travis/build/MDAnalysis/pmda/pmda/test/test_leaflet.py:49: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/home/travis/build/MDAnalysis/pmda/pmda/leaflet.py:301: in run
    cutoff=cutoff)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = <pmda.leaflet.LeafletFinder object at 0x7f0522075e48>
ts = < Timestep 0 with unit cell dimensions [102.844894 102.84479  132.1866    90.        90.       120.      ] >
atomgroups = <AtomGroup with 55 atoms>
scheduler_kwargs = {'scheduler': 'single-threaded'}
n_jobs = MarkDecorator(mark=Mark(name='xfail', args=(-1,), kwargs={}))
cutoff = 15.0
    def _single_frame(self, ts, atomgroups, scheduler_kwargs, n_jobs,
                      cutoff=15.0):
        """Perform computation on a single trajectory frame.

        Must return computed values as a list. You can only **read**
        from member variables stored in ``self``. Changing them during
        a run will result in undefined behavior. `ts` and any of the
        atomgroups can be changed (but changes will be overwritten
        when the next time step is read).

        Parameters
        ----------
        scheduler_kwargs : Dask Scheduler parameters.
        cutoff : float (optional)
            head group-defining atoms within a distance of `cutoff`
            Angstroms are deemed to be in the same leaflet [15.0]

        Returns
        -------
        values : anything
            The output from the computation over a single frame must
            be returned. The `value` will be added to a list for each
            block and the list of blocks is stored as :attr:`_results`
            before :meth:`_conclude` is run. In order to simplify
            processing, the `values` should be "simple" shallow data
            structures such as arrays or lists of numbers.

        """

        # Get positions of the atoms in the atomgroup and find their number.
        atoms = ts.positions[atomgroups.indices]
        matrix_size = atoms.shape[0]
        arranged_coord = list()
>       part_size = int(matrix_size / n_jobs)
E       TypeError: unsupported operand type(s) for /: 'int' and 'MarkDecorator'
/home/travis/build/MDAnalysis/pmda/pmda/leaflet.py:192: TypeError