Skip to content

Commit

Permalink
Minor docs fixes (python-visualization#1936)
Browse files Browse the repository at this point in the history
* add geodatasets

* minor docs fixes

* missed a few happy new years

* readd first year
  • Loading branch information
ocefpaf authored Apr 23, 2024
1 parent ae827c1 commit 4b860c0
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 15 deletions.
2 changes: 1 addition & 1 deletion docs/advanced_guide/geodedetic_image_overlay.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ lon -= 180
import matplotlib
cm = matplotlib.cm.get_cmap("cubehelix")
cm = matplotlib.colormaps["cubehelix"]
normed_data = (data - data.min()) / (data.max() - data.min())
colored_data = cm(normed_data)
Expand Down
5 changes: 4 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,11 @@
master_doc = "index"

# General information about the project.
import datetime

year = datetime.datetime.now(tz=datetime.timezone.utc).date().year
project = "Folium"
copyright = "2013, Rob Story"
copyright = f"2013-{year}, Rob Story"

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand Down
3 changes: 2 additions & 1 deletion docs/user_guide/geojson/geojson_popup_and_tooltip.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,14 @@ states.head()
```

```{code-cell} ipython3
import io
import requests
response = requests.get(
"https://gist.githubusercontent.com/tvpmb/4734703/raw/"
"b54d03154c339ed3047c66fefcece4727dfc931a/US%2520State%2520List"
)
abbrs = pd.read_json(response.text)
abbrs = pd.read_json(io.StringIO(response.text))
abbrs.head(3)
```
Expand Down
12 changes: 6 additions & 6 deletions docs/user_guide/plugins/WmsTimeDimension.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@

Add a time dimension to a WMS tile layer.

Note that we don't render the output in this example, because the web service
used here is not always available.

### Exploring the WMS with OWSLib

```
```{code-cell} ipython3
from owslib.wms import WebMapService
Expand All @@ -20,7 +17,7 @@ print("\n".join(web_map_services.contents.keys()))

### Layer metadata

```
```{code-cell} ipython3
layer = "CRW_SST"
wms = web_map_services.contents[layer]
Expand All @@ -41,7 +38,10 @@ if style not in wms.styles:

### Map with WmsTileLayer and TimestampedWmsTileLayers

```
```{code-cell} ipython3
import folium
import folium.plugins
m = folium.Map(location=[-40, -50], zoom_start=5)
wms_tile_layer = folium.WmsTileLayer(
Expand Down
13 changes: 7 additions & 6 deletions docs/user_guide/plugins/timeslider_choropleth.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ The class needs at least two arguments to be instantiated.
1. A string-serielized geojson containing all the features (i.e., the areas)
2. A dictionary with the following structure:

```

```ipython3
styledict = {
'0': {
'2017-1-1': {'color': 'ffffff', 'opacity': 1},
Expand All @@ -32,11 +33,11 @@ Using both color and opacity gives us the ability to simultaneously visualize tw
We use `geopandas` to load a dataset containing the boundaries of all the countries in the world.

```{code-cell} ipython3
import geopandas as gpd
import geodatasets
import geopandas
assert "naturalearth_lowres" in gpd.datasets.available
datapath = gpd.datasets.get_path("naturalearth_lowres")
gdf = gpd.read_file(datapath)
datapath = geodatasets.get_path("naturalearth land")
gdf = geopandas.read_file(datapath)
```

```{code-cell} ipython3
Expand Down Expand Up @@ -66,7 +67,7 @@ n_periods, n_sample = 48, 40
assert n_sample < n_periods
datetime_index = pd.date_range("2016-1-1", periods=n_periods, freq="M")
datetime_index = pd.date_range("2016-1-1", periods=n_periods, freq="ME")
dt_index_epochs = datetime_index.astype("int64") // 10 ** 9
dt_index = dt_index_epochs.astype("U10")
Expand Down
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ flake8-comprehensions
flake8-import-order
flake8-mutable
flake8-nb>=0.2.5
geodatasets
geographiclib
geopandas
gpxpy
Expand Down

0 comments on commit 4b860c0

Please sign in to comment.