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

Dashboard extentions #34

Merged
merged 2 commits into from
Aug 22, 2024
Merged

Dashboard extentions #34

merged 2 commits into from
Aug 22, 2024

Conversation

Polariod
Copy link
Collaborator

Piechart added with small reforrmatting.

Copy link

codecov bot commented Aug 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Flag Coverage Δ
pytest 68.47% <ø> (-0.44%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 2 files with indirect coverage changes

@@ -12,8 +14,12 @@
DB_PASSWORD = os.getenv('DB_PASSWORD')
DB_NAME = os.getenv('DB_NAME')

CURRENT_TIME = dt.datetime.now()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, reasonable time window.

raise ConnectionError("Failed to connect to Database")

def submit_form(self, name, email, postcode, hours_to_charge, charging_preference):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this susceptible to an injection attacks? Okay got MVP but will need altering.

return alt.Chart(df_fuel_types[["publish_time", "generated", "fuel_type"]]).mark_line().encode(
x=alt.X('publish_time:T', title='Time'), y=alt.Y('generated:Q', title='Energy Generated MW'),
color="fuel_type").properties(width=1000, height=1000)

def generate_piechart(self, pie_df):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a surprisingly simple code snippet for a chart.

with st.container():
st.header("Where is your energy coming from ? ")
st.write("Interconnectors are high-voltage links allowing electricity to flow between regions or countries, providing crucial flexibility and reliability to power supplies. They help balance energy demand and supply, integrate renewable energy sources, and enhance grid resilience and sustainability. This leads to more stable electricity prices and a more reliable power supply for everyone.")
st.altair_chart(self.generation_interconnection(filtered_df))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good.

@JoshuaMarden JoshuaMarden merged commit 0a2b77f into main Aug 22, 2024
9 checks passed
@JoshuaMarden JoshuaMarden deleted the dashboard_extentions branch August 22, 2024 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants