diff --git a/pysd/py_backend/output.py b/pysd/py_backend/output.py index 473636dd..08aa9543 100644 --- a/pysd/py_backend/output.py +++ b/pysd/py_backend/output.py @@ -386,7 +386,7 @@ def make_flat_df(df, return_addresses, flatten=False): if is_dataarray and values[0].size == 1: # some elements are returned as 0-d arrays, convert # them to float - values = [float(x) for x in values] + values = [x.squeeze().values[()] for x in values] is_dataarray = False if flatten and is_dataarray: diff --git a/tests/pytest_pysd/pytest_output.py b/tests/pytest_pysd/pytest_output.py index 9bacff3b..16622c4e 100644 --- a/tests/pytest_pysd/pytest_output.py +++ b/tests/pytest_pysd/pytest_output.py @@ -116,7 +116,7 @@ class EmptyHandler(OutputHandlerInterface): @pytest.mark.parametrize("model_path", [test_model_look]) def test_invalid_output_file(self, model): - error_message = ".* str .* os.PathLike object .*, not .*int.*" + error_message = ".* str .* os.PathLike object.*" with pytest.raises(TypeError, match=error_message): model.run(output_file=1234)