More code removal #7771

Open
wants to merge 2 commits into
from

Projects

None yet

3 participants

@anntzer
Contributor
anntzer commented Jan 9, 2017

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

anntzer added some commits Jan 9, 2017
@anntzer anntzer Remove deprecated functions in matplotlib.path. 52e4374
@anntzer anntzer Remove unused 'linestyle' property of GraphicsContextBase.
Also simplify linestyle handling by Line2D.
58f81f6
@codecov-io
codecov-io commented Jan 10, 2017 edited

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):
@tacaswell
tacaswell Jan 10, 2017 Member

These need to go through a deprecation cycle.

@anntzer
anntzer Jan 10, 2017 Contributor

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?

@tacaswell
tacaswell Jan 10, 2017 Member

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):
- funcname = self._lineStyles.get(self._linestyle, '_draw_nothing')
@tacaswell
tacaswell Jan 10, 2017 Member

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

@anntzer
anntzer Jan 10, 2017 Contributor

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.

@@ -1242,26 +1241,6 @@ def set_dashes(self, seq):
else:
self.set_linestyle((0, seq))
- def _draw_solid(self, renderer, gc, path, trans):
@tacaswell
tacaswell Jan 10, 2017 Member

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

@anntzer
anntzer Jan 10, 2017 Contributor

butbutbut they're private :/

@tacaswell
tacaswell Jan 10, 2017 Member

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

@tacaswell
tacaswell Jan 10, 2017 Member

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

@anntzer
anntzer Jan 10, 2017 Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment