Repository: bokeh/bokeh

Issue:
Fix deprecation warnings
It's painful to look through `examples.log` at travis ci for actual errors. There are lots of warnings about column lengths, not using `value()` for `text_font_size`, etc. or related to external libraries.

Also, if we deprecate something, lets make sure that we removed all occurrences before merging. This may not be trivial to do everything manually, but you can take advantage of travis ci. Just remove the thing you're deprecating or replace deprecation with hard error (throw an exception) for a moment, run tests and when everything is fixed, restore deprecation. 



Discussion:

Resolving patch:
diff --git a/bokeh/core/properties.py b/bokeh/core/properties.py
--- a/bokeh/core/properties.py
+++ b/bokeh/core/properties.py
@@ -1796,15 +1796,14 @@ class FontSizeSpec(DataSpec):
     or a data source column name referring to column of font size data.
 
     '''
+    _font_size_re = re.compile("^[0-9]+(\.[0-9]+)?(ex|px|cm|mm|in|pt|pc)$")
+
     def __init__(self, default, help=None):
         super(FontSizeSpec, self).__init__(List(String), default=default, help=help)
 
     def prepare_value(self, cls, name, value):
-        if isinstance(value, string_types):
-            deprecated('Setting a fixed font size value as a string %r is deprecated, '
-                       'set with value(%r) or [%r] instead' % (value, value, value))
-            if len(value) > 0 and value[0].isdigit():
-                value = dict(value=value)
+        if isinstance(value, string_types) and self._font_size_re.match(value) is not None:
+            value = dict(value=value)
         return super(FontSizeSpec, self).prepare_value(cls, name, value)
 
 class UnitsSpecProperty(DataSpecProperty):
diff --git a/examples/models/trail.py b/examples/models/trail.py
--- a/examples/models/trail.py
+++ b/examples/models/trail.py
@@ -80,8 +80,8 @@ def trail_map(data):
     lat = (min(data.lat) + max(data.lat)) / 2
 
     map_options = GMapOptions(lng=lon, lat=lat, zoom=13)
-    plot = GMapPlot(title="%s - Trail Map" % name, map_options=map_options,
-                    plot_width=800, plot_height=800, api_key=API_KEY)
+    plot = GMapPlot(plot_width=800, plot_height=800, map_options=map_options, api_key=API_KEY)
+    plot.title.text = "%s - Trail Map" % name
     plot.x_range = DataRange1d()
     plot.y_range = DataRange1d()
     plot.add_tools(PanTool(), WheelZoomTool(), ResetTool())


Test patch:
diff --git a/bokeh/core/tests/test_properties.py b/bokeh/core/tests/test_properties.py
--- a/bokeh/core/tests/test_properties.py
+++ b/bokeh/core/tests/test_properties.py
@@ -10,7 +10,7 @@
     HasProps, NumberSpec, ColorSpec, Bool, Int, Float, Complex, String,
     Regex, Seq, List, Dict, Tuple, Array, Instance, Any, Interval, Either,
     Enum, Color, Align, DashPattern, Size, Percent, Angle, AngleSpec,
-    DistanceSpec, Override, Include, MinMaxBounds, TitleProp)
+    DistanceSpec, FontSizeSpec, Override, Include, MinMaxBounds, TitleProp)
 
 from bokeh.models import Plot
 from bokeh.models.annotations import Title
@@ -476,6 +476,20 @@ class Foo(HasProps):
         a.x = dict(field="baz")
         self.assertDictEqual(a.x, dict(field="baz"))
 
+class TestFontSizeSpec(unittest.TestCase):
+    def test_font_size_from_string(self):
+        class Foo(HasProps):
+            x = FontSizeSpec(default=None)
+
+        a = Foo()
+        self.assertIs(a.x, None)
+        a.x = '10pt'
+        self.assertEqual(a.x, dict(value='10pt'))
+        self.assertEqual(a.lookup('x').serializable_value(a), dict(value='10pt'))
+        a.x = '_10pt'
+        self.assertEqual(a.x, '_10pt')
+        self.assertEqual(a.lookup('x').serializable_value(a), dict(field='_10pt'))
+
 class TestAngleSpec(unittest.TestCase):
     def test_default_none(self):
         class Foo(HasProps):