コード例 #1
0
ファイル: test_io.py プロジェクト: stheid/PyFMI
 def test_delimiter(self):
     
     res = ResultCSVTextual(os.path.join(file_path, 'files', 'Results', 'TestCSV.csv'), delimiter=",")
     
     x = res.get_variable_data("fd.y")
     
     assert x.x[-1] == 1
コード例 #2
0
    def test_work_flow_me2(self):
        model = Dummy_FMUModelME2([],
                                  "bouncingBall.fmu",
                                  os.path.join(file_path, "files", "FMUs",
                                               "XML", "ME2.0"),
                                  _connect_dll=False)
        model.setup_experiment()
        model.initialize()

        bouncingBall = ResultHandlerCSV(model)

        bouncingBall.set_options(model.simulate_options())
        bouncingBall.simulation_start()
        bouncingBall.initialize_complete()
        bouncingBall.integration_point()
        bouncingBall.simulation_end()

        res = ResultCSVTextual('bouncingBall_result.csv')

        h = res.get_variable_data('h')
        derh = res.get_variable_data('der(h)')
        g = res.get_variable_data('g')

        nose.tools.assert_almost_equal(h.x, 1.000000, 5)
        nose.tools.assert_almost_equal(derh.x, 0.000000, 5)