def test_get_inputs_from_pason_rop(self): """Tests that setting the inputs from a :class:`PasonData` object works. """ pason_data = dripy.PasonData(TEST_PASON_DATA) drill_sim = DrillSim(self.drill_string, self.event, self.solver_settings, TEST_WORKING_DIRECTORY, TEST_ANALYSIS_NAME) drill_sim.get_pason_inputs(pason_data, show_plots=False) self.assertListEqual(drill_sim.pason_inputs['rop'][0][1000:1010], TEST_EXPECTED_CLEANED_ROP)
def test_clean_pason_data_rop(self): """Tests that :meth:`clean_pason` returns the expected values for the rop signal """ pason_data = dripy.PasonData(TEST_PASON_DATA) signal, _time = DrillSim.clean_pason(pason_data, 'rop', show_plot=False) # # Plot for confirmation # pason_data.plt.plot(pason_data.time, pason_data.rop) # pason_data.plt.plot(_time, signal) # pason_data.plt.show() self.assertListEqual(signal[1000:1010], TEST_EXPECTED_CLEANED_ROP)
def test_build_adm_contents(self): """Tests that the event file created in the DrillSim directory has the correct contents. """ drill_sim = DrillSim(self.drill_string, self.event, self.solver_settings, TEST_WORKING_DIRECTORY, TEST_ANALYSIS_NAME) pason_data = dripy.PasonData(TEST_PASON_DATA) drill_sim.get_pason_inputs(pason_data, show_plots=False) drill_sim.build() adm_file = os.path.join(TEST_WORKING_DIRECTORY, TEST_ANALYSIS_NAME + '.adm') n_adm_lines = len(open(adm_file, 'r').readlines()) expected_n_adm_lines = 12538 self.assertEqual(n_adm_lines, expected_n_adm_lines)