From c6616691753956ccbb7f4702c1314757662cb9fb Mon Sep 17 00:00:00 2001 From: Paige Miller Date: Mon, 13 Jan 2025 17:06:40 +0000 Subject: [PATCH 1/2] changing default sigfigs --- ngm/app.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ngm/app.py b/ngm/app.py index fdf9c53..1b13ca9 100644 --- a/ngm/app.py +++ b/ngm/app.py @@ -269,8 +269,8 @@ def app(): sigdigs = st.slider( "Displayed significant figures", 1, - 4, - value=3, + 3, + value=2, step=1, help="Values are reported only to this many significant figures.", ) From ca271d6086fe58b79eb0d052fc3253ba9e993f9b Mon Sep 17 00:00:00 2001 From: Paige Miller Date: Tue, 14 Jan 2025 21:16:24 +0000 Subject: [PATCH 2/2] ngm table has sigdigs --- ngm/app.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ngm/app.py b/ngm/app.py index 1b13ca9..651e875 100644 --- a/ngm/app.py +++ b/ngm/app.py @@ -149,6 +149,9 @@ def summarize_scenario( .with_columns(pl.Series("", [f"to {grp}" for grp in params["group_names"]])) .select(["", *[f"from {grp}" for grp in params["group_names"]]]) ) + ngm_df = ngm_df.with_columns( + [pl.col(col).round_sig_figs(sigdigs) for col in ngm_df.columns[1:]] + ) c.dataframe(ngm_df) c.write(ngm_help)