Skip to content

Make ArrowStyle docstrings numpydoc compatible #8343

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 5 commits into from
Mar 24, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
change indentation of parameter description
  • Loading branch information
patniharshit committed Mar 21, 2017
commit 2a31ccac7473676ba791674b72baf1060c236ff7
76 changes: 38 additions & 38 deletions lib/matplotlib/patches.py
Original file line number Diff line number Diff line change
Expand Up @@ -3427,10 +3427,10 @@ def __init__(self, head_length=.4, head_width=.2):
Parameters
----------
head_length : float, optional, default : 0.4
Length of the arrow head
Length of the arrow head

head_width : float, optional, default : 0.2
Width of the arrow head
Width of the arrow head
"""

super(ArrowStyle.CurveA, self).__init__(
Expand All @@ -3449,10 +3449,10 @@ def __init__(self, head_length=.4, head_width=.2):
Parameters
----------
head_length : float, optional, default : 0.4
Length of the arrow head
Length of the arrow head

head_width : float, optional, default : 0.2
Width of the arrow head
Width of the arrow head
"""

super(ArrowStyle.CurveB, self).__init__(
Expand All @@ -3471,10 +3471,10 @@ def __init__(self, head_length=.4, head_width=.2):
Parameters
----------
head_length : float, optional, default : 0.4
Length of the arrow head
Length of the arrow head

head_width : float, optional, default : 0.2
Width of the arrow head
Width of the arrow head
"""

super(ArrowStyle.CurveAB, self).__init__(
Expand All @@ -3493,10 +3493,10 @@ def __init__(self, head_length=.4, head_width=.2):
Parameters
----------
head_length : float, optional, default : 0.4
Length of the arrow head
Length of the arrow head

head_width : float, optional, default : 0.2
Width of the arrow head
Width of the arrow head
"""

super(ArrowStyle.CurveFilledA, self).__init__(
Expand All @@ -3516,10 +3516,10 @@ def __init__(self, head_length=.4, head_width=.2):
Parameters
----------
head_length : float, optional, default : 0.4
Length of the arrow head
Length of the arrow head

head_width : float, optional, default : 0.2
Width of the arrow head
Width of the arrow head
"""

super(ArrowStyle.CurveFilledB, self).__init__(
Expand All @@ -3539,10 +3539,10 @@ def __init__(self, head_length=.4, head_width=.2):
Parameters
----------
head_length : float, optional, default : 0.4
Length of the arrow head
Length of the arrow head

head_width : float, optional, default : 0.2
Width of the arrow head
Width of the arrow head
"""

super(ArrowStyle.CurveFilledAB, self).__init__(
Expand Down Expand Up @@ -3641,22 +3641,22 @@ def __init__(self,
Parameters
----------
widthA : float, optional, default : 1.0
Width of the bracket
Width of the bracket

lengthA : float, optional, default : 0.2
Length of the bracket
Length of the bracket

angleA : float, optional, default : None
Angle between the bracket and the line
Angle between the bracket and the line

widthB : float, optional, default : 1.0
Width of the bracket
Width of the bracket

lengthB : float, optional, default : 0.2
Length of the bracket
Length of the bracket

angleB : float, optional, default : None
Angle between the bracket and the line
Angle between the bracket and the line
"""

super(ArrowStyle.BracketAB, self).__init__(
Expand All @@ -3676,13 +3676,13 @@ def __init__(self, widthA=1., lengthA=0.2, angleA=None):
Parameters
----------
widthA : float, optional, default : 1.0
Width of the bracket
Width of the bracket

lengthA : float, optional, default : 0.2
Length of the bracket
Length of the bracket

angleA : float, optional, default : None
Angle between the bracket and the line
Angle between the bracket and the line
"""

super(ArrowStyle.BracketA, self).__init__(True, None,
Expand All @@ -3702,13 +3702,13 @@ def __init__(self, widthB=1., lengthB=0.2, angleB=None):
Parameters
----------
widthB : float, optional, default : 1.0
Width of the bracket
Width of the bracket

lengthB : float, optional, default : 0.2
Length of the bracket
Length of the bracket

angleB : float, optional, default : None
Angle between the bracket and the line
Angle between the bracket and the line
"""

super(ArrowStyle.BracketB, self).__init__(None, True,
Expand All @@ -3730,22 +3730,22 @@ def __init__(self,
Parameters
----------
widthA : float, optional, default : 1.0
Width of the bracket
Width of the bracket

lengthA : int
Copy link
Member

Choose a reason for hiding this comment

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

I'm slightly confused, __init__ just above this docstring doesn't take a lengthA or lengthB argument, is the docstring just wrong here at the moment?

Copy link
Member

Choose a reason for hiding this comment

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

I think you're right @dstansby .

@patniharshit can you update this docstring to more accurately reflect the call signature?

Length of the bracket
Length of the bracket

angleA : float, optional, default : None
Angle between the bracket and the line
Angle between the bracket and the line

widthB : float, optional, default : 1.0
Width of the bracket
Width of the bracket

lengthB : int
Length of the bracket
Length of the bracket

angleB : float, optional, default : None
Angle between the bracket and the line
Angle between the bracket and the line
"""

super(ArrowStyle.BarAB, self).__init__(
Expand All @@ -3764,13 +3764,13 @@ def __init__(self, head_length=.5, head_width=.5, tail_width=.2):
Parameters
----------
head_length : float, optional, default : 0.5
Length of the arrow head
Length of the arrow head

head_width : float, optional, default : 0.5
Width of the arrow head
Width of the arrow head

tail_width : float, optional, default : 0.2
Width of the arrow tail
Width of the arrow tail
"""

self.head_length, self.head_width, self.tail_width = \
Expand Down Expand Up @@ -3851,13 +3851,13 @@ def __init__(self, head_length=.4, head_width=.4, tail_width=.4):
Parameters
----------
head_length : float, optional, default : 0.4
Length of the arrow head
Length of the arrow head

head_width : float, optional, default : 0.4
Width of the arrow head
Width of the arrow head

tail_width : float, optional, default : 0.4
Width of the arrow tail
Width of the arrow tail
"""

self.head_length, self.head_width, self.tail_width = \
Expand Down Expand Up @@ -3956,10 +3956,10 @@ def __init__(self, tail_width=.3, shrink_factor=0.5):
Parameters
----------
tail_width : float, optional, default : 0.3
Width of the tail
Width of the tail

shrink_factor : float, optional, default : 0.5
Fraction of the arrow width at the middle point
Fraction of the arrow width at the middle point
"""

self.tail_width = tail_width
Expand Down