def test_initialize_from_file_like(): from io import BytesIO config = BytesIO(yaml.dump(config_val, encoding=("utf-8"))) model = PolynomialChaos() model.initialize(config) assert_true(os.path.exists(dakota_files["input"]))
def test_update(): if is_dakota_installed(): model = PolynomialChaos() model.initialize() model.update() assert_true(os.path.exists(dakota_files["input"])) assert_true(os.path.exists(dakota_files["output"])) assert_true(os.path.exists(dakota_files["data"]))
def test_initialize_from_file(): import tempfile with tempfile.NamedTemporaryFile("w", delete=False) as fp: fp.write(yaml.dump(config_val)) fname = fp.name model = PolynomialChaos() model.initialize(fname) os.remove(fname) assert_true(os.path.exists(dakota_files["input"]))
def test_initialize_defaults(): model = PolynomialChaos() model.initialize() assert_true(os.path.exists(dakota_files["input"]))
def test_end_time(): model = PolynomialChaos() model.initialize() assert_equal(model.get_end_time(), 1.0)
def test_finalize(): if is_dakota_installed(): model = PolynomialChaos() model.initialize() model.update() model.finalize()