diff options
Diffstat (limited to 'components/valuation.py')
| -rw-r--r-- | components/valuation.py | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/components/valuation.py b/components/valuation.py index 031c424..0095f41 100644 --- a/components/valuation.py +++ b/components/valuation.py @@ -1049,26 +1049,28 @@ def _render_models(ticker: str): st.caption(ctx["summary"]) _render_model_availability(ctx) - sections = [] + sections: list[tuple[str, callable]] = [] if ctx["is_financial"] and ctx["pb_available"]: - sections.append(_render_price_to_book_model) + sections.append(("Price / Book", _render_price_to_book_model)) if ctx["dcf_available"]: - sections.append(_render_dcf_model) + sections.append(("Discounted Cash Flow", _render_dcf_model)) if ctx["ev_available"]: - sections.append(_render_ev_ebitda_model) + sections.append(("EV / EBITDA", _render_ev_ebitda_model)) if ctx["ev_revenue_available"] and not ctx["is_financial"]: - sections.append(_render_ev_revenue_model) - if ctx["pb_available"] and _render_price_to_book_model not in sections: - sections.append(_render_price_to_book_model) + sections.append(("EV / Revenue", _render_ev_revenue_model)) + section_renderers = {renderer for _, renderer in sections} + if ctx["pb_available"] and _render_price_to_book_model not in section_renderers: + sections.append(("Price / Book", _render_price_to_book_model)) if not sections: st.info("No valuation model is currently applicable for this company.") st.caption("Use comps, ratios, earnings history, and analyst targets instead.") else: - for i, render_section in enumerate(sections): + for i, (label, render_section) in enumerate(sections): if i > 0: st.divider() - render_section(ctx) + with st.expander(label, expanded=(i == 0)): + render_section(ctx) unavailable = [] if not ctx["dcf_available"]: |
