Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Remove unnecessary calls to np.array in examples.#16430

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
tacaswell merged 1 commit intomatplotlib:masterfromanntzer:unarray
Feb 7, 2020

Conversation

anntzer
Copy link
Contributor

There's many places where explicit conversion to np.array is not necessary
-- because matplotlib or numpy already handles the conversion, or
because the variable is already an array. Removing these calls makes
the examples concentrate more on the plotting-relevant parts.

PR Summary

PR Checklist

  • Has Pytest style unit tests
  • Code isFlake 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

@anntzeranntzer added this to thev3.3.0 milestoneFeb 6, 2020
There's many places where explicit conversion to np.array is not necessary-- because matplotlib or numpy already handles the conversion, orbecause the variable is already an array.  Removing these calls makesthe examples concentrate more on the plotting-relevant parts.
@codecov
Copy link

codecovbot commentedFeb 7, 2020

Codecov Report

Merging#16430 intomaster willdecrease coverage by6.00%.
The diff coverage isn/a.

Impacted file tree graph

@@            Coverage Diff             @@##           master   #16430      +/-   ##==========================================- Coverage   80.86%   74.85%   -6.01%==========================================  Files         307      276      -31       Lines       75749    68660    -7089       Branches     9692     9688       -4     ==========================================- Hits        61252    51395    -9857- Misses      11959    14909    +2950+ Partials     2538     2356     -182
Impacted FilesCoverage Δ
lib/matplotlib/backends/backend_gtk3cairo.py0.00% <0.00%> (-100.00%)⬇️
...b/matplotlib/backends/qt_editor/formsubplottool.py0.00% <0.00%> (-100.00%)⬇️
lib/matplotlib/backends/backend_qt5cairo.py0.00% <0.00%> (-89.19%)⬇️
lib/matplotlib/backends/backend_qt4agg.py20.00% <0.00%> (-80.00%)⬇️
lib/matplotlib/tests/test_backend_qt.py14.75% <0.00%> (-78.38%)⬇️
lib/matplotlib/tests/test_backend_cairo.py25.00% <0.00%> (-75.00%)⬇️
lib/matplotlib/tests/test_usetex.py30.55% <0.00%> (-69.45%)⬇️
lib/matplotlib/backends/backend_wxcairo.py0.00% <0.00%> (-64.00%)⬇️
lib/matplotlib/backends/backend_qt5agg.py10.63% <0.00%> (-63.83%)⬇️
lib/matplotlib/backends/backend_pgf.py19.08% <0.00%> (-61.03%)⬇️
... and198 more

Continue to review full report at Codecov.

Legend -Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing data
Powered byCodecov. Last updateb2e6e6d...b5155b7. Read thecomment docs.

@@ -30,7 +30,7 @@
])


x, y = np.dot(R,np.array([x, y]))
x, y = np.dot(R, [x, y])
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
x,y=np.dot(R,[x,y])
x,y=R @[x,y]

Simpler?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

I'd rather leave the dot -> @ for another time.

tacaswell reacted with thumbs up emoji
@tacaswell
Copy link
Member

The travis OSX failure looks un-related (failure to read a png back in).

@tacaswelltacaswell merged commitcb904b1 intomatplotlib:masterFeb 7, 2020
@anntzeranntzer deleted the unarray branchFebruary 7, 2020 16:03
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@timhoffmtimhoffmtimhoffm approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
v3.3.0
Development

Successfully merging this pull request may close these issues.

3 participants
@anntzer@tacaswell@timhoffm

[8]ページ先頭

©2009-2025 Movatter.jp