Fredrik Sitje commited on
Commit
2dc8eb5
·
1 Parent(s): 2161cac

Add term_category_pairs retrieval for jurisdiction in Streamlit app

Browse files

This update introduces the retrieval of term_category_pairs for the selected jurisdiction, enhancing data handling within the app. The debug information section has been updated to reflect this addition, improving the overall user experience and maintainability of the code.

Files changed (1) hide show
  1. src/streamlit_app.py +4 -4
src/streamlit_app.py CHANGED
@@ -724,6 +724,10 @@ elif st.session_state.logged_in:
724
  # Load grading template for the selected jurisdiction
725
  df = load_grading_template(jurisdiction)
726
 
 
 
 
 
727
  # Debug info (can be removed in production)
728
  with st.sidebar:
729
  with st.expander("Debug Info"):
@@ -872,10 +876,6 @@ elif st.session_state.logged_in:
872
  st.session_state.next_term = None
873
  st.rerun()
874
 
875
- # Get term_category_pairs for this jurisdiction
876
- term_category_pairs = get_term_category_pairs(df)
877
- total_pairs = len(term_category_pairs)
878
-
879
  elif current_index < total_pairs:
880
  term_name, category_name = term_category_pairs[current_index]
881
  category = get_category_for_pair(term_name, category_name, df)
 
724
  # Load grading template for the selected jurisdiction
725
  df = load_grading_template(jurisdiction)
726
 
727
+ # Get term_category_pairs for this jurisdiction
728
+ term_category_pairs = get_term_category_pairs(df)
729
+ total_pairs = len(term_category_pairs)
730
+
731
  # Debug info (can be removed in production)
732
  with st.sidebar:
733
  with st.expander("Debug Info"):
 
876
  st.session_state.next_term = None
877
  st.rerun()
878
 
 
 
 
 
879
  elif current_index < total_pairs:
880
  term_name, category_name = term_category_pairs[current_index]
881
  category = get_category_for_pair(term_name, category_name, df)