Metadata-Version: 2.1
Name: streamlit-pollination
Version: 0.1.0
Summary: A streamlit extention to interact with Pollination Cloud
Home-page: https://github.com/pollination/streamlit-pollination
Author: Ladybug Tools
Author-email: info@ladybug.tools
License: AGPL-3.0
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
Classifier: Operating System :: OS Independent
Description-Content-Type: text/markdown
Requires-Dist: streamlit (>=1.1.0)
Requires-Dist: requests
Requires-Dist: queenbee

# Streamlit Pollination

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

## Quickstart

```python
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)
```

