Skip to main content

A streamlit extention to interact with Pollination Cloud

Project description

Streamlit Pollination

A collection of objects to facilitate working with Pollination in Streamlit.

Quickstart

import json
import pathlib

import hiplot
import numpy as np
import streamlit as st
from honeybee_vtk.model import HBModel, Model
from streamlit_pollination.selectors import job_selector
from streamlit_vtkjs import st_vtkjs

job = job_selector()

if job is not None:
    df = job.runs_dataframe

    st.markdown("## Runs Dataframe")
    plt = hiplot.Experiment.from_dataframe(df)
    plt.display_st()

    run_number = st.select_slider(
        'Select a run',
        options=range(0, df.shape[0])
    )

    run_row = df.iloc[run_number]
    model_path = run_row.model
    model_dict = json.load(job.download_artifact(model_path))
    hb_model = HBModel.from_dict(model_dict)
    vtk_model = Model(hb_model)
    key = run_row['run-id']
    file = pathlib.Path(vtk_model.to_vtkjs('data', key))
    st_vtkjs(file.read_bytes(), menu=True, key=key)

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

streamlit-pollination-0.1.0.tar.gz (6.7 kB view hashes)

Uploaded Source

Built Distribution

streamlit_pollination-0.1.0-py2.py3-none-any.whl (9.2 kB view hashes)

Uploaded Python 2 Python 3

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