Skip to content

Try branca dependency #359

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 2 commits into from
Feb 15, 2016
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ before_install:
- travis_retry conda create --yes -n test python=$PYTHON --file requirements.txt
- source activate test
- conda install --yes --file requirements-dev.txt;
- pip install git+https://github.com/python-visualization/branca.git
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ocefpaf

However, let's hold the merge until we have a first release of branca. When projects are tied together like this the first dependency dictates the releases.

This line downloads and install the master of branca, meaning folium tests will run with branca's present master.
I guess this is too dangerous because it breaks tests reproducibility. But I know it's possible to ask pip for a specific commit, so that we could live (on folium's master) on a version of branca that's not necessarily released.

Depending on your reply, I'll either freeze a branca commit into this line, or create a v0.0.0 of branca and ask for it in this line.

Copy link
Member

Choose a reason for hiding this comment

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

Depending on your reply, I'll either freeze a branca commit into this line, or create a v0.0.0 of branca and ask for it in this line.

Actually that depends on your plans. Even though I recommend a release (v0.1.0 at least), we can deal with Travis-CI to pointing master until the dust settles. I just don't want that to become a permanent thing.

So,

  • if you see a fast development pace in the next few weeks leave it as-is and let's open an issue to remind us to change it later;
  • if you are not going to be developing branca for a while and/or if you thing other might be interested into using this ASAP, then let's tag a release.

- if [[ "$PYTHON" == "3.4" ]]; then
travis_retry conda install --yes nbconvert jupyter_client ipykernel;
conda install --yes -c ioos geopandas;
Expand Down
5 changes: 3 additions & 2 deletions examples/Colormaps.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"import sys\n",
"sys.path.append('..')\n",
"import folium\n",
"import branca\n",
"print (folium.__file__)\n",
"print (folium.__version__)"
]
Expand Down Expand Up @@ -142,7 +143,7 @@
},
"outputs": [],
"source": [
"import folium.colormap as cm"
"import branca.colormap as cm"
]
},
{
Expand Down Expand Up @@ -747,7 +748,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.4.3"
"version": "3.5.1"
}
},
"nbformat": 4,
Expand Down
13 changes: 7 additions & 6 deletions examples/Features.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
},
"outputs": [],
"source": [
"import branca\n",
"import folium\n",
"from folium import features"
]
Expand Down Expand Up @@ -94,7 +95,7 @@
}
],
"source": [
"f = folium.element.Figure(figsize=(8,8))\n",
"f = branca.element.Figure(figsize=(8,8))\n",
"m = folium.Map([0,0], zoom_start=1)\n",
"mk = features.Marker([0,0])\n",
"pp = features.Popup(\"hello\")\n",
Expand Down Expand Up @@ -137,7 +138,7 @@
}
],
"source": [
"f = folium.element.Figure()\n",
"f = branca.element.Figure()\n",
"m = folium.Map([0,0], zoom_start=1)\n",
"mk = features.RegularPolygonMarker([0,0])\n",
"mk2 = features.RegularPolygonMarker([0,45])\n",
Expand Down Expand Up @@ -187,7 +188,7 @@
"scatter = vincent.Scatter(multi_iter2, iter_idx='x', height=100, width=200)\n",
"data = json.loads(scatter.to_json())\n",
"\n",
"f = folium.element.Figure()\n",
"f = branca.element.Figure()\n",
"m = folium.Map([0,0], zoom_start=1)\n",
"mk = features.Marker([0,0])\n",
"p = features.Popup(\"Hello\")\n",
Expand Down Expand Up @@ -238,7 +239,7 @@
"scatter = vincent.Scatter(multi_iter2, iter_idx='x', height=400, width=600)\n",
"data = json.loads(scatter.to_json())\n",
"\n",
"f = folium.element.Figure()\n",
"f = branca.element.Figure()\n",
"v = features.Vega(data, height=40, width=600)\n",
"f.add_children(v)\n",
"\n",
Expand Down Expand Up @@ -283,7 +284,7 @@
"scatter = vincent.Scatter(multi_iter2, iter_idx='x', height=250, width=420)\n",
"data = json.loads(scatter.to_json())\n",
"\n",
"f = folium.element.Figure()\n",
"f = branca.element.Figure()\n",
"\n",
"# Create two maps\n",
"m = folium.Map([0,0], tiles='stamenwatercolor',\n",
Expand Down Expand Up @@ -441,7 +442,7 @@
"scatter = vincent.Scatter(multi_iter2, iter_idx='x', height=250, width=420)\n",
"data = json.loads(scatter.to_json())\n",
"\n",
"f = folium.element.Figure()\n",
"f = branca.element.Figure()\n",
"\n",
"d1 = f.add_subplot(1,2,1)\n",
"d2 = f.add_subplot(1,2,2)\n",
Expand Down
4 changes: 2 additions & 2 deletions examples/GeoJSON and choropleth.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@
}
],
"source": [
"from folium.colormap import linear\n",
"from branca.colormap import linear\n",
"\n",
"colormap = linear.YlGn.scale(\n",
" unemployment.Unemployment.min(),\n",
Expand Down Expand Up @@ -871,7 +871,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.4.4"
"version": "3.5.1"
}
},
"nbformat": 4,
Expand Down
50 changes: 6 additions & 44 deletions examples/ImageOverlay.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -22,50 +22,12 @@
},
"outputs": [],
"source": [
"import sys"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"sys.path.insert(0,'..')"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"import folium"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"from folium.six import PY3"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"import sys\n",
"sys.path.insert(0,'..')\n",
"\n",
"from branca.six import PY3\n",
"\n",
"import folium\n",
"from folium import plugins"
]
},
Expand Down
17 changes: 9 additions & 8 deletions examples/Popups.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"import sys\n",
"sys.path.insert(0,'..')\n",
"import folium\n",
"import branca\n",
"print (folium.__file__)\n",
"print (folium.__version__)"
]
Expand Down Expand Up @@ -222,7 +223,7 @@
" </code>\n",
" </p>\n",
" \"\"\"\n",
"iframe = folium.element.IFrame(html=html, width=500, height=300)\n",
"iframe = branca.element.IFrame(html=html, width=500, height=300)\n",
"popup = folium.Popup(iframe, max_width=2650)\n",
"\n",
"folium.Marker([30,-100], popup=popup).add_to(m)\n",
Expand Down Expand Up @@ -265,11 +266,11 @@
],
"source": [
"# Let's create a Figure, with a map inside.\n",
"f = folium.element.Figure()\n",
"f = branca.element.Figure()\n",
"folium.Map([-25,150], zoom_start=3).add_to(f)\n",
"\n",
"# Let's put the figure into an IFrame.\n",
"iframe = folium.element.IFrame(width=500, height=300)\n",
"iframe = branca.element.IFrame(width=500, height=300)\n",
"f.add_to(iframe)\n",
"\n",
"# Let's put the IFrame in a Popup\n",
Expand Down Expand Up @@ -299,21 +300,21 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 2.7",
"language": "python",
"name": "python3"
"name": "py27"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.5.1"
"pygments_lexer": "ipython2",
"version": "2.7.11"
}
},
"nbformat": 4,
Expand Down
7 changes: 4 additions & 3 deletions examples/folium_examples.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"import sys\n",
"sys.path.insert(0,'..')\n",
"import folium\n",
"import branca\n",
"#import pandas as pd\n",
"#folium.initialize_notebook()"
]
Expand Down Expand Up @@ -414,7 +415,7 @@
"df = pd.read_csv(county_data, na_values=[' '])\n",
"\n",
"\n",
"colorscale = folium.colormap.linear.YlOrRd.scale(0,50e3)\n",
"colorscale = branca.colormap.linear.YlOrRd.scale(0,50e3)\n",
"employed_series = df.set_index('FIPS_Code')['Employed_2011']\n",
"\n",
"def style_function(feature):\n",
Expand Down Expand Up @@ -458,7 +459,7 @@
}
],
"source": [
"colorscale = folium.colormap.linear.YlGnBu.scale(0,30)\n",
"colorscale = branca.colormap.linear.YlGnBu.scale(0,30)\n",
"employed_series = df.set_index('FIPS_Code')['Unemployment_rate_2011']\n",
"\n",
"def style_function(feature):\n",
Expand Down Expand Up @@ -502,7 +503,7 @@
}
],
"source": [
"colorscale = folium.colormap.linear.PuRd.scale(0,100000)\n",
"colorscale = branca.colormap.linear.PuRd.scale(0,100000)\n",
"employed_series = df.set_index('FIPS_Code')['Median_Household_Income_2011'].dropna()\n",
"\n",
"def style_function(feature):\n",
Expand Down
3 changes: 0 additions & 3 deletions folium/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
MarkerCluster, MultiPolyLine, PolyLine, Vega,
RegularPolygonMarker, TopoJson, WmsTileLayer)

import folium.colormap as colormap

__version__ = '0.3.0.dev'

__all__ = ['Map',
Expand All @@ -27,7 +25,6 @@
'Popup',
'TileLayer',
'ClickForMarker',
'colormap',
'CustomIcon',
'DivIcon',
'GeoJson',
Expand Down
Loading