Skip to content

Commit ad93ae9

Browse files
committed
Code tidied for Black requirements
1 parent ddd4efc commit ad93ae9

File tree

1 file changed

+13
-18
lines changed

1 file changed

+13
-18
lines changed

streamlit_hypergraphs.py

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,8 @@
11
###############################################################################
22
# Libraries and Imports
33
###############################################################################
4-
import os
54
import streamlit as st
65
import base64
7-
import pandas as pd
8-
import numpy as np
9-
from scipy import linalg
10-
11-
# from sklearn import preprocessing
12-
from string import ascii_uppercase as auc
13-
14-
# local
15-
from src import build_model, centrality, centrality_utils, weight_functions
166
from src import numpy_utils
177
import tab0_mot_tab
188
import tab1_undirect
@@ -25,7 +15,7 @@
2515

2616
st.set_page_config(
2717
page_title="Multimorbidity Calculations",
28-
page_icon="https://www.england.nhs.uk/wp-content/themes/nhsengland/static/img/favicon.ico",
18+
page_icon="https://www.england.nhs.uk/wp-content/themes/nhsengland/static/img/favicon.ico", # noqa: E501
2919
layout="centered",
3020
initial_sidebar_state="expanded",
3121
menu_items={
@@ -61,7 +51,7 @@ def render_svg(svg):
6151
<path d="M0 0h40v16H0z" fill="#005EB8"></path>
6252
<path d="M3.9 1.5h4.4l2.6 9h.1l1.8-9h3.3l-2.8 13H9l-2.7-9h-.1l-1.8 9H1.1M17.3 1.5h3.6l-1 4.9h4L25 1.5h3.5l-2.7 13h-3.5l1.1-5.6h-4.1l-1.2 5.6h-3.4M37.7 4.4c-.7-.3-1.6-.6-2.9-.6-1.4 0-2.5.2-2.5 1.3 0 1.8 5.1 1.2 5.1 5.1 0 3.6-3.3 4.5-6.4 4.5-1.3 0-2.9-.3-4-.7l.8-2.7c.7.4 2.1.7 3.2.7s2.8-.2 2.8-1.5c0-2.1-5.1-1.3-5.1-5 0-3.4 2.9-4.4 5.8-4.4 1.6 0 3.1.2 4 .6" fill="white"></path>
6353
</svg>
64-
"""
54+
""" # noqa: E501
6555
render_svg(svg)
6656

6757

@@ -84,7 +74,7 @@ def render_svg(svg):
8474
num_patients = st.sidebar.slider(
8575
"Number of patients to generate", min_value=5, max_value=20
8676
)
87-
num_dis = st.sidebar.slider("Number of diseases to generate", min_value=2, max_value=5)
77+
num_dis = st.sidebar.slider("Number of diseases", min_value=2, max_value=5)
8878

8979
if st.sidebar.checkbox("Show Maximum Number of Edges"):
9080
st.sidebar.write(
@@ -137,9 +127,9 @@ def render_svg(svg):
137127

138128
# Calculate the number of possible bf-hyperarcs
139129
st.sidebar.subheader("BF-Hyperarcs (Directed Hypergraph)")
140-
max_bf_hyperarcs = numpy_utils.N_max_hyperarcs(n_diseases=num_dis, b_hyp=False)
130+
max_bf_arcs = numpy_utils.N_max_hyperarcs(n_diseases=num_dis, b_hyp=False)
141131
st.sidebar.write(
142-
max_bf_hyperarcs,
132+
max_bf_arcs,
143133
"BF-hyperarcs in a hypergraph (with self-loops)",
144134
)
145135

@@ -179,7 +169,13 @@ def render_svg(svg):
179169
# TAB1 = UNDIRECTED HYPERGRAPH
180170
###########################################################################
181171

182-
tab1_undirect.tab1_undirected(tab1, final_prog_df, num_dis, edge_list, dis_list)
172+
tab1_undirect.tab1_undirected(
173+
tab1,
174+
final_prog_df,
175+
num_dis,
176+
edge_list,
177+
dis_list,
178+
)
183179

184180
###########################################################################
185181
# TAB2 = DIRECTED HYPERGRAPH
@@ -190,8 +186,6 @@ def render_svg(svg):
190186
final_prog_df,
191187
dis_list,
192188
edge_list,
193-
binmat,
194-
conds_worklist,
195189
all_progs,
196190
num_dis,
197191
)
@@ -215,6 +209,7 @@ def render_svg(svg):
215209
# TODO: Implement
216210

217211
# TODO: NUMBA explained (why we need it and the 3 worklists)
212+
# Link to Github repository
218213

219214
st.markdown("-" * 50)
220215
st.text("Last Updated 22nd May 2023 \t\t\t\t\t Version 0.1.0")

0 commit comments

Comments
 (0)