Skip to content

Commit

Permalink
Merge pull request #2371 from graphite-project/flake8
Browse files Browse the repository at this point in the history
flake8 cleanup
  • Loading branch information
piotr1212 committed Oct 30, 2018
2 parents 183cfca + 0f30228 commit 1134385
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 25 deletions.
22 changes: 11 additions & 11 deletions docs/render_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ areaAlpha
---------
*Default: 1.0*

Takes a floating point number between 0.0 and 1.0
Takes a floating point number between 0.0 and 1.0

Sets the alpha (transparency) value of filled areas when using an areaMode_

Expand All @@ -484,7 +484,7 @@ areaMode
*Default: none*

Enables filling of the area below the graphed lines. Fill area is the same color as
the line color associated with it. See areaAlpha_ to make this area transparent.
the line color associated with it. See areaAlpha_ to make this area transparent.
Takes one of the following parameters which determines the fill mode to use:

``none``
Expand All @@ -498,7 +498,7 @@ Takes one of the following parameters which determines the fill mode to use:
Each target line is displayed as the sum of all previous lines plus the value of the current line.

.. _param-bgcolor:

bgcolor
-------
*Default: value from the [default] template in graphTemplates.conf*
Expand Down Expand Up @@ -573,7 +573,7 @@ drawNullAsZero

Converts any None (null) values in the displayed metrics to zero at render time.

.. _param-fgcolor:
.. _param-fgcolor:

fgcolor
-------
Expand Down Expand Up @@ -1076,7 +1076,7 @@ Example:
&title=Apache Busy Threads, All Servers, Past 24h
.. _param-tz:

tz
--
*Default: The timezone specified in local_settings.py*
Expand Down Expand Up @@ -1202,23 +1202,23 @@ Sets the time format used when displaying the X-axis. See
for format specification details.

.. _param-yAxisSide:

yAxisSide
---------
*Default: left*

Sets the side of the graph on which to render the Y-axis. Accepts values of ``left`` or ``right``

.. _param-yDivisors:

yDivisors
---------
*Default: 4,5,6*

Sets the preferred number of intermediate values to display on the Y-axis (Y values between the
minimum and maximum). Note that Graphite will ultimately choose what values (and how many) to
display based on a 'pretty' factor, which tries to maintain a sensible scale (e.g. preferring
intermediary values like 25%,50%,75% over 33.3%,66.6%). To explicitly set the Y-axis values,
minimum and maximum). Note that Graphite will ultimately choose what values (and how many) to
display based on a 'pretty' factor, which tries to maintain a sensible scale (e.g. preferring
intermediary values like 25%,50%,75% over 33.3%,66.6%). To explicitly set the Y-axis values,
see `yStep`_

.. _param-yLimit:
Expand Down Expand Up @@ -1295,7 +1295,7 @@ yMinRight
In dual Y-axis mode, sets the lower bound of the right Y-Axis (See: `yMin`_)

.. _param-yStep:

yStep
-----
*Default: Calculated automatically*
Expand Down
4 changes: 3 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,6 @@ obsoletes = graphite <= 0.9.9
# E731 do not assign a lambda expression, use a def
# E114 indentation is not a multiple of four (comment)
# E266 too many leading '#' for block comment
ignore=E128,E111,E501,E231,E201,E202,E203,E251,E124,E265,E121,E261,E226,E262,E701,E241,E221,E703,E502,F841,E401,E222,E126,E122,E222,E225,E228,E127,E123,E713,E125,E227,E271,E272,N802,N803,N806,E731,E114,E266
# W504 line break after binary operator
# W605 invalid escape sequence
ignore=E128,E111,E501,E231,E201,E202,E203,E251,E124,E265,E121,E261,E226,E262,E701,E241,E221,E703,E502,F841,E401,E222,E126,E122,E222,E225,E228,E127,E123,E713,E125,E227,E271,E272,N802,N803,N806,E731,E114,E266,W504,W605
2 changes: 1 addition & 1 deletion webapp/graphite/render/evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def evaluateTokens(requestContext, tokens, replacements=None, pipedArg=None):
val = replacements[name]
if not isinstance(val, six.string_types):
return val
elif re.match('^-?[\d.]+$', val):
elif re.match(r'^-?[\d.]+$', val):
return float(val)
else:
return val
Expand Down
24 changes: 12 additions & 12 deletions webapp/graphite/render/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1200,7 +1200,7 @@ def movingWindow(requestContext, seriesList, windowSize, func='average', xFilesF
Takes one metric or a wildcard seriesList, a number N of datapoints
or a quoted string with a length of time like '1hour' or '5min' (See ``from /
until`` in the render\_api_ for examples of time formats), a function to apply to the points
until`` in the :doc:`Render API <render_api>` for examples of time formats), a function to apply to the points
in the window to produce the output, and an xFilesFactor value to specify how many points in the
window must be non-null for the output to be considered valid. Graphs the
output of the function for the preceeding datapoints for each point on the graph.
Expand Down Expand Up @@ -1362,7 +1362,7 @@ def movingMedian(requestContext, seriesList, windowSize, xFilesFactor=None):
Takes one metric or a wildcard seriesList followed by a number N of datapoints
or a quoted string with a length of time like '1hour' or '5min' (See ``from /
until`` in the render\_api_ for examples of time formats), and an xFilesFactor value to specify
until`` in the :doc:`Render API <render_api>` for examples of time formats), and an xFilesFactor value to specify
how many points in the window must be non-null for the output to be considered valid. Graphs the
median of the preceeding datapoints for each point on the graph.
Expand Down Expand Up @@ -1712,7 +1712,7 @@ def movingAverage(requestContext, seriesList, windowSize, xFilesFactor=None):
Takes one metric or a wildcard seriesList followed by a number N of datapoints
or a quoted string with a length of time like '1hour' or '5min' (See ``from /
until`` in the render\_api_ for examples of time formats), and an xFilesFactor value to specify
until`` in the :doc:`Render API <render_api>` for examples of time formats), and an xFilesFactor value to specify
how many points in the window must be non-null for the output to be considered valid. Graphs the
average of the preceeding datapoints for each point on the graph.
Expand Down Expand Up @@ -1742,7 +1742,7 @@ def movingSum(requestContext, seriesList, windowSize, xFilesFactor=None):
Takes one metric or a wildcard seriesList followed by a number N of datapoints
or a quoted string with a length of time like '1hour' or '5min' (See ``from /
until`` in the render\_api_ for examples of time formats), and an xFilesFactor value to specify
until`` in the :doc:`Render API <render_api>` for examples of time formats), and an xFilesFactor value to specify
how many points in the window must be non-null for the output to be considered valid. Graphs the
sum of the preceeding datapoints for each point on the graph.
Expand Down Expand Up @@ -1772,7 +1772,7 @@ def movingMin(requestContext, seriesList, windowSize, xFilesFactor=None):
Takes one metric or a wildcard seriesList followed by a number N of datapoints
or a quoted string with a length of time like '1hour' or '5min' (See ``from /
until`` in the render\_api_ for examples of time formats), and an xFilesFactor value to specify
until`` in the :doc:`Render API <render_api>` for examples of time formats), and an xFilesFactor value to specify
how many points in the window must be non-null for the output to be considered valid. Graphs the
minimum of the preceeding datapoints for each point on the graph.
Expand Down Expand Up @@ -1802,7 +1802,7 @@ def movingMax(requestContext, seriesList, windowSize, xFilesFactor=None):
Takes one metric or a wildcard seriesList followed by a number N of datapoints
or a quoted string with a length of time like '1hour' or '5min' (See ``from /
until`` in the render\_api_ for examples of time formats), and an xFilesFactor value to specify
until`` in the :doc:`Render API <render_api>` for examples of time formats), and an xFilesFactor value to specify
how many points in the window must be non-null for the output to be considered valid. Graphs the
maximum of the preceeding datapoints for each point on the graph.
Expand Down Expand Up @@ -3385,7 +3385,7 @@ def sortByName(requestContext, seriesList, natural=False, reverse=False):
- Natural sorting: server1, server2, server11, server12
"""
def natSortKey(series):
return re.sub("(\d+)", lambda x: "{0:010}".format(int(x.group(0))), series.name)
return re.sub(r"(\d+)", lambda x: "{0:010}".format(int(x.group(0))), series.name)

if natural:
seriesList.sort(key=natSortKey, reverse=reverse)
Expand Down Expand Up @@ -3970,7 +3970,7 @@ def linearRegression(requestContext, seriesList, startSourceAt=None, endSourceAt
Takes one metric or a wildcard seriesList, followed by a quoted string with the
time to start the line and another quoted string with the time to end the line.
The start and end times are inclusive (default range is from to until). See
``from / until`` in the render\_api_ for examples of time formats. Datapoints
``from / until`` in the :doc:`Render API <render_api>` for examples of time formats. Datapoints
in the range is used to regression.
Example:
Expand Down Expand Up @@ -4106,7 +4106,7 @@ def dashed(requestContext, seriesList, dashLength=5):
def timeStack(requestContext, seriesList, timeShiftUnit='1d', timeShiftStart=0, timeShiftEnd=7):
"""
Takes one metric or a wildcard seriesList, followed by a quoted string with the
length of time (See ``from / until`` in the render\_api_ for examples of time formats).
length of time (See ``from / until`` in the :doc:`Render API <render_api>` for examples of time formats).
Also takes a start multiplier and end multiplier for the length of time
create a seriesList which is composed the original metric series stacked with time shifts
Expand Down Expand Up @@ -4163,7 +4163,7 @@ def timeStack(requestContext, seriesList, timeShiftUnit='1d', timeShiftStart=0,
def timeShift(requestContext, seriesList, timeShift, resetEnd=True, alignDST=False):
"""
Takes one metric or a wildcard seriesList, followed by a quoted string with the
length of time (See ``from / until`` in the render\_api_ for examples of time formats).
length of time (See ``from / until`` in the :doc:`Render API <render_api>` for examples of time formats).
Draws the selected metrics shifted in time. If no sign is given, a minus sign ( - ) is
implied which will shift the metric back in time. If a plus sign ( + ) is given, the
Expand Down Expand Up @@ -4250,7 +4250,7 @@ def timeSlice(requestContext, seriesList, startSliceAt, endSliceAt="now"):
"""
Takes one metric or a wildcard metric, followed by a quoted string with the
time to start the line and another quoted string with the time to end the line.
The start and end times are inclusive. See ``from / until`` in the render\_api_
The start and end times are inclusive. See ``from / until`` in the :doc:`Render API <render_api>`
for examples of time formats.
Useful for filtering out a part of a series of data from a wider range of
Expand Down Expand Up @@ -4424,7 +4424,7 @@ def verticalLine(requestContext, ts, label=None, color=None):
def threshold(requestContext, value, label=None, color=None):
"""
Takes a float F, followed by a label (in double quotes) and a color.
(See ``bgcolor`` in the render\_api_ for valid color names & formats.)
(See ``bgcolor`` in the :doc:`Render API <render_api>` for valid color names & formats.)
Draws a horizontal line at value F across the graph.
Expand Down

0 comments on commit 1134385

Please sign in to comment.