# Path: gromacs/formats.py



import numpy as np
import matplotlib
import pytest
import gromacs.fileformats.xvg
from numpy.testing import assert_almost_equal, assert_equal
from gromacs.formats import XVG
    @pytest.mark.parametrize("name",
                             ("mean", "max", "min", "std"))
    def test_props(self, xvg, data, name):
        assert_almost_equal(getattr(xvg, name),
                            getattr(data[1:], name)(axis=1))

    def test_write_read(self, xvg, tmpdir):
        fname = "random.xvg"
        with tmpdir.as_cwd():
            xvg.write(fname)
            newxvg = XVG(filename=fname)
        assert_almost_equal(newxvg.array, xvg.array)
        ## will fail: column names are not written
        # assert_equal(newxvg.names, xvg.names)

    def test_correl(self, correldata):
        xvg = XVG(array=correldata, names="t,y1,y2")
        # FIXME
        # force=True : TypeError: tcorrel() got an unexpected keyword argument 'force'
        xvg.set_correlparameters(nstep=None, ncorrel=25000)

        sigma = xvg.error
        tc = xvg.tc
        assert_equal(sigma.shape, (2,))
        assert_equal(tc.shape, (2,))

    @pytest.mark.parametrize('method', ('mean', 'circmean', 'min', 'max',
                                        'rms', 'percentile', 'smooth',
                                        'error'))
    def test_decimate(self, correldata, method, maxpoints=100):

# Path: gromacs/formats.py



# Path: tests/fileformats/test_xvg.py
import numpy as np
import matplotlib
import pytest
import gromacs.fileformats.xvg
from numpy.testing import assert_almost_equal, assert_equal
from gromacs.formats import XVG

    @pytest.mark.parametrize("name",
                             ("mean", "max", "min", "std"))
    def test_props(self, xvg, data, name):
        assert_almost_equal(getattr(xvg, name),
                            getattr(data[1:], name)(axis=1))

    def test_write_read(self, xvg, tmpdir):
        fname = "random.xvg"
        with tmpdir.as_cwd():
            xvg.write(fname)
            newxvg = XVG(filename=fname)
        assert_almost_equal(newxvg.array, xvg.array)
        ## will fail: column names are not written
        # assert_equal(newxvg.names, xvg.names)

    def test_correl(self, correldata):
        xvg = XVG(array=correldata, names="t,y1,y2")
        # FIXME
        # force=True : TypeError: tcorrel() got an unexpected keyword argument 'force'
        xvg.set_correlparameters(nstep=None, ncorrel=25000)

        sigma = xvg.error
        tc = xvg.tc
        assert_equal(sigma.shape, (2,))
        assert_equal(tc.shape, (2,))

    @pytest.mark.parametrize('method', ('mean', 'circmean', 'min', 'max',
                                        'rms', 'percentile', 'smooth',
                                        'error'))
    def test_decimate(self, correldata, method, maxpoints=100):

        xvg = XVG(array=correldata)