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

Fix numpy deprecation warnings #133

Open
martinholmer opened this issue May 11, 2024 · 1 comment
Open

Fix numpy deprecation warnings #133

martinholmer opened this issue May 11, 2024 · 1 comment

Comments

@martinholmer
Copy link

@hdoupe, when you fix issue #132 so that ParamTools works with Python 3.12, please also fix the marshmallow deprecation warnings listed below. These are warnings generated by GitHub testing of Tax-Calculator in early May 2024. These warnings seem to arise because of the way ParamTools is using the marshmallow package. Perhaps this use was OK when ParamTools 0.18.0 was developed over three years ago using an older version of marshmallow, but with the newer versions of marshmallow the usage raises a deprecation warning. My understanding of a deprecation warning is that ParamsTool's current usage of marshmallow will eventually generate a fatal error, and so Tax-Calculator will stop working.

=============================== warnings summary ===============================

../../../../../usr/share/miniconda/envs/taxcalc-dev/lib/python3.9/site-packages/marshmallow/fields.py:948
../../../../../usr/share/miniconda/envs/taxcalc-dev/lib/python3.9/site-packages/marshmallow/fields.py:948
../../../../../usr/share/miniconda/envs/taxcalc-dev/lib/python3.9/site-packages/marshmallow/fields.py:948
  /usr/share/miniconda/envs/taxcalc-dev/lib/python3.9/site-packages/marshmallow/fields.py:948: RemovedInMarshmallow4Warning: The 'missing' argument to fields is deprecated. Use 'load_default' instead.
    super().__init__(**kwargs)

../../../../../usr/share/miniconda/envs/taxcalc-dev/lib/python3.9/site-packages/marshmallow/fields.py:571
../../../../../usr/share/miniconda/envs/taxcalc-dev/lib/python3.9/site-packages/marshmallow/fields.py:571
  /usr/share/miniconda/envs/taxcalc-dev/lib/python3.9/site-packages/marshmallow/fields.py:571: RemovedInMarshmallow4Warning: The 'missing' argument to fields is deprecated. Use 'load_default' instead.
    super().__init__(default=default, dump_default=dump_default, **kwargs)

../../../../../usr/share/miniconda/envs/taxcalc-dev/lib/python3.9/site-packages/marshmallow/fields.py:1562
../../../../../usr/share/miniconda/envs/taxcalc-dev/lib/python3.9/site-packages/marshmallow/fields.py:1562
  /usr/share/miniconda/envs/taxcalc-dev/lib/python3.9/site-packages/marshmallow/fields.py:1562: RemovedInMarshmallow4Warning: The 'missing' argument to fields is deprecated. Use 'load_default' instead.
    super().__init__(**kwargs)

taxcalc/tests/test_parameters.py::test_params_class[revision1-error]
taxcalc/tests/test_parameters.py::test_params_class[revision12-raise]
  /usr/share/miniconda/envs/taxcalc-dev/lib/python3.9/site-packages/marshmallow/fields.py:952: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
    return self.num_type(value)

========= 279 passed, 129 deselected, 9 warnings in 1238.58s (0:20:38) =========
@martinholmer martinholmer changed the title Fix marshmallow deprecation warnings Fix numpy deprecation warning Jun 14, 2024
@martinholmer
Copy link
Author

Using ParamTools 0.18.2 makes most of the deprecation warnings originally reported in issue #133 go away. However, there are still two remaining warnings:

Screenshot 2024-06-14 at 10 00 41 AM

@hdoupe, is this numpy deprecation warning caused by marshmallow misusing numpy or is it cased by the test code in Tax-Calculator? Depending on your answer, what changes would you recommend to eliminate the remaining deprecation warnings?

CC @jdebacker

@martinholmer martinholmer changed the title Fix numpy deprecation warning Fix numpy deprecation warnings Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant