Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAINT: Deprecations and Test Warnings #723

Open
mmcky opened this issue Mar 3, 2024 · 3 comments
Open

MAINT: Deprecations and Test Warnings #723

mmcky opened this issue Mar 3, 2024 · 3 comments

Comments

@mmcky
Copy link
Contributor

mmcky commented Mar 3, 2024

The following deprecation notices and warnings are issued during test runs that should be fixed. @Smit-create would you be able to look into these?

quantecon/markov/tests/test_core.py::test_raises_non_homogeneous_state_values
  /Users/mmcky/work/quantecon/QuantEcon.py/quantecon/markov/core.py:230: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray.
    values = np.asarray(values)

quantecon/markov/tests/test_ddp.py::TestFiniteHorizon::test_backward_induction
quantecon/markov/tests/test_ddp.py::test_ddp_beta_1_not_implemented_error
  /Users/mmcky/work/quantecon/QuantEcon.py/quantecon/markov/ddp.py:430: UserWarning: infinite horizon solution methods are disabled with beta=1
    warnings.warn(msg)

quantecon/tests/test_graph_tools.py::test_raises_non_homogeneous_node_labels
  /Users/mmcky/work/quantecon/QuantEcon.py/quantecon/_graph_tools.py:140: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray.
    values = np.asarray(values)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
@oyamad
Copy link
Member

oyamad commented Mar 4, 2024

  • The 2nd one is as intended. Maybe define a custom warning rather than the generic UserWarning?
  • 1st and 3rd should be addressed.

@kp992
Copy link
Contributor

kp992 commented Mar 4, 2024

Thanks, @oyamad @mmcky. I can look into this.

@mmcky
Copy link
Contributor Author

mmcky commented Mar 4, 2024

thanks @kp992 and @oyamad

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants