Skip to main content

Evaluate Vega transforms using Ibis expressions

Project description

ibis-vega-transform
binder logo Tests

Python evaluation of Vega transforms using Ibis expressions.

For inspiration, see https://github.com/jakevdp/altair-transform

Getting started

pip install ibis-vega-transform
jupyter labextension install ibis-vega-transform

Then in a notebook, import the Python package and pass in an ibis expression to a Altair chart:

import altair as alt
import ibis_vega_transform
import ibis
import pandas as pd


source = pd.DataFrame({
    'a': ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I'],
    'b': [28, 55, 43, 91, 81, 53, 19, 87, 52]
})

connection = ibis.pandas.connect({'source': source })
table = connection.table('source')

alt.Chart(table).mark_bar().encode(
    x='a',
    y='b'
)

Check out the notebooks in the ./examples/ directory to see some options using interactive charts and the OmniSci backend.

Tracing

If you want to see traces of the interactiosn for debugging and performance analysis, install the jaeger-all-in-one binary and the jupyterlab-server-proxy lab extension to see the Jaeger icon in the launcher.

conda install jaeger -c conda-forge
jupyter labextension install jupyterlab-server-proxy-saulshanabrook

The Jaeger server won't actually be started until a HTTP request is sent to it, so before you run your visualization, click the "Jaeger" icon in the JupyterLab launcher or go to /jaeger to open the UI. Then run your visualization and you should see the traces appear in Jaeger.

You also will likely have to increase the max UDP packet size on your OS to accomdate for the large logs:

Mac

# Edit now
sudo sysctl net.inet.udp.maxdgram=200000
# Edit on restart
echo net.inet.udp.maxdgram=200000 | sudo tee -a /etc/sysctl.conf

Development

To install from source, run the following in a terminal:

git clone git@github.com:Quansight/ibis-vega-transform.git

cd ibis-vega-transform
conda env create -f binder/environment.yml
conda activate ibis-vega-transform

pip install -e ".[dev]"
jlpm
jupyter labextension install . --no-build

jupyter lab --watch
jlpm run watch

A pre-commit hook is installed usig Husky (Git > 2.13 is required!) to format files.

Run the formatting tools at any time using:

black ibis_vega_transform
jlpm run prettier

Tracing

We are using jupyter-jaeger to trace each interaction for benchmarking.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ibis-vega-transform-5.1.0.tar.gz (21.6 kB view details)

Uploaded Source

Built Distribution

ibis_vega_transform-5.1.0-py3-none-any.whl (26.7 kB view details)

Uploaded Python 3

File details

Details for the file ibis-vega-transform-5.1.0.tar.gz.

File metadata

  • Download URL: ibis-vega-transform-5.1.0.tar.gz
  • Upload date:
  • Size: 21.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0.post20200712 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.6

File hashes

Hashes for ibis-vega-transform-5.1.0.tar.gz
Algorithm Hash digest
SHA256 b80f2b037c71795b720a46085492e3bf4ea0555df30031327b33c62689b167dc
MD5 be87964bb5681371918d4f41ea8f9ea5
BLAKE2b-256 d17944f0bba0f80bc282b29b8edbfb2bce7647e4388a1d6179e0eb86e826e819

See more details on using hashes here.

Provenance

File details

Details for the file ibis_vega_transform-5.1.0-py3-none-any.whl.

File metadata

  • Download URL: ibis_vega_transform-5.1.0-py3-none-any.whl
  • Upload date:
  • Size: 26.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0.post20200712 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.6

File hashes

Hashes for ibis_vega_transform-5.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 06a29f063f55f3cad7a0048f7ce94300d1e7450ec40f16deb2b15d0061f25e6a
MD5 7bc77f3cd23e474ad5f1e9f631cf06e3
BLAKE2b-256 bb93585bfd7315b226fcc33215d47f0027852eff97ab10ecbeabe99a67d790cb

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page