Skip to content

Commit

Permalink
refactor(dev_tools): standardize naming
Browse files Browse the repository at this point in the history
  • Loading branch information
Elijas committed Oct 10, 2023
1 parent bedcfa5 commit ac000fa
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 27 deletions.
9 changes: 5 additions & 4 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,12 @@ tasks:
### Developer Tools ###
#######################

web:
desc: Launch the Web Application.
dash:
desc: Launch the debug dashboard for debugging and demos.
cmds:
# PYTHONPATH is added to make streamlit watch file changes. Read more: https://docs.streamlit.io/knowledge-base/using-streamlit/streamlit-watch-changes-other-modules-importing-app
- export PYTHONPATH=$PYTHONPATH:$(pwd)/sec_ai; poetry run streamlit run sec_ai/web/app.py --server.runOnSave=true
# Extend PYTHONPATH to allow Streamlit to watch for file changes.
# Learn more: https://docs.streamlit.io/knowledge-base/using-streamlit/streamlit-watch-changes-other-modules-importing-app
- export PYTHONPATH=$PYTHONPATH:$(pwd)/sec_parser && poetry run streamlit run dev_utils/debug_dashboard/app.py --server.runOnSave=true

docs:
desc: Run the documentation server.
Expand Down
File renamed without changes.
7 changes: 2 additions & 5 deletions sec_ai/web/app.py → dev_utils/debug_dashboard/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
import streamlit as st
import streamlit_pills as stp # type: ignore # noqa: PGH003

from sec_ai.web.dashboard_helpers_and_types import DemoOption
from sec_ai.web.streamlit_ui_customizations import (
st_hide_page_element,
)
from dev_utils.debug_dashboard.streamlit_utils import DemoOption, st_hide_page_element

# Setup page
st.set_page_config(
Expand Down Expand Up @@ -52,6 +49,6 @@
left, right = st.columns(2)
if selected_demo == demo_options["MDNA_SUMMARIZATION"]:
with left, st.expander("**SEC EDGAR** INPUT", expanded=True):
st.write("left")
st.write("lefft")
with right, st.expander("**SEC-AI** OUTPUT", expanded=True):
st.write("right")
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import sec_parser as sp
import streamlit as st

from sec_ai.web.config import get_config
from dev_utils.debug_dashboard.config import get_config


class SecDataRetriever:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
from __future__ import annotations

import streamlit as st


def st_hide_page_element(*, tag_name: str, key: str, value: str) -> None:
st.markdown(
f"""
<style>
{tag_name}[{key}="{value}"] {{
visibility: hidden;
height: 0%;
position: fixed;
}}
</style>
""",
unsafe_allow_html=True,
)


class DemoOption:
@classmethod
Expand Down
16 changes: 0 additions & 16 deletions sec_ai/web/streamlit_ui_customizations.py

This file was deleted.

Empty file added tests/unit/__init__.py
Empty file.
2 changes: 1 addition & 1 deletion tests/unit/test_hello.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@


def test_hello():
assert hello() == "Hello, world!"
assert hello() == "Hello, world!"

0 comments on commit ac000fa

Please sign in to comment.