Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP]Pytest Style analysis/test_density.py #1543

Merged
merged 3 commits into from Aug 5, 2017

Conversation

utkbansal
Copy link
Member

Fixes #

Changes made in this Pull Request:

PR Checklist

  • Tests?
  • Docs?
  • CHANGELOG updated?
  • Issue raised/referenced?

@kain88-de
Copy link
Member

build fails

@kain88-de
Copy link
Member

build still fails

@utkbansal
Copy link
Member Author

@kain88-de Can't figure what I broke in

def test_grid(self, D):
        dV = D.delta.prod()  # orthorhombic grids only!
        # counts = (rho[0] * dV[0] + rho[1] * dV[1] ...) = sum_i rho[i] * dV
        assert_almost_equal(D.grid.sum() * dV, self.counts)

@utkbansal
Copy link
Member Author

@kain88-de Need help here.

@kain88-de
Copy link
Member

@jbarnoud or @mnmelo could you have a look?

@jbarnoud
Copy link
Contributor

jbarnoud commented Aug 3, 2017

On line 45, as you declare class attributes, you use the class attribute Lmax to build the other class attribute bins. When you do this, it seems that python tries to find Lmax in the parent scope rather than using the TestDensity.Lmax you just defined.

I think you need to create a fixture for bins. This fixture can have the class as scope.

@kain88-de
Copy link
Member

Yes python doesn't allow using the attributes you declare in a list comprehension


from MDAnalysisTests.datafiles import TPR, XTC, GRO
from MDAnalysisTests import module_not_found, tempdir
from MDAnalysisTests import tempdir
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please also remove the tempdir usage if you haven't done so already.

@kain88-de kain88-de merged commit 2542b16 into MDAnalysis:develop Aug 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants