Skip to content
Snippets Groups Projects

fix: Reme badpixel page, Add missing single constant view page, and add...

Merged Karim Ahmed requested to merge fix/small_page_fixes into master
Files
10
+ 11
9
@@ -44,21 +44,23 @@ def select_pdu(pdus_to_dict):
def display_constants(
constants_found: List[dict], det_config: DetectorConfiguration):
num_total_ccvs = 0
num_available_ccvs = 0
for c in constants_found:
num_total_ccvs = len(c['calibration_constant_versions'])
num_available_ccvs = len([ccv for ccv in c["calibration_constant_versions"] if ccv['flg_deployed']])
num_available_ccvs = len(
[ccv for ccv in c["calibration_constant_versions"] if ccv['flg_deployed']])
num_unavailable_ccvs = num_total_ccvs - num_available_ccvs
unavailable_ccvs_str = f"and `{num_unavailable_ccvs}` unavailable CCVs " if num_unavailable_ccvs else "" # noqa
st.markdown(
f"ID `{c['id']}`: `{c['name'].strip()}` with "
f"`{num_available_ccvs}` available CCVs {unavailable_ccvs_str}"
f"(for condition `{c['condition']['id']}`) - open "
f"in [CalCat]({det_config.cw.base_url}/calibration_constants/{c['id']})"
)
st.markdown(
f"Found `{num_available_ccvs}` available CCVs {unavailable_ccvs_str}"
f"(for condition `{c['condition']['id']}`) - open "
f"in [CalCat]({det_config.cw.base_url}/calibration_constants/{c['id']})"
)
with st.expander(f"CCVs"):
with st.expander("CCVs"):
for c in constants_found:
ccvs_md = ""
available_ccvs = []
for ccv in c["calibration_constant_versions"]:
Loading