Skip to content

Commit

Permalink
Merge 94cc1d4 into c035486
Browse files Browse the repository at this point in the history
  • Loading branch information
ajduberstein committed Mar 26, 2019
2 parents c035486 + 94cc1d4 commit f759952
Show file tree
Hide file tree
Showing 67 changed files with 3,016 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bindings/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*.ipynb
*.pyc
__pycache__
*.egg-info/
2 changes: 2 additions & 0 deletions bindings/python/deck-widget/.coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[run]
omit = DeckGLWidget/tests/*
156 changes: 156 additions & 0 deletions bindings/python/deck-widget/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py

# Flask instance folder
instance/

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/
docs/source/_static/embed-bundle.js
docs/source/_static/embed-bundle.js.map

# PyBuilder
target/

# IPython Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# dotenv
.env

# virtualenv
venv/
ENV/

# Spyder project settings
.spyderproject

# Rope project settings
.ropeproject

# =========================
# Operating System Files
# =========================

# OSX
# =========================

.DS_Store
.AppleDouble
.LSOverride

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

# Windows
# =========================

# Windows image file caches
Thumbs.db
ehthumbs.db

# Folder config file
Desktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msm
*.msp

# Windows shortcuts
*.lnk


# NPM
# ----

**/node_modules/
DeckGLWidget/nbextension/static/index.*
DeckGLWidget/labextension/*.tgz

# Coverage data
# -------------
**/coverage/

# Packed lab extensions
DeckGLWidget/labextension
7 changes: 7 additions & 0 deletions bindings/python/deck-widget/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.DS_Store
node_modules/
tests/
.jshintrc
# Ignore any build output from python:
dist/*.tar.gz
dist/*.wheel
74 changes: 74 additions & 0 deletions bindings/python/deck-widget/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
language: python
python:
- 3.7
- 3.6
- 3.5
sudo: false
dist: xenial
services:
- xvfb
addons:
apt_packages:
- pandoc
env:
matrix:
- GROUP=python
matrix:
include:
- python: 3.5
env: GROUP=js
include:
- python: 3.6
env: GROUP=docs
cache:
pip: true
directories:
- node_modules # NPM packages
- $HOME/.npm
before_install:
- pip install -U pip setuptools
- nvm install 8
- |
if [[ $GROUP == python ]]; then
pip install codecov
elif [[ $GROUP == js ]]; then
npm install -g codecov
fi
install:
- |
if [[ $GROUP == python ]]; then
pip install --upgrade ".[test]" -v
elif [[ $GROUP == js ]]; then
pip install --upgrade -e ".[test]" -v
elif [[ $GROUP == docs ]]; then
pip install --upgrade ".[test, examples, docs]" -v
fi
before_script:
# Set up a virtual screen for Firefox browser testing:
- |
if [[ $GROUP == js ]]; then
export CHROME_BIN=chromium-browser
fi
git config --global user.email travis@fake.com
git config --global user.name "Travis CI"
script:
- |
if [[ $GROUP == python ]]; then
EXIT_STATUS=0
pushd $(mktemp -d)
py.test -l --cov-report xml:$TRAVIS_BUILD_DIR/coverage.xml --cov=DeckGLWidget --pyargs DeckGLWidget || EXIT_STATUS=$?
popd
(exit $EXIT_STATUS)
elif [[ $GROUP == js ]]; then
npm test
elif [[ $GROUP == docs ]]; then
EXIT_STATUS=0
cd docs
make html || EXIT_STATUS=$?
make linkcheck || EXIT_STATUS=$?
cd ..
python -m pytest_check_links --links-ext=.md -o testpaths=. -o addopts= || EXIT_STATUS=$?
(exit $EXIT_STATUS)
fi
after_success:
- codecov
5 changes: 5 additions & 0 deletions bindings/python/deck-widget/DeckGLWidget.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"load_extensions": {
"DeckGLWidget/extension": true
}
}
10 changes: 10 additions & 0 deletions bindings/python/deck-widget/DeckGLWidget/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env python
# coding: utf-8

# Copyright (c) Uber Technologies, Inc.
# Distributed under the terms of the Modified BSD License.

from .deckgl_widget import DeckGLWidget # noqa
from ._version import __version__, version_info # noqa

from .nbextension import _jupyter_nbextension_paths # noqa
12 changes: 12 additions & 0 deletions bindings/python/deck-widget/DeckGLWidget/_frontend.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env python
# coding: utf-8

# Copyright (c) Andrew Duberstein.
# Distributed under the terms of the Modified BSD License.

"""
Information about the frontend package of the widgets.
"""

module_name = "deckgl-widget"
module_version = "^0.1.0"
8 changes: 8 additions & 0 deletions bindings/python/deck-widget/DeckGLWidget/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env python
# coding: utf-8

# Copyright (c) Andrew Duberstein.
# Distributed under the terms of the Modified BSD License.

version_info = (0, 1, 0, 'dev')
__version__ = ".".join(map(str, version_info))
28 changes: 28 additions & 0 deletions bindings/python/deck-widget/DeckGLWidget/deckgl_widget.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env python
# coding: utf-8

# Copyright (c) Uber Technologies, Inc.
# Distributed under the terms of the Modified BSD License.

"""
TODO: Add module docstring
"""
from __future__ import unicode_literals
import os

import ipywidgets as widgets
from traitlets import Unicode

from ._frontend import module_name, module_version


class DeckGLWidget(widgets.DOMWidget):
_model_name = Unicode('DeckGLModel').tag(sync=True)
_model_module = Unicode(module_name).tag(sync=True)
_model_module_version = Unicode(module_version).tag(sync=True)
_view_name = Unicode('DeckGLView').tag(sync=True)
_view_module = Unicode(module_name).tag(sync=True)
_view_module_version = Unicode(module_version).tag(sync=True)
mapbox_key = Unicode(os.getenv('MAPBOX_API_KEY')).tag(sync=True)
json_input = Unicode('').tag(sync=True)
tile_url = Unicode('').tag(sync=True)
13 changes: 13 additions & 0 deletions bindings/python/deck-widget/DeckGLWidget/nbextension/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env python
# coding: utf-8

# Copyright (c) Andrew Duberstein
# Distributed under the terms of the Modified BSD License.

def _jupyter_nbextension_paths():
return [{
'section': 'notebook',
'src': 'nbextension/static',
'dest': 'DeckGLWidget',
'require': 'DeckGLWidget/extension'
}]
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Entry point for the notebook bundle containing custom model definitions.
//
define(function() {
"use strict";

window['requirejs'].config({
map: {
'*': {
'deckgl-widget': 'nbextensions/DeckGLWidget/index',
},
}
});
// Export the required load_ipython_extension function
return {
load_ipython_extension : function() {}
};
});
Empty file.

0 comments on commit f759952

Please sign in to comment.