Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

make streamlit use wide mode #44

Merged
merged 4 commits into from
Nov 14, 2023
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
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ jobs:
body: |
:x: **pre-commit** failed.
Please run `pre-commit run --all-files` locally and commit the changes.
Find more information in the repository's CONTRIBUTING.md
Find more information in the repository's CONTRIBUTING.md
6 changes: 0 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,3 @@ repos:
hooks:
- id: isort
args: ["--profile", "black"]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.5
hooks:
- id: ruff
args: ["--ignore", "E501, E711, E712"] # ignore line length and comparison to None, refer full list of codes here: https://pycodestyle.pycqa.org/en/latest/intro.html#error-codes
- id: ruff-format
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ SHELL=/bin/bash
.PHONY: dashboard
.PHONY: local
.PHONY: docker
.PHONY: pre-commit

## start streamlit dashboard
dashboard:
Expand All @@ -16,11 +17,14 @@ local:
docker:
docker compose up -d --build

## pre-commit
pre-commit:
pre-commit run --all-files

## setup local development environment and install dependencies
dev:
pre-commit install


# Self-documenting Makefiles:
# https://gist.github.com/klmr/575726c7e05d8780505a
.DEFAULT_GOAL := show-help
Expand Down
3 changes: 3 additions & 0 deletions dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

load_dotenv()

st.set_page_config(layout="wide")


def plot_time_series(df, metric_name) -> go.Figure:
"""
Expand Down Expand Up @@ -61,6 +63,7 @@ def plot_time_series(df, metric_name) -> go.Figure:
title_text=f"{metric_name} (n={len(df)})",
hovermode="x",
legend=dict(orientation="h", yanchor="bottom", y=1.02, xanchor="right", x=1),
autosize=True,
)

return fig
Expand Down
1 change: 0 additions & 1 deletion metrics/examples/hackernews/hn_top_stories_scores.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ alert_always: False
alert_methods: "email"
ingest_fn: >
{% include "./examples/hackernews/hn_top_stories_scores.py" %}

1 change: 0 additions & 1 deletion metrics/examples/netdata/netdata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ alert_always: False
alert_methods: "email"
ingest_fn: >
{% include "./examples/netdata/netdata.py" %}

Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@ train_cron_schedule: "*/4 * * * *"
score_cron_schedule: "*/3 * * * *"
ingest_fn: >
{% include "./examples/python/python_ingest_simple/ingest.py" %}

1 change: 0 additions & 1 deletion metrics/examples/weather/weather.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ alert_always: False
alert_methods: "email"
ingest_fn: >
{% include "./examples/weather/ingest_weather.py" %}

1 change: 0 additions & 1 deletion metrics/examples/weather_forecast/weather_forecast.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,3 @@ alert_always: False
alert_methods: "email"
ingest_sql: >
{% include "./examples/weather_forecast/weather_forecast.sql" %}

1 change: 0 additions & 1 deletion metrics/examples/yfinance/yfinance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ alert_always: False
alert_methods: "email"
ingest_fn: >
{% include "./examples/yfinance/yfinance.py" %}

Loading