Day8

(Over the weekend, I talked to my dad about the load error I encountered and my solution of rebooting the app. He said it didn’t seem like a caching problem, and that it was probably an error from Streamlit.)

During 5th period today, I had an extremely stressful session of debugging.
My main goals were to:

  1. Get rid of error that arises when no pill-buttons are selected
  2. Resolve the key error type B that kept arising
  3. Remove multiplicity when generating results

My goal #1 was achieved easily by adding in an if statement to only start the generate_results function once a pill is selected.

Goal #2 was a HUGE, LONG struggle. By adding in st.write statements here and there to check if parts of my code resulted in strings or lists, I found out that the key error type B was due to the code attempting to find value(s) for a key “B,” the first letter of a grant where the chosen purpose only generated one matching grant. (From here on out, I’m writing a day later but still about Day 8) I realized that this weird phenomenon was occuring because the code in the generate_results took each LETTER of the single value (type str) instead of each ELEMENT in a list(or fake list). Resolving goal #2 took a long time, but eventually I figured it out by encasing a part of my code in brackets to manually make it an element. This went back to our past trainings and missions about list and elements. I was constantly reminded of my experience with Matryoshka during my debugging process, because Matryoshka was all about traits of lists and list elements. Like my time with Matryoshka, I was very frustrated throughout my debugging process. I think the frustration (which I think the parallel with Matryoshka made worse) blinded me a little, and I think if I just took a moment to look at the whole picture and go through it step by step, I could have resolved the issue sooner. But anyways, I was very very happy when I figured it out in the end.

Goal #3 was quite a quick fix by changing the data type of the list of all of the generated results into a set. I was able to think of this quickly, thanks to our past unit on sets!

I ended Day 8 with a no error generating, fully functioning final project!
My page:

  • Can select an association with Uni
  • to display buttons that show purposes for grants that are available for that association
  • which, when clicked (multi-selectable), generate buttons to grants
  • that can be clicked to lead the user to the application pdf or document

As of Day 9:

Future steps:

  1. Make the page more visually appealing
  2. Clean up the code (comments, remove/simplify unnecessary bits, rearrange to make it more readable)
  3. Generate a short description of the grant below the application button? (maybe achievable, maybe not)

Additional FUTURE Future steps (probably post-class project deadline):

  1. Order results in percent match (but hard with some grants with specific requirements like grade level/gender/subject)
  2. Potentially add page to Uni High website? (Can bring it up during first SFAC meeting back from Winter Break)
  3. Organize pill-buttons (purposes) in a more readable arrangement
  4. (Taking #3 further) Organize pill-buttons in relevancy/frequently used (I have no idea how to do this)
Written on December 16, 2024