import streamlit as st
import numpy as np
import pandas as pd
print("\x1b[1;92mStreamlit script running...\x1b[0m")
import streamlit as st
import pandas as pd
# Set page configuration
st.set_page_config(page_title="Project Hours Tracker", layout="wide")
# Sidebar - Project selection
st.sidebar.title("Project Selection")
project_name = st.sidebar.selectbox("Choose a project:", ["TSMC AP1", "TSMC AP1 South Complex Gas Yard"])
# Main title
st.title("Project Hours Tracking Application")
# Section: Hour Input
st.header("Enter Estimated Hours")
roles = ["LEA", "LEI"]
disciplines = [
"Process & Systems Engineering - A1BP",
"Process & Environmental Safety - A1CS",
"Control Systems - A1CF",
"Fill Zone - A1FZ",
"Instrumentation - A1BJ",
"Electrical Engineering - A1EE",
"Engineering Management - A1AE",
"Information Management - A1AD",
"Rotating Equipment - A1DM",
"Static Equipment -A1DB",
"Engineering & Application Management - A1KA",
"Plant Layout & Piping Design - A1KL",
"Piping Materials & Pipe Stress Analysis - A1KR",
"Civil, Steel Structures & Buildings - A1KC",
"Quality Assurance/Quality Control - A1DT",
"Control Systems - F1CF",
"Electrical Engineering - F1EE",
"Engineering Management - F1AE",
"Fill zone - F1FZ",
"Instrumentation - F1BJ",
"Plant Components - F1DM",
"Plant Design - F1KL",
"Process & Systems Engineering - F1BP"
]
# Create a dataframe to store hours
hours_data = []
for discipline in disciplines:
row = {"Discipline": discipline}
for role in roles:
row[role] = st.number_input(f"{discipline} - {role}", min_value=0, step=1, key=f"{discipline}_{role}")
row["Total"] = row["LEA"] + row["LEI"]
hours_data.append(row)
hours_df = pd.DataFrame(hours_data)
# Display hours table
st.subheader("Hours Summary")
st.dataframe(hours_df)
# Section: Third-Party Costs
st.header("Enter Third-Party Support Costs (USD)")
third_party_items = [
"3rd Party Plant Design",
"Tie-in laser scan",
"Geotech (settlement analysis & recommendations)",
"Permitting",
"PE Mechanical Completion assessment site visits",
"QA / QC Support",
"China 3rd Party Support - CDA Buffer Vessels",
"China 3rd Party Support - Vacuum Insulated Tanks",
"China 3rd Party Support - FADV",
"Local 3rd Party Support - ENC Purifier Onsite QA/QC (2 trips/purifier)",
"APAC Region Support - ENC High Pressure Buffer QA/QC (4 trips)",
"APAC Region Support - ENC UHP LOX TM QA/QC (1 trip)",
"APAC Region Support - ENC NIC Testing + Final (2 trips)",
"EMEA Region Support",
"PE Mechanical Completion assessment site visits"
]
third_party_costs = {}
for item in third_party_items:
cost = st.number_input(f"{item}", min_value=0.0, step=100.0, format="%.2f", key=item)
third_party_costs[item] = cost
# Display third-party costs
st.subheader("Third-Party Costs Summary")
costs_df = pd.DataFrame(list(third_party_costs.items()), columns=["Item", "Cost (USD)"])
st.dataframe(costs_df)
# Totals
total_hours = hours_df["Total"].sum()
total_costs = costs_df["Cost (USD)"].sum()
st.markdown("---")
st.metric("Total Estimated Hours", total_hours)
st.metric("Total Third-Party Costs (USD)", f"${total_costs:,.2f}")