Skip to content

Commit

Permalink
Fix trailing whitespace and EOF errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mattpap committed Jun 1, 2016
1 parent 01e3930 commit 03911a4
Show file tree
Hide file tree
Showing 125 changed files with 159 additions and 226 deletions.
2 changes: 1 addition & 1 deletion bokeh/application/handlers/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ def __init__(self, *args, **kwargs):

with codecs.open(filename, 'r', 'UTF-8') as f:
kwargs['source'] = f.read()

super(ScriptHandler, self).__init__(*args, **kwargs)
3 changes: 1 addition & 2 deletions bokeh/browserlib.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@

from bokeh.util.deprecate import deprecated_module
deprecated_module('bokeh.browserlib', '0.11', 'use bokeh.util.browser instead')
del deprecated_module

from .util.browser import * # NOQA
from .util.browser import * # NOQA
2 changes: 1 addition & 1 deletion bokeh/charts/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def stack(*comp_glyphs, **kwargs):
Args:
*comp_glyphs (:class:`CompositeGlyph`): a sequence of glyphs to stack
Returns:
comp_glyphs: a list of composite glyphs
Expand Down
2 changes: 1 addition & 1 deletion bokeh/command/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ def _build_docstring():
__doc__ += "%8s : %s\n" % (cls.name, cls.help)

_build_docstring()
del _build_docstring
del _build_docstring
3 changes: 1 addition & 2 deletions bokeh/command/tests/test_command_package.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@

import bokeh.command as command

def test_doc():
import bokeh.command.subcommands as sc
assert len(command.__doc__.split("\n")) == 5 + len(sc.all)
for x in sc.all:
assert (x.name + " : " + x.help) in command.__doc__
assert (x.name + " : " + x.help) in command.__doc__
3 changes: 1 addition & 2 deletions bokeh/command/tests/test_subcommand.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

from mock import MagicMock
import pytest

Expand Down Expand Up @@ -39,4 +38,4 @@ def test_base_invoke():
with pytest.raises(NotImplementedError):
p = MagicMock()
obj = _Good(p)
super(_Good, obj).invoke("foo")
super(_Good, obj).invoke("foo")
2 changes: 1 addition & 1 deletion bokeh/core/_templates/plot_div.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
#}
<div class="bk-root">
<div class="plotdiv" id="{{ elementid }}"></div>
</div>
</div>
2 changes: 1 addition & 1 deletion bokeh/core/compat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
.. _MEP25: https://github.com/matplotlib/matplotlib/wiki/MEP25
.. _mplexporter: https://github.com/mpld3/mplexporter/tree/master/mplexporter
'''
'''
2 changes: 1 addition & 1 deletion bokeh/core/compat/mplexporter/renderers/vega_renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def open_figure(self, fig, props):
self.scales = []
self.axes = []
self.marks = []

def open_axes(self, ax, props):
if len(self.axes) > 0:
warnings.warn("multiple axes not yet supported")
Expand Down
2 changes: 1 addition & 1 deletion bokeh/icons.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,4 @@
for icon_name in __icons__:
__doc__ += ' <li><i class="fa-li fa fa-%s" style="list-style-type: none !important;"></i>%s</li>\n' % (icon_name, icon_name)

__doc__ += ' </ul>'
__doc__ += ' </ul>'
3 changes: 1 addition & 2 deletions bokeh/mixins.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@

from bokeh.util.deprecate import deprecated_module
deprecated_module('bokeh.mixins', '0.11', 'use bokeh.core.property_mixins instead')
del deprecated_module

from .core.property_mixins import * # NOQA
from .core.property_mixins import * # NOQA
15 changes: 7 additions & 8 deletions bokeh/models/tests/test_callbacks.py
Original file line number Diff line number Diff line change
@@ -1,38 +1,37 @@

import sys

from pytest import raises
from bokeh.models import CustomJS, Slider


def test_js_callback():

slider = Slider()

cb = CustomJS(code="foo();", args={'x': slider})
assert cb.lang == 'javascript'
assert 'foo()' in cb.code
assert cb.args['x'] is slider

with raises(ValueError): # not a plot object
CustomJS(code="foo();", args={'x': 3})

with raises(AttributeError): # kwargs not supported
CustomJS(code="foo();", x=slider)


def test_py_callback():

slider = Slider()
foo = None # fool pyflakes

def cb(x=slider):
foo()
cb = CustomJS.from_py_func(cb)
assert cb.lang == 'javascript'
assert 'foo()' in cb.code
assert cb.args['x'] is slider

with raises(ValueError): # not a plot object
def cb(x=4):
foo()
Expand Down
3 changes: 1 addition & 2 deletions bokeh/properties.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@

from bokeh.util.deprecate import deprecated_module
deprecated_module('bokeh.properties', '0.11', 'use bokeh.core.properties instead')
del deprecated_module

from .core.properties import * # NOQA
from .core.properties import * # NOQA
2 changes: 1 addition & 1 deletion bokeh/sampledata/world_cities.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@
try:
data = pd.read_csv(_data_dir("world_cities.csv"))
except (IOError, OSError):
raise RuntimeError('Could not load file "world_cities.csv". Please execute bokeh.sampledata.download()')
raise RuntimeError('Could not load file "world_cities.csv". Please execute bokeh.sampledata.download()')
3 changes: 1 addition & 2 deletions bokeh/templates.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@

from bokeh.util.deprecate import deprecated_module
deprecated_module('bokeh.templates', '0.11', 'use bokeh.core.templates instead')
del deprecated_module

from .core.templates import * # NOQA
from .core.templates import * # NOQA
2 changes: 1 addition & 1 deletion bokeh/tests/test_transforms.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# Placeholder for tests against the computed transforms
# Placeholder for tests against the computed transforms
2 changes: 1 addition & 1 deletion bokeh/util/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,4 @@
.. automodule:: bokeh.util.version
:members:
'''
'''
2 changes: 1 addition & 1 deletion bokeh/util/future.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ def __new__(cls, name, this_bases, d):
if this_bases is None:
return type.__new__(cls, name, (), d)
return meta(name, bases, d)
return metaclass('temporary_class', None, {})
return metaclass('temporary_class', None, {})
2 changes: 1 addition & 1 deletion bokehjs/gulp/tasks/install.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ handleOutput = (data) ->

gulp.task "install", ->
# installs js and css
# note: sets cwd as parent dir so that LICENSE.txt is accessible to setup.py
# note: sets cwd as parent dir so that LICENSE.txt is accessible to setup.py
setup = spawn "python", ["setup.py", "--install_js"], {cwd: "../"}
for output in ["stdout", "stderr"]
setup[output].setEncoding "utf8"
Expand Down
2 changes: 1 addition & 1 deletion bokehjs/src/coffee/core/layout/solver.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Solver

num_edit_variables: () ->
@solver._editMap._array.length

update_variables: (trigger=true) ->
@solver.updateVariables()
if trigger
Expand Down
2 changes: 1 addition & 1 deletion bokehjs/src/coffee/core/util/refs.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ convert_to_ref = (value) ->
module.exports =
convert_to_ref: convert_to_ref
create_ref: create_ref
is_ref: is_ref
is_ref: is_ref
4 changes: 2 additions & 2 deletions bokehjs/src/coffee/document.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,12 @@ class Document
@_solver.add_edit_variable(@_doc_width)
@_solver.add_edit_variable(@_doc_height)
$(window).on("resize", $.proxy(@resize, @))

solver: () ->
@_solver

resize: () ->

for root in @_roots
if root.layoutable isnt true
continue
Expand Down
2 changes: 1 addition & 1 deletion bokehjs/src/coffee/models/annotations/annotation.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class AnnotationView extends Renderer.View

_get_panel_offset: () ->
# Sub-classes may have to implement _get_panel_offset themselves
# because different renderers draw themselves differently so
# because different renderers draw themselves differently so
# need the individual classes to determine the correct offset.
x = @model.panel._left._value
y = @model.panel._bottom._value
Expand Down
2 changes: 1 addition & 1 deletion bokehjs/src/coffee/models/annotations/title.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class TitleView extends TextAnnotation.View
@mset('text_align', @mget('title_align'))

_get_computed_location: () ->
[width, height] = @_calculate_text_dimensions(@plot_view.canvas_view.ctx, @text)
[width, height] = @_calculate_text_dimensions(@plot_view.canvas_view.ctx, @text)
switch @model.panel.side
when 'left'
vx = 0
Expand Down
2 changes: 1 addition & 1 deletion bokehjs/src/coffee/models/axes/continuous_axis.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ class ContinuousAxis extends Axis.Model
type: 'ContinuousAxis'

module.exports =
Model: ContinuousAxis
Model: ContinuousAxis
12 changes: 6 additions & 6 deletions bokehjs/src/coffee/models/layouts/box.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class Box extends LayoutDOM.Model
for child in @get_layoutable_children()
child.trigger('change')
@trigger('change')

get_edit_variables: () ->
edit_variables = super()
for child in @get_layoutable_children()
Expand Down Expand Up @@ -113,7 +113,7 @@ class Box extends LayoutDOM.Model
var_keys = _.keys(vars)

# Make total widget sizes fill the orthogonal direction
# TODO(bird) Can't we make this shorter by using span which has already picked a
# TODO(bird) Can't we make this shorter by using span which has already picked a
# dominant direction (we'd just also need to set a doc_span)
rect = @_child_rect(vars)
if @_horizontal
Expand All @@ -124,7 +124,7 @@ class Box extends LayoutDOM.Model
constraints.push(EQ(rect.width, [ -1, @_width ]))

# Add equal-size constraint
# - A child's "interesting area" (like the plot area) is the same size as the previous child
# - A child's "interesting area" (like the plot area) is the same size as the previous child
# (a child can opt out of this by not returning the box-equal-size variables)
if @_horizontal
if @_has_var(['box-equal-size-left', 'box-equal-size-right', 'width'], var_keys)
Expand All @@ -147,12 +147,12 @@ class Box extends LayoutDOM.Model
if last.span.size
constraints.push(EQ(last.span.start, last.span.size, [-1, next.span.start]))

# The whitespace at end of one child + start of next must equal the box spacing.
# This must be a weak constraint because it can conflict with aligning the
# The whitespace at end of one child + start of next must equal the box spacing.
# This must be a weak constraint because it can conflict with aligning the
# alignable edges in each child. Alignment is generally more important visually than spacing.
constraints.push(WEAK_EQ(last.whitespace.after, next.whitespace.before, 0 - @spacing))

# If we can't satisfy the whitespace being equal to box spacing, we should fix
# If we can't satisfy the whitespace being equal to box spacing, we should fix
# it (align things) by increasing rather than decreasing the whitespace.
constraints.push(GE(last.whitespace.after, next.whitespace.before, 0 - @spacing))
last = next
Expand Down
16 changes: 8 additions & 8 deletions bokehjs/src/coffee/models/layouts/layout_dom.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ class LayoutDOMView extends BokehView
children = @model.get_layoutable_children()
@child_views = {}
build_views(@child_views, children)

for child in children
# Look-up the child_view in @child_views and then append
# We can't just read from @child_views because then we
# don't get guaranteed ordering. Which is a problem in
# We can't just read from @child_views because then we
# don't get guaranteed ordering. Which is a problem in
# non-box layouts.
child_view = @child_views[child.id]
@$el.append(child_view.$el)
Expand Down Expand Up @@ -114,7 +114,7 @@ class LayoutDOMView extends BokehView
# what their width should be in responsive mode.
return null



class LayoutDOM extends Model
type: "LayoutDOM"
Expand Down Expand Up @@ -142,11 +142,11 @@ class LayoutDOM extends Model

get_constraints: () ->
constraints = []

# Make sure things dont squeeze out of their bounding box
constraints.push(GE(@_dom_left))
constraints.push(GE(@_dom_top))

# Plot has to be inside the width/height
constraints.push(GE(@_left))
constraints.push(GE(@_width, [-1, @_right]))
Expand All @@ -156,7 +156,7 @@ class LayoutDOM extends Model
## Declare computed constraints
constraints.push(EQ(@_width_minus_right, [-1, @_width], @_right))
constraints.push(EQ(@_height_minus_bottom, [-1, @_height], @_bottom))

return constraints

get_layoutable_children: () ->
Expand Down Expand Up @@ -198,7 +198,7 @@ class LayoutDOM extends Model
# 'box-equal-size-bottom': @_height_minus_bottom
# 'box-equal-size-left' : @_left
# 'box-equal-size-right' : @_width_minus_right

constrained_variables = {
'origin-x': @_dom_left
'origin-y': @_dom_top
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@ class CategoricalMapper extends LinearMapper.Model
return result

module.exports =
Model: CategoricalMapper
Model: CategoricalMapper
Loading

0 comments on commit 03911a4

Please sign in to comment.