Thanks to visit codestin.com
Credit goes to github.com

Skip to content

More code removal #7771

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

Merged
merged 2 commits into from
Jun 26, 2017
Merged

More code removal #7771

merged 2 commits into from
Jun 26, 2017

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Jan 9, 2017

Alternative to #7730 (see #7730 (comment) in particular).

@anntzer anntzer force-pushed the more-code-removal branch 3 times, most recently from 81236ff to 58f81f6 Compare January 9, 2017 15:58
@codecov-io
Copy link

codecov-io commented Jan 10, 2017

Current coverage is 62.11% (diff: 42.85%)

Merging #7771 into master will increase coverage by <.01%

@@             master      #7771   diff @@
==========================================
  Files           174        174          
  Lines         56028      55984    -44   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
- Hits          34803      34777    -26   
+ Misses        21225      21207    -18   
  Partials          0          0          

Powered by Codecov. Last update 0c54bee...58f81f6

@@ -912,13 +910,6 @@ def get_joinstyle(self):
"""
return self._joinstyle

def get_linestyle(self, style):
Copy link
Member

Choose a reason for hiding this comment

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

These need to go through a deprecation cycle.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In #7730 (comment), you were fine changing the signature of get_linestyle (which would be a breaking change for anyone (hem) relying on this method) without a deprecation cycle, is it clear that removing the method is any different?

Copy link
Member

Choose a reason for hiding this comment

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

That is a fair point. Currently considering my inconsistencies 😜 .

@@ -1024,26 +1024,3 @@ def get_paths_extents(paths, transforms=[]):
raise ValueError("No paths provided")
return Bbox.from_extents(*_path.get_path_collection_extents(
Affine2D(), paths, transforms, [], Affine2D()))


def _define_deprecated_functions(ns):
Copy link
Member

Choose a reason for hiding this comment

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

👍


funcname = self._lineStyles.get(self._linestyle, '_draw_nothing')
Copy link
Member

Choose a reason for hiding this comment

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

This will now raise on non-valid self._linestyle. Do the git logs provide any clue why was this coded this way?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

set_linestyle (the class here inherits it from lines.Line2D) now has extensive validation before setting _linestyle, which means invalid _linestyle should never happen. The same code in lines was committed by jdh as far back as 2004, whereas the history of set_linestyle is a bit difficult to unwind but I'd guess the checking came later.

Copy link
Member

Choose a reason for hiding this comment

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

👍

@@ -1242,26 +1241,6 @@ def set_dashes(self, seq):
else:
self.set_linestyle((0, seq))

def _draw_solid(self, renderer, gc, path, trans):
Copy link
Member

Choose a reason for hiding this comment

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

I do not think we want to remove setting these with out a deprecation cycle.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

butbutbut they're private :/

Copy link
Member

Choose a reason for hiding this comment

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

I do not mind removing the methods, it the inner call to gc.set_linestyle that I am worried about.

Copy link
Member

Choose a reason for hiding this comment

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

(I meant to click on the line below and apparently missed).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The whole point is that graphics contexts don't have that property anymore.

self.set_linewidth(1)

self._pen.SetStyle(self._style)
self.gfx_ctx.SetPen(self._pen)
Copy link
Member

Choose a reason for hiding this comment

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

Does this pen setting just get replaced elsewhere, or do we never use a pen?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We never use set_linestyle. Pens are set in other parts of the code though.

@@ -409,8 +409,6 @@ class GraphicsContextWx(GraphicsContextBase):
'miter': wx.JOIN_MITER,
'round': wx.JOIN_ROUND}

_dashd_wx = wxc.dashd_wx
Copy link
Member

Choose a reason for hiding this comment

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

Should we deprecate dashd_wx as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There's a bunch of other entries in wx_compat.py which are not used (e.g. StockCursor) so I think that would belong to a (separate) cleanup of wx_compat.

@tacaswell
Copy link
Member

I am still concerned about pulling the (unused by us) public method off of the GraphicContextBase.

Also simplify linestyle handling by Line2D.
@anntzer anntzer force-pushed the more-code-removal branch from f513ac5 to cd54509 Compare May 29, 2017 05:06
@anntzer
Copy link
Contributor Author

anntzer commented May 29, 2017

Turned the removal into a deprecation.

@QuLogic
Copy link
Member

QuLogic commented Jun 26, 2017

Ping @tacaswell?

@tacaswell tacaswell merged commit 04d1bcd into matplotlib:master Jun 26, 2017
@anntzer anntzer deleted the more-code-removal branch June 26, 2017 16:16
@QuLogic QuLogic added this to the 2.1 (next point release) milestone Jun 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants