Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

update random walk so it can be used with multiple users #126

Merged
merged 23 commits into from
Jun 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
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
23 changes: 10 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,26 @@ cache:
addons:
chrome:
stable
apt:
packages:
- libenchant-dev

python:
# We don't actually use the Travis Python, but this keeps it organized.
- "3.5"
- "3.6"

before_script:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- sleep 3 # give xvfb some time to start

before_install:
- docker pull lukasmartinelli/hadolint
- nvm install node
- curl -o- -L https://yarnpkg.com/install.sh | bash
- export PATH="$HOME/.yarn/bin:$PATH"

install:
- curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
- echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
- docker run --rm -i lukasmartinelli/hadolint hadolint --ignore DL3008 --ignore DL3013 - < Dockerfile
- google-chrome --version
- google-chrome-stable --version
- sudo apt-get update
- sudo apt-get install xvfb libenchant1c2a yarn
- node --version
- yarn --version
- yarn global add eslint babel-eslint eslint-plugin-react
- make eslint
- export PATH="$HOME/miniconda/bin:$PATH"
- if ! hash conda 2>/dev/null; then
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
Expand All @@ -53,11 +48,13 @@ install:
- wget https://chromedriver.storage.googleapis.com/2.40/chromedriver_linux64.zip
- unzip chromedriver_linux64.zip
- chmod +x chromedriver
- sudo mv -f chromedriver /usr/local/bin
- mv -f chromedriver $HOME/.yarn/bin
- wget https://github.com/errata-ai/vale/releases/download/v0.11.2/vale_0.11.2_Linux_64-bit.tar.gz
- tar xvf vale_0.11.2_Linux_64-bit.tar.gz

script:
- docker run --rm -i lukasmartinelli/hadolint hadolint --ignore DL3008 --ignore DL3013 - < Dockerfile
- make eslint
- cd doc && make spelling && cd ..
- ./vale --glob='*.rst' doc
- make checkdocs
Expand Down
1 change: 0 additions & 1 deletion bowtie/_app.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""Defines the App class."""

from typing import ( # pylint: disable=unused-import
Expand Down
1 change: 0 additions & 1 deletion bowtie/_cache.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""Bowtie cache functions."""

import flask
Expand Down
1 change: 0 additions & 1 deletion bowtie/_command.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
Decorates a function for Bowtie.

Expand Down
1 change: 0 additions & 1 deletion bowtie/_component.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""Bowtie abstract component classes.

All visual and control components inherit these.
Expand Down
1 change: 0 additions & 1 deletion bowtie/_magic.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""Jupyter Integration."""

import ast
Expand Down
1 change: 0 additions & 1 deletion bowtie/_progress.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""Progress component.

Not for direct use by user.
Expand Down
1 change: 0 additions & 1 deletion bowtie/_typing.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""Bowtie types."""

from typing import Any, Union, Mapping, List
Expand Down
1 change: 0 additions & 1 deletion bowtie/_utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""Utility functions."""

import inspect
Expand Down
1 change: 0 additions & 1 deletion bowtie/control.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""Control components."""

from typing import Callable, Optional, List, Union, Tuple
Expand Down
1 change: 0 additions & 1 deletion bowtie/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""Bowtie exceptions."""


Expand Down
1 change: 0 additions & 1 deletion bowtie/feedback/message.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""Messages provide a temporary message that will disappear after a few seconds.

Reference
Expand Down
1 change: 0 additions & 1 deletion bowtie/html.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""Static HTML Components."""

from flask import Markup
Expand Down
1 change: 0 additions & 1 deletion bowtie/pager.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""Bowtie pager."""

import flask
Expand Down
1 change: 0 additions & 1 deletion bowtie/templates/server.py.j2
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import os
import sys
Expand Down
1 change: 0 additions & 1 deletion bowtie/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Pytest configuration."""

from sys import platform
Expand Down
1 change: 0 additions & 1 deletion bowtie/tests/test_cache.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""Test markdown and text widgets."""

import time
Expand Down
1 change: 0 additions & 1 deletion bowtie/tests/test_command.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Command testing."""

from bowtie._command import numargs
Expand Down
1 change: 0 additions & 1 deletion bowtie/tests/test_compile.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Compile tests."""

from bowtie import App
Expand Down
1 change: 0 additions & 1 deletion bowtie/tests/test_components.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Test all components for instatiation issues."""

import os
Expand Down
1 change: 0 additions & 1 deletion bowtie/tests/test_editor.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""Test markdown and text widgets."""

import os
Expand Down
1 change: 0 additions & 1 deletion bowtie/tests/test_layout.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""Test layout functionality."""
# pylint: disable=redefined-outer-name,protected-access

Expand Down
1 change: 0 additions & 1 deletion bowtie/tests/test_multiple.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# pylint: disable=unused-argument,invalid-name
"""Multiple views testing."""

Expand Down
1 change: 0 additions & 1 deletion bowtie/tests/test_plotly.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Plotly testing."""

import os
Expand Down
1 change: 0 additions & 1 deletion bowtie/tests/test_serialize.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Serialization testing."""

import numpy as np
Expand Down
1 change: 0 additions & 1 deletion bowtie/tests/test_tags.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""Test tag instantation for components."""

from bowtie.html import Markdown
Expand Down
1 change: 0 additions & 1 deletion bowtie/tests/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Compat testing."""

from bowtie._utils import func_name
Expand Down
1 change: 0 additions & 1 deletion bowtie/tests/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""Utility functions for testing only."""

import os
Expand Down
1 change: 0 additions & 1 deletion bowtie/visual.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""Visual components."""

from typing import Dict, Optional, List, Union, Tuple
Expand Down
4 changes: 4 additions & 0 deletions doc/spelling_wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,20 @@ app
backend
conda
config
decrement
draggable
dropdown
frontend
func
getter
getters
iframe
indices
io
matplotlib
metaclass
metaclasses
minified
minmax
npm
popup
Expand Down
23 changes: 15 additions & 8 deletions examples/random_walk.py
Original file line number Diff line number Diff line change
@@ -1,29 +1,35 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Example Bowtie App.
"""
"""Example Bowtie App."""

from bowtie.control import Nouislider
from bowtie.visual import Plotly
from bowtie import command
from bowtie import Pager, cache, command

import numpy as np
from numpy import random as rng
import plotlywrapper as pw


sigma = Nouislider(caption='Sigma', start=1, minimum=0.1, maximum=50)
pager = Pager()
sigma = Nouislider(caption='Sigma', start=0., minimum=0.1, maximum=50.)
mainplot = Plotly()

data = np.zeros(100).tolist()

def initialize():
cache.save('data', [0.] * 100)

def walk():

def upgraph():
data = cache.load('data')
value = float(sigma.get())
data.pop(0)
data.append(value * rng.randn() + data[-1])
mainplot.do_all(pw.line(data).to_json())
cache.save('data', data)


def walk():
pager.notify()


@command
Expand All @@ -33,4 +39,5 @@ def main():
app.add_sidebar(sigma)
app.add(mainplot)
app.schedule(0.1, walk)
app.respond(pager, upgraph)
return app