Skip to content

Commit

Permalink
Avoid errors with DeprecationWarnings
Browse files Browse the repository at this point in the history
  • Loading branch information
enekomartinmartinez committed Feb 1, 2024
1 parent cbde445 commit ad96962
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 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
5 changes: 3 additions & 2 deletions tests/pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
python_files = pytest_*/**/*.py pytest_*/*.py
filterwarnings =
error
ignore:numpy.ndarray size changed, may indicate binary incompatibility.:RuntimeWarning
ignore:datetime.* is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC.*:DeprecationWarning
always:numpy.ndarray size changed, may indicate binary incompatibility.:RuntimeWarning
always::DeprecationWarning
always::PendingDeprecationWarning
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 ad96962

Please sign in to comment.