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

Cleanup of warnings from the test suite #23754

Merged
merged 7 commits into from Jul 12, 2022

Conversation

oscarbenjamin
Copy link
Contributor

@oscarbenjamin oscarbenjamin commented Jul 10, 2022

References to other Issues or PRs

Brief description of what is fixed or changed

Various fixes related to things that give warnings in the test suite (including some warnings that are hidden by default):

  • Not closing files properly (i.e. use with open())
  • Not closing subprocesses properly (use communicate etc)
  • Using the deprecated imp module
  • Using the deprecated np.matrix type
  • Plotting code that passes out of range values to numpy functions

Also:

  • Aesara has deprecated the broadcastable argument in favour of shape.
  • Some warnings from Aesara are now suppressed (in the test suite).
  • Autowrap now sets language_level=3 in the generated cython code.

Other comments

I would like to merge this as a bunch of minor fixes and then rebase #23745 and think more generally about how to handle warnings in CI.

Release Notes

  • utilities
    • The autowrap module now sets language_level = 3 in the generated Cython code.

@sympy-bot
Copy link

sympy-bot commented Jul 10, 2022

Hi, I am the SymPy bot (v167). I'm here to help you write a release notes entry. Please read the guide on how to write release notes.

Your release notes are in good order.

Here is what the release notes will look like:

  • utilities
    • The autowrap module now sets language_level = 3 in the generated Cython code. (#23754 by @oscarbenjamin)

This will be added to https://github.com/sympy/sympy/wiki/Release-Notes-for-1.11.

Click here to see the pull request description that was parsed.
<!-- Your title above should be a short description of what
was changed. Do not include the issue number in the title. -->

#### References to other Issues or PRs
<!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact
format, e.g. "Fixes #1234" (see
https://tinyurl.com/auto-closing for more information). Also, please
write a comment on that issue linking back to this pull request once it is
open. -->

- Partial fix for #23061
- Extracts the more straight-forward parts of #23745

#### Brief description of what is fixed or changed

Various fixes related to things that give warnings in the test suite (including some warnings that are hidden by default):

- Not closing files properly (i.e. use `with open()`)
- Not closing subprocesses properly (use `communicate` etc)
- Using the deprecated `imp` module
- Using the deprecated `np.matrix` type
- Plotting code that passes out of range values to numpy functions

Also:

- Aesara has deprecated the `broadcastable` argument in favour of `shape`.
- Some warnings from Aesara are now suppressed (in the test suite).
- Autowrap now sets `language_level=3` in the generated cython code.

#### Other comments

I would like to merge this as a bunch of minor fixes and then rebase #23745 and think more generally about how to handle warnings in CI.

#### Release Notes

<!-- Write the release notes for this release below between the BEGIN and END
statements. The basic format is a bulleted list with the name of the subpackage
and the release note for this PR. For example:

* solvers
  * Added a new solver for logarithmic equations.

* functions
  * Fixed a bug with log of integers.

or if no release note(s) should be included use:

NO ENTRY

See https://github.com/sympy/sympy/wiki/Writing-Release-Notes for more
information on how to write release notes. The bot will check your release
notes automatically to see if they are formatted correctly. -->

<!-- BEGIN RELEASE NOTES -->
* utilities
  * The autowrap module now sets `language_level = 3` in the generated Cython code.
<!-- END RELEASE NOTES -->

Update

The release notes on the wiki have been updated.

@oscarbenjamin oscarbenjamin added this to the SymPy 1.11 milestone Jul 10, 2022
@oscarbenjamin oscarbenjamin added printing Testing Related to the test runner. Do not use for test failures unless it relates to the test runner itself utilities.autowrap Code quality CI plotting labels Jul 10, 2022
@oscarbenjamin oscarbenjamin marked this pull request as ready for review July 10, 2022 18:56
@github-actions
Copy link

github-actions bot commented Jul 10, 2022

Benchmark results from GitHub Actions

Lower numbers are good, higher numbers are bad. A ratio less than 1
means a speed up and greater than 1 means a slowdown. Green lines
beginning with + are slowdowns (the PR is slower then master or
master is slower than the previous release). Red lines beginning
with - are speedups.

Significantly changed benchmark results (PR vs master)

Significantly changed benchmark results (master vs previous release)

       before           after         ratio
     [77f1d79c]       [cace0875]
     <sympy-1.10.1^0>                 
+      97.9±0.4ms          179±1ms     1.83  sum.TimeSum.time_doit

Full benchmark results can be found as artifacts in GitHub Actions
(click on checks at the top of the PR).

@@ -139,7 +139,7 @@ def _get_or_create(self, s, name=None, dtype=None, broadcastable=None):
if key in self.cache:
return self.cache[key]

value = aet.tensor(name=name, dtype=dtype, broadcastable=broadcastable)
value = aet.tensor(name=name, dtype=dtype, shape=broadcastable)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is incompatible with Theano: #23745 (comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've reverted this change. We will need to consider separately how easy it will be to support both Theano and Aesara going forwards. At some point it definitely makes sense to just drop support for Theano.

This was changed because Aesara gives a warning when the broadcastable
argument is used and suggests changing it to shape. However shape is
incompatible with Theano so this commit restores the use of the
broadcastable argument that works with both Theano and Aesara although
it gives a warning under Aesara.
@oscarbenjamin
Copy link
Contributor Author

This is ready for review.

@oscarbenjamin oscarbenjamin merged commit b0badca into sympy:master Jul 12, 2022
@oscarbenjamin oscarbenjamin deleted the pr_warnings_cleanup branch July 12, 2022 10:19
@oscarbenjamin
Copy link
Contributor Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Code quality plotting printing Testing Related to the test runner. Do not use for test failures unless it relates to the test runner itself utilities.autowrap
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants