Skip to content

[Review Needed]Pytest Style coordinates/test_timestep_api.py - #1650

Merged
orbeckst merged 2 commits into
MDAnalysis:developfrom
utkbansal:coord-timestep
Aug 28, 2017
Merged

[Review Needed]Pytest Style coordinates/test_timestep_api.py#1650
orbeckst merged 2 commits into
MDAnalysis:developfrom
utkbansal:coord-timestep

Conversation

@utkbansal

Copy link
Copy Markdown
Member

Fixes #

Changes made in this Pull Request:

PR Checklist

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

@orbeckst orbeckst left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please check the code related to importorskip(netCDF4). It is likely not needed anymore and can be simplified.

def setUp(self):
@pytest.fixture()
def universe(self):
pytest.importorskip('netCDF4')

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think that we need to check for netCDF anymore. We should always be able to read ncdf files because we use scipy.io.netcdf for reading.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Does this mean that pytest.importorskip('netCDF4') shouldn't be present anywhere in the tests as we don't use it anymore?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

With git grep I only found it in MDAnalysisTests/coordinates/test_xdr.py and there it is also not needed anymore. We should always be able to read NCDF files.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

(I must have overlooked these instances when I worked on #506 so thanks for fixing them as you go along.)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The other PR where this should be fixed is #1655.

timeunit='fs')
self.ts = u.trajectory.ts

class TestNCDFBaseTimestepInterface(object):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Does this separate class solely exist so that you can test for netCDF4? If so, this is not necessary anymore.

Could you then get rid of this class and do everything in the pararmeterized class? (You are already loading ncdf files in the parametrization anyway...).

# Once Readers use that TestClass, delete this one
class BaseTimestepInterfaceTest(TestCase):

@pytest.mark.parametrize("topology, trajectory, trajectory_format, topology_format", (

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This looks good.

@utkbansal

Copy link
Copy Markdown
Member Author

@orbeckst Should be good to go now.

@orbeckst
orbeckst merged commit e9f0cb9 into MDAnalysis:develop Aug 28, 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.

3 participants