Skip to content

Fix numpy deprecation warnings #133

@martinholmer

Description

@martinholmer

@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) =========

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions