Skip to content

Commit

Permalink
Refactor Styletron/BaseUI providers out of data filter example app fi…
Browse files Browse the repository at this point in the history
…le. (#4047)
  • Loading branch information
tgorkin authored Jan 28, 2020
1 parent 4744562 commit c851b7d
Show file tree
Hide file tree
Showing 415 changed files with 8,413 additions and 7,313 deletions.
4 changes: 2 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
module.exports = {
plugins: ['react'],
extends: ['uber-jsx', 'uber-es2015', 'prettier', 'prettier/react', 'plugin:import/errors'],
overrides: {
overrides: [{
files: ['*.spec.js', 'webpack.config.js', '**/bundle/*.js'],
rules: {
'import/no-extraneous-dependencies': 0
}
},
}],
settings: {
'import/core-modules': [
'@luma.gl/core',
Expand Down
4 changes: 2 additions & 2 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ version: 2

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: bindings/python/pydeck/docs/conf.py
configuration: bindings/pydeck/docs/conf.py

# Optionally set the version of Python and requirements required to build your docs
python:
install:
- requirements: bindings/python/pydeck/requirements-dev.txt
- requirements: bindings/pydeck/requirements-dev.txt
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ matrix:
sources:
- ubuntu-toolchain-r-test
before_install:
- cd bindings/python/pydeck
- cd bindings/pydeck
python:
- "3.5"
- "2.7"
Expand All @@ -56,5 +56,5 @@ matrix:
- pip install -r requirements-dev.txt
- nvm install 10.16.0
- nvm use 10.16.0
- pip install -e . --install-option "--build_all"
- pip install -e . --install-option "--build_all" --verbose
script: pytest --cov=pydeck
39 changes: 37 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,44 @@ Each version should:
Ref: http://keepachangelog.com/en/0.3.0/
-->

## deck.gl v8.0
## deck.gl v8.1

### deck.gl [8.1.0-alpha.1] - Jan 17 2020

- Voodoo fix for Mac+NVIDIA bug (#4166)
- Remove unnecessary code from project glsl (#4162)
- Fix H3HexagonLayer update when viewport jumps (#4158)
- Refactor render tests; use stricter pass criteria (#4157)
- [Extension] Add source_target to brushing mode (#4150)
- Add offset feature to PathStyleExtension (#4126)
- Project module: support pre-projected positions (#4140)
- Repeat maps at low zoom levels (#4105)
- IconLayer: fix copy texture data when resize (#4151)
- Path layer vertex shader improvements (#4111)
- Bump mjolnir.js dependency (#4141)
- Error handling (#4135)
- IconLayer: use load instead of loadImage to load icons (#4137)
- Bump loaders.gl (#4136)
- Non-Geospatial TileLayer (#4117)
- Remove unused dependencies from geo-layers (#4127)
- Support initialViewState updates (#4038)
- Fix support for luma.gl buffers as external attributes (#4121)
- [react] explicitly set deck canvas position (#4124)

### deck.gl [8.1.0-alpha.0] - Jan 08 2020

- pydeck: Reduce JupyterLab bundle size (#4110)
- fix cursor style in React (#4118)
- GPUGridAggregator: Add WA for ANGLE specific bug. (#4113)
- fix debug bundle warning (#4107)
- pydeck: Simplify setup.py and add JupyterLab installation instructions (#4096)
- fix react key warning (#4098)
- Fix randomly failed icon layer render test (#4079)
- update evaluate-children to pass deck gl view ports to children with deckGLViewProps (#4092)
- clean up prop handling (#4080)
- Clean up hover handling (#4081)

### deck.gl v8.0 Prereleases
## deck.gl v8.0

### deck.gl [8.0.0-beta.2] - Dec 17 2019

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,4 @@ $RECYCLE.BIN/
# Cut JS files created in build process
**/pydeck/nbextension/static/index.js
**/pydeck/nbextension/static/index.js.map
**/pydeck/nbextension/static/extensionRequires.js
**/pydeck/io/templates/requirejs_dependencies.json
**/_build
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2019 Uber Technologies Inc.
Copyright (c) 2020 Uber Technologies Inc.
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
include LICENSE.txt
include README.md

include setupbase.py
include pytest.ini
include .coverage.rc
include .coveragerc

include pydeck/io/templates/*.j2

# Examples
graft examples
Expand Down
85 changes: 85 additions & 0 deletions bindings/pydeck/PUBLISH.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
Publication checklist for pydeck
==========

Preferably run these commands in a virtual environment. Install pydeck from its source.
Build deck.gl from its source as well. If you're unsure how to do this, the README.md files for both.
This also assumes that you have pypi credentials to publish pydeck and NPM credentials to publish @deck.gl/juypter-widget.

1) Verify that there is a CDN-hosted release of @deck.gl/jupyter-widget for the standalone html template
within pydeck.

2) Verify that Deck object works on a fresh install from the source in the following
environments:

- `.show()` in a Jupyter Notebook
- `.to_html()` in a Jupyter Notebook
- `.show()` in Jupyter Lab
- `.to_html()` in Jupyter Lab
- `.to_html()` in a Python REPL

3) Bump the version number in `pydeck/_version.py`

4) Run the following commands to publish to the test.pypi environment:

```
rm -r ./dist/* # If exists, clear out the current dist folder
pip install -e . --verbose
python setup.py sdist bdist_wheel
pip install twine # If you have not installed twine
python -m twine upload --repository-url https://test.pypi.org/legacy/ dist/*
```

5) In a fresh virtualenv, install pydeck from test.pypi:

```
pip install -i https://test.pypi.org/simple/ pydeck=={{version}}
```

where `{{version}}` is your semantic version.

6) Verify that pydeck works from test.pypi in the same environments as above.

7) If everything appears to be working, publish to pypi.

```
twine upload dist/*
```

8) Verify again the pydeck installed from the main pypi works in the environment above.

9) Inform the deck.gl Slack channel that a new version of pydeck has been published.


Updating documentation
==========

The pydeck documentation has three main components

- The .md files in the pydeck directory.
- The .rst files in the pydeck directory under `docs/`.
- The binder examples, which are kept on the `binder` branch of this repository.
- Most critically, the docstrings in the Python code itself, which combined with the .rst files generates
the documentation at https://deckgl.readthedocs.io/en/latest/.

### Updating the binder branch

Align the binder branch in-line with what's on master:

```
git checkout master
git pull
git checkout binder
git merge binder
git push
```

The Dockerfile at the root of the deck.gl repository can be tested locally with the following code:

```bash
docker build -t test-binder:latest .
docker run -p 8888:8888 test-binder:latest jupyter notebook --ip 0.0.0.0
```

This is what Binder will be executing when running the examples.

Verify the current examples work at https://mybinder.org/v2/gh/uber/deck.gl/binder?filepath=examples
40 changes: 22 additions & 18 deletions bindings/python/pydeck/README.md → bindings/pydeck/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,20 @@ For __interactive demos__, click the binder logo below:
pip install pydeck
```

If you are installing this for a Jupyter notebook server, you'll have to enable the widget extension.
To do this, run:
To install pydeck for Jupyter Notebook, run the following commands on your Jupyter server:

```bash
jupyter nbextension install --sys-prefix --symlink --overwrite --py pydeck
jupyter nbextension enable --sys-prefix --py pydeck
```

To install pydeck for JupyterLab, run the following:

```bash
jupyter labextension install @jupyter-widgets/jupyterlab-manager
jupyter labextension install @deck.gl/jupyter-widget
```

### Mapbox API token

Like deck.gl, the pydeck library takes its basemap tiles from [Mapbox](http://mapbox.com/). Register with Mapbox, and you can [find your Mapbox access token here](https://account.mapbox.com/access-tokens/). The service is free until a certain level of traffic is exceeded.
Expand All @@ -50,7 +56,7 @@ UK_ACCIDENTS_DATA = ('https://raw.githubusercontent.com/uber-common/'
layer = pdk.Layer(
'HexagonLayer',
UK_ACCIDENTS_DATA,
get_position='[lng, lat]',
get_position=['lng', 'lat'],
auto_highlight=True,
elevation_scale=50,
pickable=True,
Expand Down Expand Up @@ -100,7 +106,7 @@ and include your console output, if any.
git clone https://github.com/uber/deck.gl/

# Navigate to the pydeck module
cd deck.gl/bindings/python/pydeck
cd deck.gl/bindings/pydeck

# Create a virtual environment
python3 -m venv env3
Expand All @@ -111,26 +117,18 @@ python3 setup.py install

## Development

Build the deck.gl project at the root of this repository:

```bash
git clone https://github.com/uber/deck.gl/
cd deck.gl
# Build the entire deck.gl project
yarn bootstrap

# Optional but recommended: Run a hot reloading development server
cd modules/jupyter-widget
yarn watch
```

If running a non-default URL for webpack's dev server, change the URL in the `PYDECK_DEV_SERVER` environment variable,
e.g., `export PYDECK_DEV_SERVER=http://localhost:8081`.

Elsewhere, run:
From the directory of this README, build pydeck:

```bash
export PYDECK_DEV_SERVER=http://localhost:8080
cd deck.gl/bindings/python/pydeck

# Create a virtual environment
python3 -m venv env3
. env3/bin/activate
Expand All @@ -140,15 +138,21 @@ pip install -r requirements-dev.txt
pip install -e .
```

To enable develop with Jupyter Lab, run:
JupyterLab is the recommended environment for development testing with pydeck.
To develop with JupyterLab, run from this directory:

```bash
# Execute in deck.gl/modules/jupyter-widget directory
jupyter labextension install @jupyter-widgets/jupyterlab-manager@1.0.3 --no-build
# cd ../../modules/jupyter-widget
jupyter labextension install @jupyter-widgets/jupyterlab-manager --no-build
jupyter labextension install . --no-build
jupyter labextension link .
cd -
jupyter lab build
```

The `jupyter lab --watch` command can be used to provide hot reloading for development.


### Tests

Tests are handled by pytest. In the top-level pydeck directory, you can type:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
sys.path.insert(0, os.path.abspath('../'))

project = u'pydeck'
copyright = u'2019, Uber Technologies, Inc.'
copyright = u'2020, Uber Technologies, Inc.'
author = u'Andrew Duberstein'
# The short X.Y version
version = u''
Expand All @@ -32,7 +32,7 @@
]
texinfo_documents = [
(master_doc, 'pydeck', u'pydeck Documentation',
author, 'pydeck', 'One line description of project.',
author, 'pydeck', 'Python wrapper for deck.gl',
'Miscellaneous'),
]
epub_title = project
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Welcome to pydeck's documentation!
==================================

If you have not already, `follow the installation instructions <https://github.com/uber/deck.gl/blob/master/bindings/python/pydeck/README.md>`_
If you have not already, `follow the installation instructions <https://github.com/uber/deck.gl/blob/master/bindings/pydeck/README.md>`_

.. toctree::
:maxdepth: 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ HexagonLayer <https://deck.gl/#/examples/core-layers/hexagon-layer>`__:
layer = pdk.Layer(
'HexagonLayer', # `type` positional argument is here
UK_ACCIDENTS_DATA,
get_position='[lng, lat]',
get_position=['lng', 'lat'],
auto_highlight=True,
elevation_scale=50,
pickable=True,
Expand Down Expand Up @@ -91,7 +91,7 @@ Try changing ``type`` above to ``ScatterplotLayer`` and add some
layer = pdk.Layer(
'ScatterplotLayer', # Change the `type` positional argument here
UK_ACCIDENTS_DATA,
get_position='[lng, lat]',
get_position=['lng', 'lat'],
auto_highlight=True,
get_radius=1000, # Radius is given in meters
get_fill_color=[180, 0, 200, 140], # Set an RGBA value for fill
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"point_cloud = pdk.Layer(\n",
" 'PointCloudLayer',\n",
" lidar[['x', 'y', 'z']],\n",
" get_position='[x, y, z * 10]',\n",
" get_position='@@=[x, y, z * 10]',\n",
" get_normal=[0, 0, 1],\n",
" get_color=[255, 0, 100, 200],\n",
" pickable=True, \n",
Expand Down Expand Up @@ -103,7 +103,7 @@
"while True:\n",
" current_frame = frame_buffer[0]\n",
" lidar = all_lidar[all_lidar['source'] == current_frame]\n",
" r.layers[0].get_position = '[x / 10000, y / 10000, z * 10]'\n",
" r.layers[0].get_position = '@@=[x / 10000, y / 10000, z * 10]'\n",
" r.layers[0].data = lidar.to_dict(orient='records')\n",
" frame_buffer.rotate()\n",
" r.update()\n",
Expand Down
Loading

0 comments on commit c851b7d

Please sign in to comment.