Skip to content

Commit

Permalink
Merge pull request #17 from nens/casper-windows
Browse files Browse the repository at this point in the history
Instlalation notes for windows
  • Loading branch information
arjanverkerk committed Nov 15, 2019
2 parents b13a74f + 35cbe0f commit acbc538
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 22 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ matrix:
- os: linux
env: PYTHON_VERSION="3.6" MAINDEPS="numpy=1.14 gdal=2.2.4 scipy=1.1 pytz" DEPS="dask-core=0.20 toolz=0.10 pandas=0.23 geopandas=0.5"
- os: linux
env: PYTHON_VERSION="3.7" MAINDEPS="numpy gdal scipy pytz" DEPS="dask-core toolz geopandas"
env: PYTHON_VERSION="3.7" MAINDEPS="numpy gdal=2.* scipy pytz" DEPS="dask-core toolz geopandas"
- os: osx
env: PYTHON_VERSION="3.7" MAINDEPS="numpy gdal scipy pytz" DEPS="dask-core toolz geopandas"
env: PYTHON_VERSION="3.7" MAINDEPS="numpy gdal=2.* scipy pytz" DEPS="dask-core toolz geopandas"

install:
- wget https://repo.anaconda.com/pkgs/misc/conda-execs/conda-latest-$TRAVIS_OS_NAME-64.exe -O conda.exe
Expand Down
5 changes: 5 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ Changelog of dask-geomodeling
the default behaviour of all blocks that handle file paths: by default, the
path is not required to be in geomodeling.root.

- Added installation instructions for windows.

- Improved the ipyleaflet plugin so that it can deal with multiple notebook
servers on the same machine. The parameter 'hostname' was replaced by 'url'.


2.0.4 (2019-11-01)
------------------
Expand Down
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ environment:
matrix:
- PYTHON_PATH: "C:\\Miniconda37"
PYTHON_VERSION: 3.7
DEPS: "numpy gdal scipy pytz dask-core toolz geopandas"
DEPS: "numpy gdal=2.* scipy pytz dask-core toolz geopandas"

- PYTHON_PATH: "C:\\Miniconda37-x64"
PYTHON_VERSION: 3.7
DEPS: "numpy gdal scipy pytz dask-core toolz geopandas"
DEPS: "numpy gdal=2.* scipy pytz dask-core toolz geopandas"

init:
- "ECHO %PYTHON% %PYTHON_VERSION%"
Expand Down
14 changes: 7 additions & 7 deletions dask_geomodeling/ipyleaflet_plugin.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from datetime import datetime
from io import BytesIO
from urllib.parse import urljoin

import numpy as np
import traitlets
Expand Down Expand Up @@ -89,7 +90,7 @@ class GeomodelingLayer(WMSLayer):
"""Visualize a dask_geomodeling.RasterBlock on a ipyleaflet Map.
:param block: a dask_geomodeling.RasterBlock instance to visualize
:param hostname: The hostname of the jupyter server
:param url: The url of the jupyter server (e.g. https://localhost:8888)
:param style: a valid matplotlib colormap
:param vmin: the minimum value (for the colormap)
:param vmax: the maximum value (for the colormap)
Expand All @@ -115,13 +116,12 @@ class GeomodelingLayer(WMSLayer):
vmin = traitlets.Float(0.0).tag(sync=True, o=True)
vmax = traitlets.Float(1.0).tag(sync=True, o=True)

def __init__(self, block, hostname="localhost", **kwargs):
for server in notebookapp.list_running_servers():
if server["hostname"] == hostname:
kwargs["url"] = server["url"] + "wms"
break
def __init__(self, block, url=None, **kwargs):
if url is None:
# just get the first URL one
url = next(notebookapp.list_running_servers())["url"]
self.layers = block.to_json()
super().__init__(**kwargs)
super().__init__(url=urljoin(url, "wms"), **kwargs)


def load_jupyter_server_extension(nb_server_app):
Expand Down
60 changes: 51 additions & 9 deletions docs/installation.rst
Original file line number Diff line number Diff line change
@@ -1,21 +1,63 @@
Installation
============

Recommended: use conda
----------------------
Requirements
------------

1. `Install anaconda <https://docs.anaconda.com/anaconda/install/>`_
2. Run ``conda install dask-geomodeling -c conda-forge``
- python >= 3.5
- GDAL 2.* (with BigTIFF support)
- numpy
- scipy
- dask[delayed]
- pandas
- geopandas
- ipyleaflet, matplotlib, pillow (for the ipyleaflet plugin)

Anaconda (all platforms)
------------------------

Using the ipyleaflet plugin
---------------------------
1. `Install anaconda / miniconda <https://docs.anaconda.com/anaconda/install/>`_
2. Start the `Anaconda Prompt` via the start menu
3. `conda config --add channels conda-forge`
4. `conda update conda`
5. `conda install python=3.6 gdal=2.4.1 scipy=1.3.1 dask-geomodeling ipyleaflet matplotlib pillow`

.. note::

The version pins of python, gdal and scipy are related to issues specific
to Windows. On other platforms you may leave them out, although we do not
recommend using Python 3.8 yet. If you need other python or GDAL versions
on windows: while `dask-geomodeling` itself is compatible with all current
versions, you may may have a hard time getting it to work via Anaconda and
it will probably be easier using the pip route listed below. Good luck out
there.


Windows (pip)
-------------

The following recipe is still a work in progress:

1. `Install Python 3.* (stable) <https://www.python.org/downloads/windows/>`_
2. `Install GDAL 2.* (MSVC 2015) <http://www.gisinternals.com/release.php>`_
3. Add the GDAL installation path to your PATH variable
4. Start the command prompt
5. `pip install gdal==2.* dask-geomodeling ipyleaflet matplotlib pillow`
6. (optionally) `pip install ipyleaflet matplotlib pillow`

.. note::

You might need to setup your C++ compiler according to
`this <https://wiki.python.org/moin/WindowsCompilers>`_

On the ipyleaflet plugin
------------------------

dask-geomodeling comes with a ipyleaflet plugin for `Jupyter<https://jupyter.org/>`_
so that you can show your generated views on a mapviewer. If you want to use
it, install some additional dependencies::

$ conda install jupyter ipyleaflet matplotlib pillow
$ conda [or pip] install jupyter ipyleaflet matplotlib pillow

And start your notebook server with the plugin::

Expand All @@ -34,7 +76,7 @@ These instructions make use of the system-wide Python 3 interpreter.

Install dask-geomodeling::

$ pip install --user dask-geomodeling[test]
$ pip install --user dask-geomodeling[test,cityhash]

Run the tests::

Expand Down Expand Up @@ -71,7 +113,7 @@ Install PyGDAL with the correct version (example assumes GDAL 2.2.3)::

Install dask-geomodeling::

(.venv) $ pip install -e .[test]
(.venv) $ pip install -e .[test,cityhash]

Run the tests::

Expand Down
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

install_requires = (
[
"cityhash", # optional, but speeds up hashing a lot
"dask[delayed]>=0.18",
"pandas>=0.19",
"geopandas>=0.4",
Expand Down Expand Up @@ -54,6 +53,6 @@
install_requires=install_requires,
tests_require=tests_require,
python_requires='>=3.5',
extras_require={"test": tests_require},
extras_require={"test": tests_require, "cityhash": ["cityhash"]},
entry_points={"console_scripts": []},
)

0 comments on commit acbc538

Please sign in to comment.