Skip to content

Commit

Permalink
[thermo] adding exception tests for single trajectories and md_trajs/…
Browse files Browse the repository at this point in the history
…md_dtrajs None cases
  • Loading branch information
cwehmeyer committed Jun 13, 2016
1 parent b68fabc commit 090b80b
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion pyemma/thermo/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,21 @@ def test_exceptions(self):
estimate_umbrella_sampling(
us_trajs, us_dtrajs, us_centers, us_force_constants,
md_trajs=md_trajs_x, md_dtrajs=md_dtrajs)

# unmatching md_trajs/md_dtrajs cases
with self.assertRaises(ValueError):
estimate_umbrella_sampling(
us_trajs, us_dtrajs, us_centers, us_force_constants,
md_trajs=None, md_dtrajs=md_dtrajs)
with self.assertRaises(ValueError):
estimate_umbrella_sampling(
us_trajs, us_dtrajs, us_centers, us_force_constants,
md_trajs=md_trajs, md_dtrajs=None)
# single trajectory cases
with self.assertRaises(ValueError):
estimate_umbrella_sampling(
us_trajs[0], us_dtrajs[0], us_centers[0], us_force_constants[0])
with self.assertRaises(ValueError):
estimate_umbrella_sampling(
us_trajs, us_dtrajs, us_centers, us_force_constants,
md_trajs=md_trajs[0], md_dtrajs=md_dtrajs[0])

0 comments on commit 090b80b

Please sign in to comment.