Skip to content

Commit

Permalink
forcing num arg of numpy.linspace to be integer
Browse files Browse the repository at this point in the history
  • Loading branch information
jonrkarr committed Jan 8, 2020
1 parent 127046a commit 785595d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/test_run_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def test_get(self):
for component in RunResults.COMPONENTS:
self.assertTrue(self.run_results_1_cmpt.get(component).equals(run_results_2.get(component)))

expected_times = pandas.Float64Index(numpy.linspace(0, self.max_time, 1 + self.max_time/self.checkpoint_period))
expected_times = pandas.Float64Index(numpy.linspace(0, self.max_time, int(1 + self.max_time/self.checkpoint_period)))
for component in ['populations', 'observables', 'functions', 'aggregate_states', 'random_states']:
component_data = self.run_results_1_cmpt.get(component)
self.assertFalse(component_data.empty)
Expand Down
2 changes: 1 addition & 1 deletion wc_sim/testing/verify.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def read_expected_predictions(self):
self.test_case_dir, self.test_case_num+'-results.csv')
expected_predictions_df = pd.read_csv(expected_predictions_file)
# expected predictions should contain data for all time steps
times = np.linspace(self.settings['start'], self.settings['duration'], num=self.settings['steps']+1)
times = np.linspace(self.settings['start'], self.settings['duration'], num=int(self.settings['steps'] + 1))
if not np.allclose(times, expected_predictions_df.time):
raise VerificationError("times in settings '{}' differ from times in expected predictions '{}'".format(
self.settings_file, expected_predictions_file))
Expand Down

0 comments on commit 785595d

Please sign in to comment.