Skip to content

Conversation

Chaitanya-Keyal
Copy link
Contributor

Description

This PR refactors the seed views to pass the selected Seed object directly to the next view instead of using seed_num.

Previously, almost every view would immediately dereference seed_num to fetch the Seed object from SeedStorage, resulting in redundant lookups. Passing the Seed object itself removes that redundancy and provides a more robust reference to the selected seed, avoiding potential fragility in the future.

The motivation for this change came up while I was working on #785. In that context, it became clear that relying on seed_num is brittle, since it’s only the index of a mutable list. See my comment for details.

Benefits:

  • Removes redundant lookups in views
  • More robust references to seeds
  • Safer against future changes in seed storage (e.g., reordering, new seed types(?))

This pull request is categorized as a:

  • Code refactor

Checklist

  • I’ve run pytest and made sure all unit tests pass before submitting the PR

If you modified or added functionality/workflow, did you add new unit tests?

  • N/A

I have tested this PR on the following platforms/os:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant