Skip to content
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
19 changes: 6 additions & 13 deletions .streamlit/config.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
[theme]
primaryColor = "#FF4B4B"
backgroundColor = "#FFFFFF"
secondaryBackgroundColor = "#F0F2F6"
textColor = "#262730"
font = "sans serif"
base="light"
primaryColor="#FF4B4B"
backgroundColor="#FFFFFF"
secondaryBackgroundColor="#F0F2F6"
textColor="#262730"

[server]
enableCORS = true
enableXsrfProtection = true

[browser]
gatherUsageStats = false

[logger]
level = "info"
headless=true
14 changes: 7 additions & 7 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ After completing a milestone, create a pull request with your changes for review
- [x] Create repository structure
- [x] Set up README.md
- [x] Create requirements.txt
- [ ] Create main application entry point (app.py) with basic structure
- [ ] Set up project configuration
- [ ] Add sample datasets in data directory
- [ ] Implement basic UI theme and layout
- [ ] Create utility module structure
- [ ] Setup testing framework and basic test structure
- [ ] Create tests for the initial application structure
- [x] Create main application entry point (app.py) with basic structure
- [x] Set up project configuration
- [x] Add sample datasets in data directory
- [x] Implement basic UI theme and layout
- [x] Create utility module structure
- [x] Setup testing framework and basic test structure
- [x] Create tests for the initial application structure

## PR2: Data Import & Management

Expand Down
29 changes: 29 additions & 0 deletions app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
"""Main entry point for PredictStream."""

import streamlit as st
from utils import config

st.set_page_config(page_title="PredictStream", layout="wide")


def main() -> None:
"""Render the main page."""
st.title("PredictStream")
st.write("Upload a dataset to get started or explore sample datasets.")

uploaded_file = st.file_uploader(
"Upload CSV or Excel file", type=["csv", "xlsx", "xls"], key="file_uploader"
)

if uploaded_file is not None:
st.success("File uploaded successfully!")

st.subheader("Sample Datasets")
for name, path in config.SAMPLE_DATASETS.items():
if st.button(f"Load {name}"):
st.session_state["uploaded_file"] = path.read_bytes()
st.success(f"{name} loaded!")


if __name__ == "__main__":
main()
11 changes: 11 additions & 0 deletions data/samples/iris_sample.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
sepal_length,sepal_width,petal_length,petal_width,species
5.1,3.5,1.4,0.2,setosa
4.9,3.0,1.4,0.2,setosa
4.7,3.2,1.3,0.2,setosa
4.6,3.1,1.5,0.2,setosa
5.0,3.6,1.4,0.2,setosa
5.4,3.9,1.7,0.4,setosa
4.6,3.4,1.4,0.3,setosa
5.0,3.4,1.5,0.2,setosa
4.4,2.9,1.4,0.2,setosa
5.0,3.5,1.3,0.3,setosa
11 changes: 11 additions & 0 deletions data/samples/tips_sample.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
total_bill,tip,sex,smoker,day,time,size
16.99,1.01,Female,No,Sun,Dinner,2
10.34,1.66,Male,No,Sun,Dinner,3
21.01,3.50,Male,No,Sun,Dinner,3
23.68,3.31,Male,No,Sun,Dinner,2
24.59,3.61,Female,No,Sun,Dinner,4
25.29,4.71,Male,No,Sun,Dinner,4
8.77,2.00,Male,No,Sun,Dinner,2
26.88,3.12,Male,No,Sun,Dinner,4
15.04,1.96,Male,No,Sun,Dinner,2
14.78,3.23,Male,No,Thur,Lunch,2
2 changes: 2 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[pytest]
addopts = -vv
Empty file added tests/__init__.py
Empty file.
13 changes: 13 additions & 0 deletions tests/test_structure.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from importlib import import_module

from utils import config


def test_sample_files_exist():
for path in config.SAMPLE_DATASETS.values():
assert path.exists(), f"Sample dataset missing: {path}"


def test_app_importable():
app = import_module("app")
assert hasattr(app, "main")
Empty file added utils/__init__.py
Empty file.
10 changes: 10 additions & 0 deletions utils/config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from pathlib import Path

BASE_DIR = Path(__file__).resolve().parent.parent
DATA_DIR = BASE_DIR / "data"
SAMPLE_DIR = DATA_DIR / "samples"

SAMPLE_DATASETS = {
"Iris Sample": SAMPLE_DIR / "iris_sample.csv",
"Tips Sample": SAMPLE_DIR / "tips_sample.csv",
}