[Theano/Theano] c807dd: Fix collections warnings (#6759)

0 views
Skip to first unread message

Jerry Morrison

unread,
Jul 27, 2020, 11:22:30 AM7/27/20
to theano...@googlegroups.com
Branch: refs/heads/master
Home: https://github.com/Theano/Theano
Commit: c807dd080dcb820f4890e2766f7a80c1d6af744a
https://github.com/Theano/Theano/commit/c807dd080dcb820f4890e2766f7a80c1d6af744a
Author: Jerry Morrison <1fi...@users.noreply.github.com>
Date: 2020-07-27 (Mon, 27 Jul 2020)

Changed paths:
M .gitignore
M bin/theano_nose.py
A requirements.txt
M setup.py
M theano/compat/__init__.py
M theano/compile/builders.py
M theano/compile/debugmode.py
M theano/compile/function.py
M theano/configdefaults.py
M theano/gof/cmodule.py
M theano/gof/op.py
M theano/gof/unify.py
M theano/gof/utils.py
M theano/gpuarray/tests/test_subtensor.py
M theano/tensor/nlinalg.py
M theano/tensor/nnet/conv.py
M theano/tensor/nnet/nnet.py
M theano/tensor/opt.py
M theano/tensor/subtensor.py
M theano/tensor/tests/mlp_test.py
M theano/tensor/tests/test_basic.py
M theano/tensor/tests/test_subtensor.py

Log Message:
-----------
Fix collections warnings (#6759)

* Fix some scary deprecation warnings

Per #6755, fix some warnings of impending incompatbility that appear in calling projects.

Also tweak the theano_nose test setup to print the first occurrence of each warning for each location.

* Fixes the `misc/frozendict.py` DeprecationWarning about 'collections'.
* The `compat/__init__.py` DeprecationWarning about 'collections' was already fixed in 1b9804b65ecd008cfb424752e65aced92b63ff92, not yet on PyPI.
* There's also a DeprecationWarning about 'collections' from `nose/suite.py:106`. Since nose is in maintenance mode at best, the fix is to switch to pytest or maybe nose2. Meanwhile, this validates that `bin/theano-nose` does issue those deprecation warnings so we can check that a fix works.
* Fixes a pytest warning about a docstring containing invalid character escapes from math formatting.
* 268 DeprecationWarnings and 498 total Warnings remain. -- I'm unsure how many such fixes to include in this PR, but I started on some that won't complicate testing of the main fix here.

* py3.9 is stricter, so fix some regexes et al

* Regex escapes and string escapes.
* Cannot return a value from `__init__`.
* Put `FIXME` on some other problems identified by a PyCharm inspection. There are more, such as 255 methods that don't match the signature of their overridden method and 16 `__init__` methods that don't call `super()`.

* fix \ quoting in a doctest

It's a raw docstring literal to fix the invalid string escapes `\*`.


Reply all
Reply to author
Forward
0 new messages