Skip to content

Commit

Permalink
Remove deprecation warning when extracting values from an array
Browse files Browse the repository at this point in the history
  • Loading branch information
enekomartinmartinez committed Jan 12, 2024
1 parent cbde445 commit 6190bcf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pysd/py_backend/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion tests/pytest_pysd/pytest_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 6190bcf

Please sign in to comment.