murphyqm / pytesimal

Model the conductive cooling of small planetary bodies with temperature-dependent material properties
MIT License
1 stars 0 forks source link

Contracts warning #34

Closed andreww closed 3 years ago

andreww commented 3 years ago

Just a quick note so we don't forget that the contracts module is generating warnings from the test suite. For example:

required_scripts/test_highlevel.py::test_def_const
  /anaconda3/envs/pytesimal/lib/python3.8/site-packages/contracts/library/miscellaneous_aliases.py:19: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.9 it will stop working
    m_new_contract('Container', ist(collections.Container))

I think the plan is to remove remove the contracts decorators and replace with suitable unit tests at some point.

murphyqm commented 3 years ago

Looks like PyContracts is no longer being maintained - this has been raised as an issue on the software repository but not fixed.

Some potential alternatives for type checking:

murphyqm commented 3 years ago

Removed/commented out contracts decorators, replaced with tests - type specification too restrictive for some functions which can take scalars or arrays as arguments